@owlmeans/postgres-resource 0.1.18-rc.10 → 0.1.18-rc.12
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 +25 -10
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/postgres-resource/SKILL.md +48 -11
- package/build/consts.d.ts +9 -2
- package/build/consts.d.ts.map +1 -1
- package/build/consts.js +8 -1
- package/build/consts.js.map +1 -1
- package/build/declarations.d.ts.map +1 -1
- package/build/declarations.js +5 -5
- package/build/errors.d.ts.map +1 -1
- package/build/errors.js.map +1 -1
- package/build/helper.d.ts.map +1 -1
- package/build/resource.d.ts +2 -2
- package/build/resource.d.ts.map +1 -1
- package/build/resource.js +95 -108
- package/build/resource.js.map +1 -1
- package/build/types.d.ts +27 -19
- package/build/types.d.ts.map +1 -1
- package/build/utils/criteria.d.ts +10 -6
- package/build/utils/criteria.d.ts.map +1 -1
- package/build/utils/criteria.js +13 -5
- package/build/utils/criteria.js.map +1 -1
- package/build/utils/diff.d.ts.map +1 -1
- package/build/utils/diff.js.map +1 -1
- package/build/utils/introspect.d.ts.map +1 -1
- package/build/utils/life-cycle.d.ts.map +1 -1
- package/build/utils/marshal.d.ts.map +1 -1
- package/build/utils/marshal.js.map +1 -1
- package/build/utils/migrations.d.ts +2 -2
- package/build/utils/migrations.d.ts.map +1 -1
- package/build/utils/migrations.js +2 -2
- package/build/utils/name.d.ts +3 -3
- package/build/utils/name.d.ts.map +1 -1
- package/build/utils/name.js +3 -3
- package/build/utils/name.js.map +1 -1
- package/build/utils/schema.d.ts.map +1 -1
- package/build/utils/schema.js.map +1 -1
- package/build/utils/sql.d.ts +10 -2
- package/build/utils/sql.d.ts.map +1 -1
- package/build/utils/sql.js.map +1 -1
- package/build/utils/sync.d.ts.map +1 -1
- package/build/utils/table.d.ts +4 -0
- package/build/utils/table.d.ts.map +1 -1
- package/build/utils/table.js +4 -0
- package/build/utils/table.js.map +1 -1
- package/package.json +6 -6
- package/src/consts.ts +8 -1
- package/src/declarations.ts +5 -5
- package/src/resource.ts +118 -135
- package/src/types.ts +29 -18
- package/src/utils/criteria.ts +25 -17
- package/src/utils/migrations.ts +2 -2
- package/src/utils/name.ts +3 -3
- package/src/utils/sql.ts +0 -0
- package/src/utils/table.ts +5 -1
- package/tests/criteria.spec.ts +187 -0
- package/tests/name.spec.ts +3 -3
- package/tests/sql.spec.ts +4 -3
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ code-registered migrations, and custom SQL with resource-alias placeholders.
|
|
|
5
5
|
|
|
6
6
|
## Overview
|
|
7
7
|
|
|
8
|
-
- `makePostgresResource<R, T>(alias, dbAlias?, serviceAlias?,
|
|
8
|
+
- `makePostgresResource<R, T>(alias, dbAlias?, serviceAlias?, tableName?)` — factory for Postgres resources
|
|
9
9
|
- `PostgresResource<T>` — extends `Resource<T>` with a Drizzle table, custom SQL, transactions, and field encryption
|
|
10
10
|
- The resource's **AJV schema is the single source of truth for the table structure** — columns, types,
|
|
11
11
|
nullability, defaults, primary key and indexes are all derived from it
|
|
@@ -35,7 +35,7 @@ export interface ProjectResource extends PostgresResource<ProjectRecord> {}
|
|
|
35
35
|
|
|
36
36
|
export const makeProjectResource: ResourceMaker<ProjectRecord, ProjectResource> = (dbAlias, serviceAlias) => {
|
|
37
37
|
const resource = makePostgresResource<ProjectRecord, ProjectResource>(
|
|
38
|
-
RES_PROJECT, dbAlias, serviceAlias
|
|
38
|
+
RES_PROJECT, dbAlias, serviceAlias
|
|
39
39
|
)
|
|
40
40
|
resource.schema = ProjectSchema
|
|
41
41
|
resource.index('idx_project_entity', { columns: ['entityId'] })
|
|
@@ -55,9 +55,17 @@ Use in a handler:
|
|
|
55
55
|
```typescript
|
|
56
56
|
const projects = context.resource<ProjectResource>(RES_PROJECT)
|
|
57
57
|
const record = await projects.create({ entityId, alias, title })
|
|
58
|
-
|
|
58
|
+
|
|
59
|
+
const one = await projects.load({ entityId, alias }) // null when absent
|
|
60
|
+
const { items, total } = await projects.list(
|
|
61
|
+
{ entityId, status: ['draft', 'active'] }, // an array means "any of these"
|
|
62
|
+
{ page: 0, size: 20, sort: [{ field: 'createdAt', order: 'desc' }] }
|
|
63
|
+
)
|
|
59
64
|
```
|
|
60
65
|
|
|
66
|
+
`size` defaults to `DEFAULT_PAGE_SIZE` (100); `list(where, { size: 0 })` lifts the limit. `total`
|
|
67
|
+
always describes the whole match, independently of the page.
|
|
68
|
+
|
|
61
69
|
### Schema → table
|
|
62
70
|
|
|
63
71
|
```typescript
|
|
@@ -150,7 +158,7 @@ substituted blindly.
|
|
|
150
158
|
|
|
151
159
|
## API
|
|
152
160
|
|
|
153
|
-
### `makePostgresResource<R, T>(alias, dbAlias?, serviceAlias?,
|
|
161
|
+
### `makePostgresResource<R, T>(alias, dbAlias?, serviceAlias?, tableName?): T`
|
|
154
162
|
|
|
155
163
|
Creates a Postgres resource. `dbAlias` and `serviceAlias` default to `DEFAULT_DB_ALIAS`
|
|
156
164
|
(`'postgres'`). `tableName` overrides the physical table name, which otherwise derives from the alias.
|
|
@@ -162,21 +170,28 @@ Extends `Resource<T>` with:
|
|
|
162
170
|
- `schema?: AnySchema` — the source of truth for the table structure
|
|
163
171
|
- `table: TableSpec` / `entity: PgRuntimeTable` — the compiled spec and the runtime Drizzle table
|
|
164
172
|
- `db(): Promise<PostgresDb>` / `client(): Promise<Pool>`
|
|
165
|
-
- `index(name, spec)
|
|
173
|
+
- `index(name, spec)` / `migration(name, apply, stage?)` — chainable declarations
|
|
166
174
|
- `query` / `queryOne` / `execute` — raw rows and affected counts
|
|
167
175
|
- `select` / `selectOne` — rows marshalled back into `T`
|
|
168
176
|
- `ref(alias?): string` — fully qualified identifier of this or another resource
|
|
169
177
|
- `transaction(fn)` — a `PostgresTx` with the same placeholder-aware helpers
|
|
170
|
-
- `insert` / `upsert` / `patch`
|
|
178
|
+
- `insert` / `upsert` / `patch` — beyond the base contract
|
|
171
179
|
- `lock(record, fields?)` / `unlock(record, fields?)` — encrypt/decrypt `secure` fields
|
|
172
180
|
- `getDefaults(): Partial<T>`
|
|
173
181
|
|
|
182
|
+
Type the resource once, where it is resolved — `context.resource<PostgresResource<Project>>(alias)` —
|
|
183
|
+
rather than passing a record type per method call.
|
|
184
|
+
|
|
174
185
|
### `Resource<T>` methods (all implemented)
|
|
175
186
|
|
|
176
|
-
`get`, `load`, `create`, `update`, `save`, `delete`, `
|
|
187
|
+
`get`, `load`, `list`, `count`, `create`, `update`, `save`, `delete`, `take`, `purge`
|
|
177
188
|
|
|
178
|
-
`
|
|
179
|
-
|
|
189
|
+
`get` and `load` take either an id or a `Criteria<T>` (with an optional `sort`), so reading one
|
|
190
|
+
record by several fields is a single call. `create` refuses a caller-supplied id (use `insert`);
|
|
191
|
+
`update` replaces the whole record (use `patch` to merge); `take` deletes the record it returns,
|
|
192
|
+
atomically, and raises when there is nothing to take where `delete` answers `null`; `purge` refuses
|
|
193
|
+
an empty criteria rather than emptying the table. Every write option is rejected here except
|
|
194
|
+
absence: `ttl` raises `UnsupportedArgumentError`, since Postgres has no row expiry.
|
|
180
195
|
|
|
181
196
|
### Errors
|
|
182
197
|
|
|
@@ -190,7 +205,7 @@ surface as `RecordExists` and not-null violations as `MisshapedRecord`.
|
|
|
190
205
|
### Constants
|
|
191
206
|
|
|
192
207
|
- `DEFAULT_DB_ALIAS` — `'postgres'`
|
|
193
|
-
- `DEFAULT_PAGE_SIZE` — `
|
|
208
|
+
- `DEFAULT_PAGE_SIZE` — `100`, the cap `list()` applies when no `size` is named
|
|
194
209
|
- `DEF_MIGRATIONS_TABLE` — `'_owlmeans_migrations'`
|
|
195
210
|
- `PG_KEYWORD` — `'pg'`; `PG_MAX_IDENTIFIER` — `63`
|
|
196
211
|
- `PgAutoSync`, `PgIndexMethod`, `PgReferentialAction`, `PgErrorCode`
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/postgres-resource",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.12",
|
|
5
|
+
"generatedAt": "2026-09-01T17:39:40.764Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/postgres-resource
|
|
9
9
|
|
|
10
10
|
**Layer:** Infra
|
|
11
|
-
**Install:** `"@owlmeans/postgres-resource": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/postgres-resource": "^0.1.18-rc.12"` in `dependencies` (peers `pg`, `ajv`)
|
|
12
12
|
|
|
13
13
|
The Postgres counterpart of [[mongo-resource]]. The difference that governs everything else: a
|
|
14
14
|
Mongo collection has no structure, a Postgres table does — so **the resource layer owns the DDL**
|
|
@@ -18,15 +18,15 @@ and derives it from the resource's AJV schema.
|
|
|
18
18
|
|
|
19
19
|
| Export | Description |
|
|
20
20
|
|--------|-------------|
|
|
21
|
-
| `makePostgresResource<R, T>(alias, dbAlias?, serviceAlias?,
|
|
22
|
-
| `PostgresResource<T>` | `Resource<T>` + `table`/`entity`, custom SQL, transactions, `insert`/`upsert`/`patch
|
|
21
|
+
| `makePostgresResource<R, T>(alias, dbAlias?, serviceAlias?, tableName?)` | The resource factory. Aliases default to `DEFAULT_DB_ALIAS` (`'postgres'`); `tableName` overrides the physical table (else the sanitized alias). |
|
|
22
|
+
| `PostgresResource<T>` | `Resource<T>` + `table`/`entity`, custom SQL, transactions, `insert`/`upsert`/`patch`, `lock`/`unlock`. |
|
|
23
23
|
| `PostgresDbService`, `PostgresDb`, `PostgresTx` | Service contract implemented by `@owlmeans/postgres`; the db handle `{ drizzle, pool, schema, database }`; the transaction façade. |
|
|
24
24
|
| `TableSpec`, `ColumnSpec`, `PgPropertyOverride`, `PgRootOverride`, `DdlPlan` | The compiled table description and the `pg:` vocabulary types. |
|
|
25
25
|
| `pgKeyword` | `{ keyword: 'pg', valid: true }` — register it when running AJV in strict mode. |
|
|
26
26
|
| `schemaToTableSpec`, `pgTableName`, `pgIdentifier`, `quoteIdent`, `qualify`, `advisoryKey` | The compiler and identifier helpers. |
|
|
27
27
|
| `refOf`, `resolvePlaceholders` | `{{alias}}` resolution — identifiers only. |
|
|
28
28
|
| `PostgresError` family, `pgErrorToResourceError`, `describePgError` | Driver-error translation. |
|
|
29
|
-
| `getDeclaration`, `resetDeclarations` | Module-scope index/migration declarations, keyed by alias. |
|
|
29
|
+
| `getDeclaration`, `resetDeclarations` | Module-scope schema/index/migration declarations, keyed by alias. |
|
|
30
30
|
| `DEFAULT_DB_ALIAS`, `DEFAULT_PAGE_SIZE`, `DEF_MIGRATIONS_TABLE`, `PgAutoSync`, `PgIndexMethod`, `PgReferentialAction`, `PgErrorCode` | Constants. |
|
|
31
31
|
|
|
32
32
|
## The schema is the table — never write DDL
|
|
@@ -34,7 +34,7 @@ and derives it from the resource's AJV schema.
|
|
|
34
34
|
```typescript
|
|
35
35
|
export const makeProjectResource: ResourceMaker<ProjectRecord, ProjectResource> = (dbAlias, serviceAlias) => {
|
|
36
36
|
const resource = makePostgresResource<ProjectRecord, ProjectResource>(
|
|
37
|
-
RES_PROJECT, dbAlias, serviceAlias
|
|
37
|
+
RES_PROJECT, dbAlias, serviceAlias
|
|
38
38
|
)
|
|
39
39
|
resource.schema = ProjectSchema
|
|
40
40
|
resource.index('idx_project_entity', { columns: ['entityId'] })
|
|
@@ -48,6 +48,11 @@ Never call `pgTable`/`pgSchema`, never call `drizzle()`, never run `drizzle-kit`
|
|
|
48
48
|
`CREATE TABLE`. Two owners of the same DDL is the failure mode this package exists to remove:
|
|
49
49
|
reconciliation would drop what the other owner added.
|
|
50
50
|
|
|
51
|
+
`schema`, `index()` and `migration()` all land in the module-scope declaration for the alias rather
|
|
52
|
+
than on the resource object, so a maker that runs more than once for the same alias — a custom
|
|
53
|
+
maker wrapping the built-in one, a spec calling it again — reads and extends the same declaration
|
|
54
|
+
instead of starting a fresh, emptier one.
|
|
55
|
+
|
|
51
56
|
| JSON Schema | Postgres |
|
|
52
57
|
|---|---|
|
|
53
58
|
| `string` · `string`+`format:'uuid'` | `text` · `uuid` |
|
|
@@ -168,13 +173,45 @@ middleware `appendPostgres` installs — use that rather than reordering registr
|
|
|
168
173
|
|
|
169
174
|
| Method | Semantics |
|
|
170
175
|
|---|---|
|
|
171
|
-
| `create` | refuses a caller-supplied id (`RecordExists`) — use `insert` |
|
|
176
|
+
| `create` | refuses a caller-supplied id (`RecordExists`) — use `insert`; rejects `opts.ttl` with `UnsupportedArgumentError` (mongo parity) |
|
|
172
177
|
| `update` | **replaces** the whole record — use `patch` to merge |
|
|
173
|
-
| `
|
|
174
|
-
| `
|
|
178
|
+
| `load(where, { sort })` / `get(where, { sort })` | one `SELECT … ORDER BY … LIMIT 1`, so "the newest matching row" is one statement rather than a list whose head is taken |
|
|
179
|
+
| `delete` / `take` | one `DELETE … RETURNING`: the row is handed back by the statement that removed it. `take` **deletes** and throws `UnknownRecordError` on a miss |
|
|
180
|
+
| `purge` | `DELETE … RETURNING` over the criteria; refuses an empty criteria object (`UnsupportedArgumentError('purge:no-criteria')`) rather than truncating the table |
|
|
181
|
+
| `count` | `count(*)` over the criteria, no rows carried back |
|
|
175
182
|
| `upsert` | `INSERT … ON CONFLICT DO UPDATE`, conflicting on the primary key by default |
|
|
176
183
|
| `select`/`selectOne` | custom SQL marshalled back into `T`; `query`/`queryOne` return raw rows |
|
|
177
184
|
|
|
185
|
+
## Paging
|
|
186
|
+
|
|
187
|
+
Postgres is **PAGED**: `DEFAULT_PAGE_SIZE` is `100`, so `list(where)` with no `size` returns the
|
|
188
|
+
first 100 rows — a table is unbounded, and an unpaged read is a production incident waiting for the
|
|
189
|
+
row count to grow. `total` is counted separately, so it describes the whole match rather than the
|
|
190
|
+
window, and `list(where, { size: 0 })` lifts the limit: the explicit, greppable way to read a whole
|
|
191
|
+
table.
|
|
192
|
+
|
|
193
|
+
`sort` becomes the `ORDER BY`, a bare field name ascending, and **the primary key is always
|
|
194
|
+
appended as a tiebreak**. Postgres has no implicit row order, so paginating on a non-unique sort
|
|
195
|
+
key silently duplicates and skips rows between pages — a difference from mongo that would surface
|
|
196
|
+
as a data bug rather than an error.
|
|
197
|
+
|
|
198
|
+
## Criteria against a table
|
|
199
|
+
|
|
200
|
+
`criteriaToSql` answers the shared vocabulary ([[resource]]) in SQL, so one criteria object selects
|
|
201
|
+
the same rows here as it does against a collection or in memory. What is specific to a table:
|
|
202
|
+
|
|
203
|
+
- **A key naming no column raises `UnsupportedArgumentError`.** A typo that silently widened a
|
|
204
|
+
query to the whole table is worth being loud about — the schemaless stores cannot detect one.
|
|
205
|
+
- **A dotted key reaches into a jsonb column** (`#>>`), and a criteria object against a jsonb
|
|
206
|
+
column becomes containment (`@>`). A dotted key over a non-jsonb column is refused, and `sort`
|
|
207
|
+
refuses dotted paths outright: ORDER BY names a column the caller actually declared.
|
|
208
|
+
- `$contains`/`$contained`/`$overlaps` are the array operators `@>`, `<@` and `&&`;
|
|
209
|
+
`$like`/`$ilike` are `LIKE`/`ILIKE`; `$exists: true` and `$null: false` are `IS NOT NULL`, their
|
|
210
|
+
negations `IS NULL`.
|
|
211
|
+
- **`{ $in: [null, …] }` is widened explicitly.** SQL `IN` never matches NULL, so a null in the
|
|
212
|
+
list would silently disappear; the condition becomes `IN (…) OR IS NULL` (and the `$nin` form
|
|
213
|
+
`NOT IN (…) AND IS NOT NULL`), which is what the other stores answer.
|
|
214
|
+
|
|
178
215
|
## Errors
|
|
179
216
|
|
|
180
217
|
Drizzle raises `DrizzleQueryError` and hangs the `pg` error off `cause`, so the driver `code` is not
|
|
@@ -185,9 +222,9 @@ translation — consumers classify retryable DDL races on `42P01`/`42703`.
|
|
|
185
222
|
|
|
186
223
|
## Config
|
|
187
224
|
|
|
188
|
-
`DbConfig.schema` is the Postgres **SCHEMA** (
|
|
189
|
-
from `meta.database
|
|
190
|
-
|
|
225
|
+
`DbConfig.schema` is the Postgres **SCHEMA** (`dbName()` returns it as given); the **DATABASE** comes
|
|
226
|
+
from `meta.database`. Values starting with `/` are read as files by the existing
|
|
227
|
+
`fileConfigReader` middleware.
|
|
191
228
|
|
|
192
229
|
## Tests
|
|
193
230
|
|
package/build/consts.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
export declare const DEFAULT_DB_ALIAS = "postgres";
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Rows `list()` returns when the caller names no `size`.
|
|
4
|
+
*
|
|
5
|
+
* A relational table is unbounded, so an unpaged read is a production incident waiting for
|
|
6
|
+
* the row count to grow. Asking for everything stays possible — and greppable — as
|
|
7
|
+
* `list(where, { size: 0 })`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_PAGE_SIZE = 100;
|
|
3
10
|
/**
|
|
4
11
|
* Table that records which code-registered migrations have already been applied.
|
|
5
12
|
* Lives in the same Postgres schema as the resources it tracks, so dropping the
|
|
@@ -71,7 +78,7 @@ export declare enum PgErrorCode {
|
|
|
71
78
|
* Postgres reports scalar values of these types as strings to avoid precision loss.
|
|
72
79
|
* The marshaller converts them back using the resource's schema.
|
|
73
80
|
*/
|
|
74
|
-
export declare const STRING_RETURNING_TYPES: readonly [
|
|
81
|
+
export declare const STRING_RETURNING_TYPES: readonly ["numeric", "bigint", "int8", "decimal", "money"];
|
|
75
82
|
/** Built-in type OIDs the marshaller has to name to reach the driver's own parsers. */
|
|
76
83
|
export declare enum PgTypeOid {
|
|
77
84
|
Date = 1082,
|
package/build/consts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,gBAAgB,aAAa,CAAA;AAE1C,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"consts.d.ts","source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AAO,MAAM,sBAAsB,4DAA6D,CAAA;AAEhG,uFAAuF;AACvF,oBAAY,SAAS;IACnB,IAAI,OAAO;IACX,SAAS,OAAO;IAChB,WAAW,OAAO;CACnB"}
|
package/build/consts.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
export const DEFAULT_DB_ALIAS = 'postgres';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Rows `list()` returns when the caller names no `size`.
|
|
4
|
+
*
|
|
5
|
+
* A relational table is unbounded, so an unpaged read is a production incident waiting for
|
|
6
|
+
* the row count to grow. Asking for everything stays possible — and greppable — as
|
|
7
|
+
* `list(where, { size: 0 })`.
|
|
8
|
+
*/
|
|
9
|
+
export const DEFAULT_PAGE_SIZE = 100;
|
|
3
10
|
/**
|
|
4
11
|
* Table that records which code-registered migrations have already been applied.
|
|
5
12
|
* Lives in the same Postgres schema as the resources it tracks, so dropping the
|
package/build/consts.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAA;AAE1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,
|
|
1
|
+
{"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAA;AAE1C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAA;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAA;AAE1D,oEAAoE;AACpE,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAA;AAE9B,8FAA8F;AAC9F,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAA;AAEnC,qFAAqF;AACrF,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAA;AAE5B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C,MAAM,sBAAsB,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,CAAU,CAAA;AAEhG,uFAAuF;AACvF,MAAM,CAAN,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,4CAAW,CAAA;IACX,sDAAgB,CAAA;IAChB,0DAAkB,CAAA;AACpB,CAAC,EAJW,SAAS,KAAT,SAAS,QAIpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"declarations.d.ts","sourceRoot":"","sources":["../src/declarations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEzD,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAA;CAC1C;AAaD,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"declarations.d.ts","sourceRoot":"","sources":["../src/declarations.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAEzD,MAAM,WAAW,mBAAmB;IAClC,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB,OAAO,EAAE,WAAW,EAAE,CAAA;IACtB,UAAU,EAAE,iBAAiB,CAAC,UAAU,CAAC,CAAA;CAC1C;AAaD,eAAO,MAAM,cAAc,GAAI,OAAO,MAAM,KAAG,mBAQ9C,CAAA;AAED,8FAA8F;AAC9F,eAAO,MAAM,iBAAiB,GAAI,QAAQ,MAAM,KAAG,IAMlD,CAAA"}
|
package/build/declarations.js
CHANGED
|
@@ -2,11 +2,11 @@ import { createMigrationRegistry } from '@owlmeans/resource';
|
|
|
2
2
|
/**
|
|
3
3
|
* Per-alias declaration store, held at module scope rather than on the resource object.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* by
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* A maker may run more than once for the same alias — a custom maker wrapping the built-in
|
|
6
|
+
* one, a maker called again by an app or a spec. Keying the declarations by alias makes that
|
|
7
|
+
* a no-op: every run reads and extends the same schema, indexes and migrations, so nothing a
|
|
8
|
+
* caller chained onto an earlier resource object is lost. Losing a migration is silent — the
|
|
9
|
+
* data transformation simply never runs — which is why the store cannot live on the object.
|
|
10
10
|
*/
|
|
11
11
|
const declarations = new Map();
|
|
12
12
|
export const getDeclaration = (alias) => {
|
package/build/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAC0B,aAAa,EAC7C,MAAM,oBAAoB,CAAA;AAI3B,qBAAa,aAAc,SAAQ,aAAa;IAC9C,OAAuB,QAAQ,SAA2C;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AACA,OAAO,EAC0B,aAAa,EAC7C,MAAM,oBAAoB,CAAA;AAI3B,qBAAa,aAAc,SAAQ,aAAa;IAC9C,OAAuB,QAAQ,SAA2C;gBAE9D,OAAO,GAAE,MAAgB;CAItC;AAED,oFAAoF;AACpF,qBAAa,iBAAkB,SAAQ,aAAa;IAClD,OAAuB,QAAQ,SAAuC;gBAE1D,OAAO,EAAE,MAAM;CAI5B;AAED;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,iBAAiB;IACzD,OAAuB,QAAQ,SAA8C;g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EAAkB,MAAM,KAAK,CAAA;AAEpD,+FAA+F;AAC/F,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,KAAK,CAAA;AAEpD,+FAA+F;AAC/F,eAAO,MAAM,qBAAqB,GAAI,QAAQ,SAAS,KAAG,MAAM,EAGxC,CAAA"}
|
package/build/resource.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ResourceRecord } from '@owlmeans/resource';
|
|
2
2
|
import type { PostgresResource } from './types.js';
|
|
3
|
-
export declare const makePostgresResource: <R extends ResourceRecord, T extends PostgresResource<R> = PostgresResource<R>>(alias: string, dbAlias?: string, serviceAlias?: string,
|
|
3
|
+
export declare const makePostgresResource: <R extends ResourceRecord, T extends PostgresResource<R> = PostgresResource<R>>(alias: string, dbAlias?: string, serviceAlias?: string, tableName?: string) => T;
|
|
4
4
|
//# sourceMappingURL=resource.d.ts.map
|
package/build/resource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACuD,cAAc,EAChF,MAAM,oBAAoB,CAAA;AAW3B,OAAO,KAAK,EAC8D,gBAAgB,EAEzF,MAAM,YAAY,CAAA;AAiBnB,eAAO,MAAM,oBAAoB,GAC/B,CAAC,SAAS,cAAc,EAAE,CAAC,SAAS,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,EAE7E,OAAO,MAAM,EAAE,UAAS,MAAyB,EAAE,eAAc,MAAyB,EAC1F,YAAY,MAAM,KACjB,CA4cF,CAAA"}
|