sql-template-tag
powderkeg
sql-template-tag | powderkeg | |
---|---|---|
3 | 1 | |
314 | 158 | |
- | 0.0% | |
6.3 | 10.0 | |
14 days ago | over 5 years ago | |
TypeScript | Clojure | |
MIT License | Eclipse Public License 1.0 |
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
powderkeg
-
Python: Just Write SQL
As a data engineer, the pattern the OP shares is very familiar. I find it much preferable to use of ORMs for wide variety of reasons. However, I view implementing with SQL as an antiquated problem rather than a pragmatic feature. The evolution of this pattern would be to integrate database querying into languages more directly and eliminate SQL entirely. While this could be achieved in Python, I find that a language like Clojure, via functional programming (FP) primitives and transducers, is a natural candidate, particularly for JVM implemented databases. Rather than encapsulating SQL via query building or ORM based APIs, an FP core could be integrated into database engines to allow, via transducers, complex native forms to be executed directly across database clusters. Apache Spark is an analog of this. In particular the Clojure project, powderkeg (https://github.com/HCADatalab/powderkeg) demonstrates the potential of utilizing transducers in a database cluster context.
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.
typed-sql
vscode-sqltools - Database management for VSCode
squiller - Generate boilerplate from annotated SQL queries
jOOQ - jOOQ is the best way to write SQL in Java
sqlz - Simple struct/slice/chan mapper for SQL rows.
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.
Atlas.Orm - A data mapper implementation for your persistence model in PHP.
mini_sql - a minimal, fast, safe sql executor