TypeScript clients for databases that prevent SQL Injection
MIT License
Bot releases are visible (Hide)
Published by ForbesLindesay about 4 years ago
Published by ForbesLindesay about 4 years ago
Show database comments & default values for tables and columns (#106)
Added "singular" and "plural" as filters for type names (#104)
For example, if your table names are plural, and you prefer the interfaces to have singular names, you can add something like this to your package.json:
"pg": {
"types": {
"tableTypeName": "{{ TABLE_NAME | singular | pascal-case }}"
}
},
These filters can be used on all templated identifier names and file names.
Published by ForbesLindesay about 4 years ago
Constraint.checkConstraint
was renamed to Constraint.constraintDescription
(#106)
It now contains a description for all constraints, not just check constraints. It should match the syntax used to create constraints.
Replaced def.adsrc
with pg_get_expr(def.adbin, def.adrelid)
(required for Postgres 12) (#106)
Replaced c.consrc
with pg_get_constraintdef(c.oid)
(required for Postgres 12) (#106)
Published by ForbesLindesay about 4 years ago
Published by ForbesLindesay about 4 years ago
Published by ForbesLindesay about 4 years ago
Published by ForbesLindesay about 4 years ago
Initial release (#101)
This CLI lets you generate a folder full of types for all your database tables in Postgres.
Published by ForbesLindesay about 4 years ago
Initial release (#101)
Once you have a schema from @databases/pg-schema-introspect you can pass it to this library to write out TypeScript definitions for all your database tables
Published by ForbesLindesay about 4 years ago
@databases/pg-schema has been renamed to @databases/pg-schema-introspect (#101)
It now finally has a public API that can be called to retrieve a JSON representation of a Postgres database schema that is rich in detail. This is designed to work with the various other @databases/pg-* packages. A future package under the @databases/pg-schema name will provide type safe access to Postgres databases using these generated schemas.
Table names and field names are now always alphabetically sorted (#101)
This was the only way to make the output from introspect stable enough to be useful.
Published by ForbesLindesay about 4 years ago
Completely re-written (#96)
This is an all new interactive CLI and also an all new TypeScript API.
Published by ForbesLindesay about 4 years ago
Sort keys in enum (#101)
This is part of making the codegen in pg-schema more stable.
Published by ForbesLindesay about 4 years ago
Added fields for configuring pg-schema-print-types (#101)
Added migrationsDirectory
field for configuring pg-migrations (#101)
Exposed readPgConfigSync
as public API to allow reading specific config files (#101)
Published by ForbesLindesay about 4 years ago
Published by ForbesLindesay over 4 years ago
Handle digital ocean connection strings correctly (#83)
postgresql:
as the schema instead of postgres:
?sslmode=require
and the connections fail unless the ssl mode is enabled.Published by ForbesLindesay over 4 years ago
No longer exports run
method (#71)
Internally, it was refactored to use modern-spawn
Requires more recent version of @types/node
(#71)
This will only impact you if you are using TypeScript.
Add CLI for creating postgres databases (#81)
You can now specify the migrationsScript
as a string (#72)
If you were previously doing:
{
"pg": {
"migrations": ["yarn", "run", "migrations"]
}
}
you can now do:
{
"pg": {
"migrations": "yarn run migrations"
}
}
You can continue specifying them as an array if you prefer.
Published by ForbesLindesay over 4 years ago
No longer exports run
method (#71)
Internally, it was refactored to use modern-spawn
Requires more recent version of @types/node
(#71)
This will only impact you if you are using TypeScript.
Adds a mysql-test CLI (#80)
This lets you run arbitrary commands with a temporary mysql database attached.
You can now specify the migrationsScript
as a string (#72)
If you were previously doing:
{
"mysql": {
"migrations": ["yarn", "run", "migrations"]
}
}
you can now do:
{
"mysql": {
"migrations": "yarn run migrations"
}
}
You can continue specifying them as an array if you prefer.
Published by ForbesLindesay over 4 years ago
No longer exports run
method (#71)
Internally, it was refactored to use modern-spawn
Requires more recent version of @types/node
(#71)
This will only impact you if you are using TypeScript.
Published by ForbesLindesay over 4 years ago
Published by ForbesLindesay over 4 years ago
Replace default pg image of "circleci/postgres:10.6-alpine-ram" with "postgres:10.6-alpine" (#79)
This image seems more stable, will be compatible with persistent volumes, and is not noticeably slower.