sql-template-tag
sqlc-gen-python
sql-template-tag | sqlc-gen-python | |
---|---|---|
3 | 1 | |
319 | 82 | |
- | - | |
6.3 | 6.6 | |
about 1 month ago | 17 days ago | |
TypeScript | Go | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sql-template-tag
-
Python: Just Write SQL
You can avoid this entirely with JavaScript's tagged template literals. Here is an example library: https://github.com/blakeembrey/sql-template-tag
-
Knex Raw SQL String SQL Highlighting VS Code and best practices to avoid SQL Injection Attack?
If you prefer SQL and you use postgres you can check out slonik. If you want to keep using knex you can use https://github.com/blakeembrey/sql-template-tag. They will add placeholders for all the values and expose helper for query building via strings (e.g. a special join). At the same time they are typesafe.
- Objection to ORM Hatred
sqlc-gen-python
-
Python: Just Write SQL
If you want to try out something cool, check out
https://github.com/sqlc-dev/sqlc
It's written in Go and used to convert sql migrations and queries into a typesafe code that you use access your database.
It currently has a plugin for Python that's in Beta, but what essentially does something similar to what this post is saying.
https://github.com/sqlc-dev/sqlc-gen-python
You write your migrations, and queries and a config file and it does the rest.
What are some alternatives?
Dapper.SimpleCRUD - Who wants to write basic read/insert/update/delete statements? SimpleCRUD provides simple CRUD helpers for Dapper.
pugsql - A HugSQL-inspired database library for Python
yesql - A Clojure library for using SQL.
mini_sql - a minimal, fast, safe sql executor
vscode-sqltools - Database management for VSCode
squiller - Generate boilerplate from annotated SQL queries
jOOQ - jOOQ is the best way to write SQL in Java
Sequel - Sequel: The Database Toolkit for Ruby
TypeORM - ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.
sqlx - general purpose extensions to golang's database/sql
Atlas.Orm - A data mapper implementation for your persistence model in PHP.
sqlz - Simple struct/slice/chan mapper for SQL rows.