@owlmeans/postgres 0.1.18-rc.44 → 0.1.18-rc.45
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 +5 -4
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/postgres/SKILL.md +1 -1
- package/build/bootstrap.d.ts.map +1 -1
- package/build/bootstrap.js +4 -3
- package/build/bootstrap.js.map +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js.map +1 -1
- package/build/service.d.ts.map +1 -1
- package/build/service.js +13 -8
- package/build/service.js.map +1 -1
- package/build/utils/config/types.d.ts +30 -0
- package/build/utils/config/types.d.ts.map +1 -0
- package/build/utils/config/types.js +2 -0
- package/build/utils/config/types.js.map +1 -0
- package/build/utils/config.d.ts +4 -24
- package/build/utils/config.d.ts.map +1 -1
- package/build/utils/config.js +74 -87
- package/build/utils/config.js.map +1 -1
- package/build/utils/connection/types.d.ts +17 -0
- package/build/utils/connection/types.d.ts.map +1 -0
- package/build/utils/connection/types.js +2 -0
- package/build/utils/connection/types.js.map +1 -0
- package/build/utils/connection.d.ts +2 -13
- package/build/utils/connection.d.ts.map +1 -1
- package/build/utils/connection.js +31 -37
- package/build/utils/connection.js.map +1 -1
- package/package.json +8 -8
- package/src/bootstrap.ts +4 -5
- package/src/index.ts +2 -0
- package/src/service.ts +14 -9
- package/src/utils/config/types.ts +28 -0
- package/src/utils/config.ts +80 -89
- package/src/utils/connection/types.ts +17 -0
- package/src/utils/connection.ts +33 -36
- package/tests/context.ts +3 -3
- package/tests/criteria.spec.ts +2 -2
- package/tests/migration.spec.ts +3 -3
- package/tests/sync.spec.ts +3 -3
package/tests/migration.spec.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { afterAll, describe, expect, test } from 'bun:test'
|
|
2
|
-
import { makePostgresResource,
|
|
2
|
+
import { makePostgresResource, pgDeclarationHelper } from '@owlmeans/postgres-resource'
|
|
3
3
|
import type { PostgresResource, PostgresTx } from '@owlmeans/postgres-resource'
|
|
4
4
|
import { MigrationConflict, MigrationError, MigrationStage } from '@owlmeans/resource'
|
|
5
5
|
import type { ResourceRecord } from '@owlmeans/resource'
|
|
@@ -253,7 +253,7 @@ describe('@owlmeans/postgres — code registered migrations', () => {
|
|
|
253
253
|
})
|
|
254
254
|
|
|
255
255
|
/** A restarted process with an edited source file — the registry has to be rebuilt. */
|
|
256
|
-
resetDeclarations('mig-e')
|
|
256
|
+
pgDeclarationHelper.resetDeclarations('mig-e')
|
|
257
257
|
|
|
258
258
|
await expect(boot({
|
|
259
259
|
alias: 'mig-e',
|
|
@@ -262,7 +262,7 @@ describe('@owlmeans/postgres — code registered migrations', () => {
|
|
|
262
262
|
})
|
|
263
263
|
|
|
264
264
|
it('rejects a changed body under a name already registered in this process', () => {
|
|
265
|
-
resetDeclarations('mig-conflict')
|
|
265
|
+
pgDeclarationHelper.resetDeclarations('mig-conflict')
|
|
266
266
|
const resource = makePostgresResource<Note, PostgresResource<Note>>('mig-conflict')
|
|
267
267
|
resource.migration('0001-drift', driftBody)
|
|
268
268
|
|
package/tests/sync.spec.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { afterAll, describe, expect, test } from 'bun:test'
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
makePgIntrospectHelper, makePostgresResource, PgAutoSync, pgDiffHelper, PostgresCastRequired,
|
|
4
4
|
} from '@owlmeans/postgres-resource'
|
|
5
5
|
import type { PostgresResource } from '@owlmeans/postgres-resource'
|
|
6
6
|
import type { ResourceRecord } from '@owlmeans/resource'
|
|
@@ -236,8 +236,8 @@ describe('@owlmeans/postgres — reconciling a table already at its shape', () =
|
|
|
236
236
|
const client = await pool.connect()
|
|
237
237
|
try {
|
|
238
238
|
const table = second.resource.table
|
|
239
|
-
const live = await introspectTable(
|
|
240
|
-
expect(planSync(table, live).statements.map(statement => statement.sql)).toEqual([])
|
|
239
|
+
const live = await makePgIntrospectHelper(client).introspectTable(table.schema, table.table, table.qualified)
|
|
240
|
+
expect(pgDiffHelper.planSync(table, live).statements.map(statement => statement.sql)).toEqual([])
|
|
241
241
|
} finally {
|
|
242
242
|
client.release()
|
|
243
243
|
}
|