@dbsp/adapter-pgsql 3.3.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/index.d.ts +324 -85
- package/dist/index.js +3466 -1623
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -36,6 +36,8 @@ Compile SQL without a database connection — useful for CLI tooling, CI plan in
|
|
|
36
36
|
import { createOrm, eq } from '@dbsp/core';
|
|
37
37
|
import { createPgsqlCompileOnlyAdapter } from '@dbsp/adapter-pgsql';
|
|
38
38
|
|
|
39
|
+
// This is a connectionless PgsqlAdapter: dump() works; database operations
|
|
40
|
+
// refuse at runtime until you instead construct createPgsqlAdapter(pool).
|
|
39
41
|
const adapter = createPgsqlCompileOnlyAdapter();
|
|
40
42
|
const orm = createOrm({ schema: db, adapter });
|
|
41
43
|
const { sql, params } = orm.select('users').where(eq('active', true)).dump();
|
|
@@ -51,7 +53,7 @@ const { sql, params } = orm.select('users').where(eq('active', true)).dump();
|
|
|
51
53
|
- **Parameterized queries** — All user values use `$N` positional parameters; no SQL injection surface
|
|
52
54
|
- **Identifier quoting** — All table/column/schema names are double-quoted automatically
|
|
53
55
|
- **AST-based compiler** — SQL is built from the plan AST, never from string templates
|
|
54
|
-
- **DDL provisioning** — `compareSchemata()` + `generateDDL()` with 12-phase topological sort
|
|
56
|
+
- **DDL provisioning** — pure model-to-model `compareSchemata()` + `generateDDL()` with 12-phase topological sort; use live `comparePgsqlDatabaseSchema()` when provisioning from an introspected PostgreSQL database
|
|
55
57
|
- **Schema migrations** — `generateMigrationSQL()` with UP/DOWN sections and destructive-change safety gate
|
|
56
58
|
- **Schema introspection** — Reflect live database structure back into `ModelIR`
|
|
57
59
|
- **Row-Level Security** — `rlsEnabled` + `policies[]` on `TableIR`, compiled to `CREATE POLICY` DDL
|