atdatabases

TypeScript clients for databases that prevent SQL Injection

MIT License

Downloads
4.4M
Stars
588
Committers
23

Bot releases are hidden (Show)

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

Bug Fixes

  • Update pg-schema-introspect to add support for Postgres 12 (#106)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

New Features

  • 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.

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

Breaking Changes

  • 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.

Bug Fixes

  • 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)

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

Bug Fixes

  • Some import paths were broken after publishing (#103)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

Bug Fixes

  • Some import paths were broken after publishing (#103)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

Bug Fixes

  • Remove "private" in package.json so it is published to npm (#102)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

New Features

  • Initial release (#101)

    This CLI lets you generate a folder full of types for all your database tables in Postgres.

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

New Features

  • 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

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

Breaking Changes

  • @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.

Bug Fixes

  • 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.

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

Breaking Changes

  • Completely re-written (#96)

    This is an all new interactive CLI and also an all new TypeScript API.

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

Refactorings

  • Sort keys in enum (#101)

    This is part of making the codegen in pg-schema more stable.

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

New Features

  • 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)

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 4 years ago

New Features

  • Initial release (#96)
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 4 years ago

Bug Fixes

  • Handle digital ocean connection strings correctly (#83)

    • Digital Ocean postgres connection strings use postgresql: as the schema instead of postgres:
    • Digital Ocean postgres connection strings specify ?sslmode=require and the connections fail unless the ssl mode is enabled.
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 4 years ago

Breaking Changes

  • 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.

New Features

  • 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.

atdatabases - @databases/[email protected]

Published by ForbesLindesay over 4 years ago

Breaking Changes

  • 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.

New Features

  • 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.

atdatabases - @databases/[email protected]

Published by ForbesLindesay over 4 years ago

Breaking Changes

  • 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.

Bug Fixes

  • Debugging info is now written to stderr instead of stdout (#80)
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 4 years ago

Breaking Changes

  • "prettier" is now a "peerDependency" (#76)
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 4 years ago

Refactorings

  • 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.