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 almost 3 years ago

New Features

  • Automatically handle connection limit exceeded errors (#201)

    If you provide the isConnectionLimitError option, it is used to test any error returned by openConnection. If the error is a connection limit error, we reduce the max size of the connection pool temporarily. You can control how long the connection pool size is reduced for using the connectionLimitBackoffMilliseconds option, which defaults to 5_000

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 3 years ago

New Features

  • Add "replace" filter as a config option (#191)

    The replace filter accepts two JSON strings as parameters. The first is a regular expression to match in the table name, and the second is a string to use as the replacement. You can also use $1, $2 etc. to reference captured groups from the regular expression.

    For example, if all your table names were prefixed with my_, and you wanted to remove that prefix, you could do something like:

    {
      "tableTypeName": "{{ TABLE_NAME | replace \"^my_\" \"\" | singular | pascal-case }}"
    }
    
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 3 years ago

Bug Fixes

  • Connections were not closed properly when an error occurred in a connection that was not currently in use. (#189)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 3 years ago

Bug Fixes

  • Connections were not closed properly when an error occurred in a connection that was not currently in use. (#189)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 3 years ago

Bug Fixes

  • Give meaningful errors, even in production (#182)

    We were using tiny-invariant which hides errors in production. This made production issues very hard to diagnose and fix.

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 3 years ago

Bug Fixes

  • Disable eslint for generated files (#177)

    The comment that we were adding was using the tslint format, which does not work for disabling eslint.

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 3 years ago

Bug Fixes

  • Give meaningful errors, even in production (#182)

    We were using tiny-invariant which hides errors in production. This made production issues very hard to diagnose and fix.

atdatabases - @databases/[email protected]

Published by ForbesLindesay about 3 years ago

New Features

  • Initial code (#183)
atdatabases - @databases/[email protected]

Published by ForbesLindesay about 3 years ago

New Features

  • Add meaningful error when interpolations are quoted with " or backticks, not just ' (#183)
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 3 years ago

Bug Fixes

  • Do not split dollar quoted strings into separate statements (#175)

    Postgres allows strings to be quoted using $$ as an alternative to '. This is commonly used to declare functions/procedures that require you to put SQL code inside a string. We were previously still interpreting ;s inside those strings as boundaries between statements. This could result in an error that looked like:

    unterminated dollar-quoted string at or near "$$
    
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 3 years ago

New Features

  • Add a .count(whereValues) API to tables (#158)

    Previously you either had to use unsafe queries, or load all the records, which was very wasteful.

atdatabases - @databases/[email protected]

Published by ForbesLindesay over 3 years ago

Breaking Changes

  • Transactions are committed after each migration (#157)

    This fixes issues on some older database engines where it is not possible to modify data and modify the schema in one transaction. This made it difficult to clean up broken data and then add constraints to prevent future issues. With this update, it is now possible to add 2 migrations, one to cleanup the data and a second to add the db constraint. Both migrations will be run sequentially, and the transaction committed after each.

atdatabases - @databases/[email protected]

Published by ForbesLindesay over 3 years ago

Breaking Changes

  • Uses enums for type modes (#160)

Refactors

  • Uses funtypes instead of typescript-json-validator/ajv (#160)
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 3 years ago

Refactors

  • Uses funtypes instead of typescript-json-validator/ajv (#160)
atdatabases - @databases/[email protected]

Published by ForbesLindesay over 3 years ago

Breaking Changes

  • Initial release (#160)

    This is not yet tested, and should not by used in production yet.

atdatabases - @databases/[email protected]

Published by ForbesLindesay over 3 years ago

Breaking Changes

  • Initial release (#160)

    This is not yet tested, and should not by used in production yet.

atdatabases - @databases/[email protected]

Published by ForbesLindesay over 3 years ago

Bug Fixes

  • Use @databases/sql/web (#160)

    This means @databases/split-sql-query now works in browser environments as well as node.js

atdatabases - @databases/[email protected]

Published by ForbesLindesay over 3 years ago

Breaking Changes

  • Transactions are committed after each migration (#157)

    This fixes issues on some older database engines where it is not possible to modify data and modify the schema in one transaction. This made it difficult to clean up broken data and then add constraints to prevent future issues. With this update, it is now possible to add 2 migrations, one to cleanup the data and a second to add the db constraint. Both migrations will be run sequentially, and the transaction committed after each.

atdatabases - @databases/[email protected]

Published by ForbesLindesay over 3 years ago

Refactors

  • Renamed getLock to createLock (#158)

    There is an alias for the old name, so this is not a breaking change.

  • Renamed getLocksByKey to createLocksByKey (#158)

    There is an alias for the old name, so this is not a breaking change.

atdatabases - @databases/[email protected]

Published by ForbesLindesay over 3 years ago

Refactors

  • Uses addtional package.json to expose /web export (#160)