Releases: ForbesLindesay/atdatabases
@databases/[email protected]
New Features
- Initial release (#206)
@databases/[email protected]
Breaking Changes
-
Update the default image for tests to
mysql:8.0.23
(#206)If you are using the
@databases/mysql-test
package to create temporary databases, you will now get version 8.0.23 by default. If you want to maintain the old behaviour, you need to specify:{ "test": { "image": "mysql:5.7.24" } }
in your mysql config.
New Features
@databases/[email protected]
New Features
- Export
pgFormat
(#202)
@databases/[email protected]
Breaking Changes
-
Block unexpected fields on
.insert(...)
calls (#203)This update uses conditional types in TypeScript to produce a type error if you add extra fields to objects you pass to
.insert(...)
that are not defined in the database schema.
New Features
@databases/[email protected]
New Features
-
Automatically handle connection limit exceeded errors (#201)
This automatically handles the error:
too many connections for role "role_name"
from Postgres, providing we were able to create at least 1 connection for the pool. It will attempt to create connections again 5 seconds after encountering this error.
@databases/[email protected]
New Features
-
Automatically handle connection limit exceeded errors (#201)
If you provide the
isConnectionLimitError
option, it is used to test any error returned byopenConnection
. 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 theconnectionLimitBackoffMilliseconds
option, which defaults to5_000
@databases/[email protected]
Bug Fixes
- Connections were not closed properly when an error occurred in a connection that was not currently in use. (#189)
@databases/[email protected]
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 }}" }
@databases/[email protected]
Bug Fixes
- Connections were not closed properly when an error occurred in a connection that was not currently in use. (#189)
@databases/[email protected]
New Features
- Add meaningful error when interpolations are quoted with
"
or backticks, not just'
(#183)