ts-sqlx
Typescript SQLx compile-time checked queries without a DSL.
Getting started
install the ts-sqlx cli tool globally
in your project install the typescript definitions
npm install ts-sqlx -D
include the path to generated declaration files in your tsconfig.json
create a .env
file with DATABASE_URL
set to your database url
DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
or create a .ts-sqlx.json
file like
run in watch mode ts-sqlx watch
in the root of your project, just once with ts-sqlx run
or for help ts-sqlx help
see example for a "full" project example