0.13.1 • Published 4 months ago

@freemework/sql.postgres v0.13.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 months ago

Freemework's PostgreSQL Facade

npm version badge downloads badge commit activity badge last commit badge

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

  1. 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
  2. Launch tests via VSCode's launch configuration or via command line
    TEST_DB_URL="postgres://devadmin@localhost:5432/devdb" npm run test
  3. 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.13.1

4 months ago

0.12.2

4 months ago

0.12.3

4 months ago

0.12.4

4 months ago

0.11.4

4 months ago

0.10.15

5 months ago

0.10.14

6 months ago

0.10.7

9 months ago

0.10.13

6 months ago

0.9.1

1 year ago

0.8.12

1 year ago

0.7.0

1 year ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.21

2 years ago

0.4.20

2 years ago

0.4.19

2 years ago

0.4.16

2 years ago

0.4.0

2 years ago