0.14.10 • Published 8 months ago
@freemework/sql.postgres v0.14.10
Freemework's PostgreSQL Facade
Version table
CREATE TABLE "__dbVersion" (
"version" VARCHAR(64) NOT NULL PRIMARY KEY,
"utc_deployed_at" TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT (now() AT TIME ZONE 'utc'),
"log" TEXT NOT NULL
)
NOTE: Name of table may be overridden via migration's opts
Connection URL
Format
postgres://[${user}[:${password}]]@${host}[:${port}]/${databaseName}[?app=${applicationName}&schema=${defaultSchema}]
postgres+ssl://[${user}[:${password}]]@${host}[:${port}]/${databaseName}[?app=${applicationName}&schema=${defaultSchema}]
TBD: Example URL for unix socket
Examples
Localhost
postgres://localhost:5432/postgres
Remote PostgreSQL server my_pg_host
with SSL prefer mode (no certificate validation, just for encryption)
postgres+ssl://my_pg_host:5432/postgres
Note: For full SSL mode you need to pass opts.ssl
programmatically. Passing certificates via URL does not supported.
Development Notes
- Make sure your have PostgreSQL instance or launch it as Docker container
docker run --name postgres --rm --interactive --publish 5432:5432 theanurin/devel.postgres-13
- Launch tests via VSCode's launch configuration or via command line
TEST_DB_URL="postgres://devadmin@localhost:5432/devdb" npm run test
- Look inside DB to see SQL objects generated by tests. For the purpose you may use VSCode's plugins provided by Matheus Teixeira: SQLTools and SQLTools PostgreSQL/Cockroach Driver
0.14.10
8 months ago
0.14.8
10 months ago
0.14.4
10 months ago
0.13.1
1 year ago
0.12.2
1 year ago
0.12.3
1 year ago
0.12.4
1 year ago
0.11.4
1 year ago
0.10.15
2 years ago
0.10.14
2 years ago
0.10.7
2 years ago
0.10.13
2 years ago
0.9.1
2 years ago
0.8.12
3 years ago
0.7.0
3 years ago
0.6.1
3 years ago
0.6.0
3 years ago
0.5.0
3 years ago
0.4.21
3 years ago
0.4.20
3 years ago
0.4.19
3 years ago
0.4.16
3 years ago
0.4.0
3 years ago