TypeScript clients for databases that prevent SQL Injection
MIT License
Bot releases are hidden (Show)
Published by ForbesLindesay almost 3 years ago
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
Published by ForbesLindesay about 3 years ago
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 }}"
}
Published by ForbesLindesay about 3 years ago
Published by ForbesLindesay about 3 years ago
Published by ForbesLindesay about 3 years ago
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.
Published by ForbesLindesay about 3 years ago
Disable eslint for generated files (#177)
The comment that we were adding was using the tslint format, which does not work for disabling eslint.
Published by ForbesLindesay about 3 years ago
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.
Published by ForbesLindesay about 3 years ago
Published by ForbesLindesay about 3 years ago
"
or backticks, not just '
(#183)Published by ForbesLindesay over 3 years ago
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 "$$
Published by ForbesLindesay over 3 years ago
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.
Published by ForbesLindesay over 3 years ago
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.
Published by ForbesLindesay over 3 years ago
Published by ForbesLindesay over 3 years ago
Published by ForbesLindesay over 3 years ago
Initial release (#160)
This is not yet tested, and should not by used in production yet.
Published by ForbesLindesay over 3 years ago
Initial release (#160)
This is not yet tested, and should not by used in production yet.
Published by ForbesLindesay over 3 years ago
Use @databases/sql/web
(#160)
This means @databases/split-sql-query
now works in browser environments as well as node.js
Published by ForbesLindesay over 3 years ago
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.
Published by ForbesLindesay over 3 years ago
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.
Published by ForbesLindesay over 3 years ago
package.json
to expose /web
export (#160)