TypeScript clients for databases that prevent SQL Injection
MIT License
Bot releases are visible (Hide)
Published by ForbesLindesay almost 4 years ago
postgresFormatter
code (#121)Published by ForbesLindesay almost 4 years ago
Update compile target to node 12.19.0 (#115)
Updated @databases/sql
to 3.0.0
(#114)
This means:
.compile()
or .compileMySQL()
methods.text
or .values
propertiesSQLQuery
is only a type, not a class.If you were previously using instanceof SQLQuery
to check if a value is an SQLQuery
, you can swap to using isSqlQuery
.
If you were relying on the properties or methods to get the actual query text, please open an issue.
Published by ForbesLindesay almost 4 years ago
Update compile target to node 12.19.0 (#115)
Updated @databases/sql
to 3.0.0
(#114)
This means:
.compile()
or .compileMySQL()
methods.text
or .values
propertiesSQLQuery
is only a type, not a class.If you were previously using instanceof SQLQuery
to check if a value is an SQLQuery
, you can swap to using isSqlQuery
.
If you were relying on the properties or methods to get the actual query text, please open an issue.
Published by ForbesLindesay almost 4 years ago
Published by ForbesLindesay almost 4 years ago
Published by ForbesLindesay almost 4 years ago
Upgrades @databases/pg
to version 3.0.0
(#118)
This impacts how connection strings are handled.
Update compile target to node 12.19.0 (#115)
@databases/sql
to 3.0.0
(#114)Published by ForbesLindesay almost 4 years ago
Update compile target to node 12.19.0 (#115)
Updated @databases/sql
to 3.0.0
(#114)
This means:
.compile()
or .compileMySQL()
methods.text
or .values
propertiesSQLQuery
is only a type, not a class.If you were previously using instanceof SQLQuery
to check if a value is an SQLQuery
, you can swap to using isSqlQuery
.
If you were relying on the properties or methods to get the actual query text, please open an issue.
Published by ForbesLindesay almost 4 years ago
The Connection
TypeScript type has been renamed to Queryable
(#118)
Upgrades @databases/pg
to version 3.0.0
(#118)
This impacts how connection strings are handled.
Update compile target to node 12.19.0 (#115)
Updated @databases/sql
to 3.0.0
(#114)
This means:
.compile()
or .compileMySQL()
methods.text
or .values
propertiesSQLQuery
is only a type, not a class.If you were previously using instanceof SQLQuery
to check if a value is an SQLQuery
, you can swap to using isSqlQuery
.
If you were relying on the properties or methods to get the actual query text, please open an issue.
Published by ForbesLindesay almost 4 years ago
Upgrades @databases/pg
to version 3.0.0
(#118)
This impacts how connection strings are handled, and may also result in other subtle breaking changes.
BIGINT
s are now returned as the builtin bigint
type in JavaScript/TypeScript (#118)
The Connection
TypeScript type has been renamed to Queryable
(#118)
Update compile target to node 12.19.0 (#115)
Updated @databases/sql
to 3.0.0
(#114)
This means:
.compile()
or .compileMySQL()
methods.text
or .values
propertiesSQLQuery
is only a type, not a class.If you were previously using instanceof SQLQuery
to check if a value is an SQLQuery
, you can swap to using isSqlQuery
.
If you were relying on the properties or methods to get the actual query text, please open an issue.
Published by ForbesLindesay almost 4 years ago
Published by ForbesLindesay almost 4 years ago
Renamed the following options (#118)
bigIntAsString
option has been replaced with the bigIntMode
option. It still defaults to 'number'
but a future major version may change the default to 'bigint'
. I recommend you set it explicitly to the value you want.application_name
option has been renamed to applicationName
fallback_application_name
option has been renamed to fallbackApplicationName
idleTimeoutMillis
option has been renamed to idleTimeoutMilliseconds
statement_timeout
option has been renamed to statementTimeoutMilliseconds
query_timeout
option has been renamed to queryTimeoutMilliseconds
error
callback has been renamed to onError
and no longer includes the client
Removed the following options (#118)
noLocking
option has been removed.noDuplicateDatabaseObjectsWarning
option has been removed (along with the associated warning)pgFormatting
option has been removed (we always use prepared statements now)pgNative
option has been removed (it was incompatible with some features, and if you need that kind of extreme performance, you may be better off without @databases
)promiseLib
option has been removed (we didn't always honour it, and everyone should be using the builtin promise implementation anyway)capSQL
option has been removed (we don't generate any SQL for you)noWarnings
option has been removed (we don't have many warnings)binary
option has been removed (many internal features of @databases would not function when this is enabled)client_encoding
option has been removed (the underlying parser assumes "utf8" no matter what you passed anyway)encoding
option has been removed (this is for the same reason as client_encoding)isDomainSocket
option has been removed (it is unclear if this ever worked. Open an issue if you need this.)parseInputDatesAsUTC
option has been removed (the underlying library does not suport specifying this on a per-connection basis)row
option has been removed (it never made sense to specify this here)Removed event handlers (previously passed via options) (#118)
connect
event has been removeddisconnect
event has been removedquery
event has been removedreceive
event has been removedtask
event has been removedtransact
event has been removedextend
event has been removederror
callback has been renamed to onError
and no longer includes the client
New options (#118)
connectionTimeoutMilliseconds
defaults to 10 secondsmaxUses
defaults to Infinity
, this is the maximum number of times a connection can be retrieved from the pool before being recycled.keepAliveInitialDelayMilliseconds
specifies the TCP keepalive interval (when enabled via the keepAlive
option)idleInTransactionSessionTimeoutMilliseconds
number of milliseconds before terminating any session with an open idle transaction, default is no timeouttypes
allows you to specify custom type parsers when creating a connection (See pg/src/TypeOverrides.ts for details)createConectionPool
now takes a single parameter containing all options (#118)
To pass both a connection string, and other options, you can use createConnectionPool({connectionString: '...', ...otherOptions})
This replaces the arbitrary split between connection details and "options"
Replace the old Connection
type with the new Queryable
(#118)
We now have 4 clear types:
Transaction
- a database transactionConnection
- a single connection to the databaseConnectionPool
- a pool of connections to the databaseQueryable
- an interface representing the common methods that are available to all 3 other types.The default sslmode
is now "prefer" (#118)
Previously, the default was to always attempt to connect without ssl, and fail if the server required SSL. This resulted in errors that were difficult to debug in many environments. The new default is "prefer", which always attempts to connect with SSL, and then disables SSL if the connection fails.
Update compile target to node 12.19.0 (#115)
Updated @databases/sql
to 3.0.0
(#114)
This means:
.compile()
or .compileMySQL()
methods.text
or .values
propertiesSQLQuery
is only a type, not a class.If you were previously using instanceof SQLQuery
to check if a value is an SQLQuery
, you can swap to using isSqlQuery
.
If you were relying on the properties or methods to get the actual query text, please open an issue.
Published by ForbesLindesay almost 4 years ago
Published by ForbesLindesay almost 4 years ago
Published by ForbesLindesay almost 4 years ago
Published by ForbesLindesay almost 4 years ago
Initial release (#117)
This library parses connection strings & environment variables for Postgres according to the rules in:
Published by ForbesLindesay almost 4 years ago
Published by ForbesLindesay almost 4 years ago
Published by ForbesLindesay almost 4 years ago
Published by ForbesLindesay almost 4 years ago
Update compile target to node 12.19.0 (#115)
Updated @databases/sql
to 3.0.0
(#114)
This means:
.compile()
or .compileMySQL()
methods.text
or .values
propertiesSQLQuery
is only a type, not a class.If you were previously using instanceof SQLQuery
to check if a value is an SQLQuery
, you can swap to using isSqlQuery
.
If you were relying on the properties or methods to get the actual query text, please open an issue.
Published by ForbesLindesay almost 4 years ago