Skip to content

Instantly share code, notes, and snippets.

@mindplay-dk
Last active October 14, 2023 16:14
Show Gist options
  • Save mindplay-dk/befec30a2ad34acd59956862e123fa03 to your computer and use it in GitHub Desktop.
Save mindplay-dk/befec30a2ad34acd59956862e123fa03 to your computer and use it in GitHub Desktop.
TypeScript SQL libs

Type-safe TS SQL Libs

A list of query-builders and other SQL query and/or schema abstractions.

Libraries with no activity for 2+ years will be considered "dead", as these are not keeping up with the language or ecosystem - but they may be added and may remain on the list, if they contain different or interesting ideas.

Fluent

from(books).where(books.author.lower().like('%bob') and similar.

Literal

Literal SQL or primarily SQL fragments.

sql`SELECT * FROM books WHERE author LIKE '%bob%` and similar.

Hybrid

Fluent query-builders with SQL fragments.

from(books).where(`{books.author} LIKE '%bob%'`) and similar.

External

External tools to validate literal inline SQL.

ORM/AR

Uses (mutable) entities as opposed to plain objects/records, and ORM patterns such as Active Record (AR) or level 1 caching, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment