@owlmeans/postgres 0.1.18-rc.44 → 0.1.18-rc.46

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.
Files changed (40) hide show
  1. package/README.md +5 -4
  2. package/agent-meta/manifest.json +2 -2
  3. package/agent-meta/skills/postgres/SKILL.md +1 -1
  4. package/build/bootstrap.d.ts.map +1 -1
  5. package/build/bootstrap.js +4 -3
  6. package/build/bootstrap.js.map +1 -1
  7. package/build/index.d.ts +2 -0
  8. package/build/index.d.ts.map +1 -1
  9. package/build/index.js.map +1 -1
  10. package/build/service.d.ts.map +1 -1
  11. package/build/service.js +13 -8
  12. package/build/service.js.map +1 -1
  13. package/build/utils/config/types.d.ts +30 -0
  14. package/build/utils/config/types.d.ts.map +1 -0
  15. package/build/utils/config/types.js +2 -0
  16. package/build/utils/config/types.js.map +1 -0
  17. package/build/utils/config.d.ts +4 -24
  18. package/build/utils/config.d.ts.map +1 -1
  19. package/build/utils/config.js +74 -87
  20. package/build/utils/config.js.map +1 -1
  21. package/build/utils/connection/types.d.ts +17 -0
  22. package/build/utils/connection/types.d.ts.map +1 -0
  23. package/build/utils/connection/types.js +2 -0
  24. package/build/utils/connection/types.js.map +1 -0
  25. package/build/utils/connection.d.ts +2 -13
  26. package/build/utils/connection.d.ts.map +1 -1
  27. package/build/utils/connection.js +31 -37
  28. package/build/utils/connection.js.map +1 -1
  29. package/package.json +8 -8
  30. package/src/bootstrap.ts +4 -5
  31. package/src/index.ts +2 -0
  32. package/src/service.ts +14 -9
  33. package/src/utils/config/types.ts +28 -0
  34. package/src/utils/config.ts +80 -89
  35. package/src/utils/connection/types.ts +17 -0
  36. package/src/utils/connection.ts +33 -36
  37. package/tests/context.ts +3 -3
  38. package/tests/criteria.spec.ts +2 -2
  39. package/tests/migration.spec.ts +3 -3
  40. package/tests/sync.spec.ts +3 -3
@@ -1,5 +1,5 @@
1
1
  import { afterAll, describe, expect, test } from 'bun:test'
2
- import { makePostgresResource, resetDeclarations } from '@owlmeans/postgres-resource'
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
 
@@ -1,6 +1,6 @@
1
1
  import { afterAll, describe, expect, test } from 'bun:test'
2
2
  import {
3
- introspectTable, makePostgresResource, PgAutoSync, planSync, PostgresCastRequired,
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(client, table.schema, table.table, table.qualified)
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
  }