@prisma-next/extension-postgis 0.12.0-dev.5 → 0.12.0-dev.51
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/dist/control.mjs +16 -9
- package/dist/control.mjs.map +1 -1
- package/package.json +20 -20
- package/src/contract.d.ts +11 -5
- package/src/contract.json +12 -3
package/dist/control.mjs
CHANGED
|
@@ -4,10 +4,10 @@ import { contractSpaceFromJson } from "@prisma-next/migration-tools/spaces";
|
|
|
4
4
|
//#region migrations/20260601T0000_install_postgis_extension/migration.json
|
|
5
5
|
var migration_default = {
|
|
6
6
|
from: null,
|
|
7
|
-
to: "sha256:
|
|
7
|
+
to: "sha256:a8f5d5bba258f1722003ec229ffbd3c97b52ea8bdcc9aef2a7568501270ff936",
|
|
8
8
|
providedInvariants: ["postgis:install-postgis-v1"],
|
|
9
9
|
createdAt: "2026-06-01T00:00:00.000Z",
|
|
10
|
-
migrationHash: "sha256:
|
|
10
|
+
migrationHash: "sha256:495cdee8eb3526013bc9787cae3cb6d570405bb89953a405145a65bdaf941f46"
|
|
11
11
|
};
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region migrations/20260601T0000_install_postgis_extension/ops.json
|
|
@@ -40,7 +40,7 @@ var ops_default = [{
|
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region migrations/refs/head.json
|
|
42
42
|
var head_default = {
|
|
43
|
-
hash: "sha256:
|
|
43
|
+
hash: "sha256:a8f5d5bba258f1722003ec229ffbd3c97b52ea8bdcc9aef2a7568501270ff936",
|
|
44
44
|
invariants: ["postgis:install-postgis-v1"]
|
|
45
45
|
};
|
|
46
46
|
//#endregion
|
|
@@ -53,12 +53,19 @@ var contract_default = {
|
|
|
53
53
|
roots: {},
|
|
54
54
|
domain: { "namespaces": { "public": { "models": {} } } },
|
|
55
55
|
storage: {
|
|
56
|
-
"namespaces": {
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
56
|
+
"namespaces": {
|
|
57
|
+
"__unbound__": {
|
|
58
|
+
"entries": { "table": {} },
|
|
59
|
+
"id": "__unbound__",
|
|
60
|
+
"kind": "postgres-unbound-schema"
|
|
61
|
+
},
|
|
62
|
+
"public": {
|
|
63
|
+
"entries": { "table": {} },
|
|
64
|
+
"id": "public",
|
|
65
|
+
"kind": "postgres-schema"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"storageHash": "sha256:a8f5d5bba258f1722003ec229ffbd3c97b52ea8bdcc9aef2a7568501270ff936",
|
|
62
69
|
"types": { "geometry": {
|
|
63
70
|
"codecId": "pg/geometry@1",
|
|
64
71
|
"kind": "codec-instance",
|
package/dist/control.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps"],"sources":["../migrations/20260601T0000_install_postgis_extension/migration.json","../migrations/20260601T0000_install_postgis_extension/ops.json","../migrations/refs/head.json","../src/contract.json","../src/core/contract-space-constants.ts","../src/exports/control.ts"],"sourcesContent":["","","","","/**\n * Static names and identifiers used across postgis's contract space.\n *\n * Centralised here so the contract IR (`./contract`), the baseline\n * migration ops (`./migrations`), the head ref, and the descriptor\n * (`../exports/control`) all reference the same values without typos.\n *\n * The space identifier `'postgis'` is what the framework writes to\n * `migrations/` in the user's repo and what the marker table's\n * `space` column carries for postgis-owned rows.\n *\n * The `postgis:*` invariantId namespace is locked here — once\n * published, an invariantId is immutable so downstream consumers can\n * reference it by literal string match.\n */\n\nexport const POSTGIS_SPACE_ID = 'postgis' as const;\n\nexport const POSTGIS_NATIVE_TYPE = 'geometry' as const;\n\nexport const POSTGIS_BASELINE_MIGRATION_NAME = '20260601T0000_install_postgis_extension' as const;\n\n/**\n * `postgis:*` invariantIds emitted by the baseline migration. Each id,\n * once published, is immutable: downstream consumers (other extensions,\n * the marker table) reference them by literal string match.\n */\nexport const POSTGIS_INVARIANTS = {\n installPostgis: 'postgis:install-postgis-v1',\n} as const;\n","/**\n * Control-plane descriptor for the postgis extension.\n *\n * **Contract-space package layout.** The extension's contract\n * + migrations are emitted by the same pipeline application authors use:\n *\n * `prisma-next contract emit` → `<package>/src/contract.{json,d.ts}`\n * `prisma-next migration plan` → `<package>/migrations/<dir>/...`\n *\n * The descriptor wires those JSON artefacts via JSON-import declarations\n * so they flow through the consuming application's module resolver\n * without filesystem assumptions, and synthesises the canonical\n * `MigrationPackage` shape for the framework's runner / verifier to\n * consume.\n *\n * Wired surfaces:\n *\n * - `contractSpace.{contractJson,migrations,headRef}` — sourced from\n * the on-disk artefacts emitted by `build:contract-space`.\n * - `types.codecTypes.controlPlaneHooks[POSTGIS_GEOMETRY_CODEC_ID]` —\n * codec control hooks (`expandNativeType`, `resolveIdentityValue`)\n * the SQL planner extracts via `extractCodecControlHooks` and uses\n * to render `geometry(Geometry,${srid})` column types.\n *\n * @see docs/architecture docs/adrs/ADR 212 - Contract spaces.md\n * (contract-space package layout convention).\n */\n\nimport type { Contract } from '@prisma-next/contract/types';\nimport type {\n CodecControlHooks,\n SqlControlExtensionDescriptor,\n} from '@prisma-next/family-sql/control';\nimport { contractSpaceFromJson } from '@prisma-next/migration-tools/spaces';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport baselineMetadata from '../../migrations/20260601T0000_install_postgis_extension/migration.json' with {\n type: 'json',\n};\nimport baselineOps from '../../migrations/20260601T0000_install_postgis_extension/ops.json' with {\n type: 'json',\n};\nimport headRef from '../../migrations/refs/head.json' with { type: 'json' };\nimport contractJson from '../contract.json' with { type: 'json' };\nimport { POSTGIS_GEOMETRY_CODEC_ID } from '../core/constants';\nimport {\n POSTGIS_BASELINE_MIGRATION_NAME,\n POSTGIS_SPACE_ID,\n} from '../core/contract-space-constants';\nimport { postgisPackMeta, postgisQueryOperations } from '../core/descriptor-meta';\n\nconst geometryControlPlaneHooks: CodecControlHooks = {\n expandNativeType: ({ nativeType, typeParams }) => {\n const srid = typeParams?.['srid'];\n if (typeof srid === 'number' && Number.isInteger(srid) && srid >= 0) {\n // PostGIS prints the type-modifier list without a space — match\n // it here so the verifier doesn't see `geometry(Geometry, 4326)`\n // (DDL) mismatch `geometry(Geometry,4326)` (introspected).\n return `${nativeType}(Geometry,${srid})`;\n }\n return nativeType;\n },\n // PostGIS has no canonical \"identity\" geometry; backfilling a\n // non-null column requires the user to supply a valid value, so we\n // don't synthesise one here.\n resolveIdentityValue: () => null,\n};\n\nconst postgisContractSpace = contractSpaceFromJson<Contract<SqlStorage>>({\n contractJson,\n migrations: [\n {\n dirName: POSTGIS_BASELINE_MIGRATION_NAME,\n metadata: baselineMetadata,\n ops: baselineOps,\n },\n ],\n headRef,\n});\n\nconst postgisExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {\n ...postgisPackMeta,\n id: POSTGIS_SPACE_ID,\n contractSpace: postgisContractSpace,\n types: {\n ...postgisPackMeta.types,\n codecTypes: {\n ...postgisPackMeta.types.codecTypes,\n controlPlaneHooks: {\n [POSTGIS_GEOMETRY_CODEC_ID]: geometryControlPlaneHooks,\n },\n },\n },\n queryOperations: () => postgisQueryOperations(),\n create: () => ({\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n }),\n};\n\nexport { postgisExtensionDescriptor };\nexport default postgisExtensionDescriptor;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"control.mjs","names":["baselineMetadata","baselineOps"],"sources":["../migrations/20260601T0000_install_postgis_extension/migration.json","../migrations/20260601T0000_install_postgis_extension/ops.json","../migrations/refs/head.json","../src/contract.json","../src/core/contract-space-constants.ts","../src/exports/control.ts"],"sourcesContent":["","","","","/**\n * Static names and identifiers used across postgis's contract space.\n *\n * Centralised here so the contract IR (`./contract`), the baseline\n * migration ops (`./migrations`), the head ref, and the descriptor\n * (`../exports/control`) all reference the same values without typos.\n *\n * The space identifier `'postgis'` is what the framework writes to\n * `migrations/` in the user's repo and what the marker table's\n * `space` column carries for postgis-owned rows.\n *\n * The `postgis:*` invariantId namespace is locked here — once\n * published, an invariantId is immutable so downstream consumers can\n * reference it by literal string match.\n */\n\nexport const POSTGIS_SPACE_ID = 'postgis' as const;\n\nexport const POSTGIS_NATIVE_TYPE = 'geometry' as const;\n\nexport const POSTGIS_BASELINE_MIGRATION_NAME = '20260601T0000_install_postgis_extension' as const;\n\n/**\n * `postgis:*` invariantIds emitted by the baseline migration. Each id,\n * once published, is immutable: downstream consumers (other extensions,\n * the marker table) reference them by literal string match.\n */\nexport const POSTGIS_INVARIANTS = {\n installPostgis: 'postgis:install-postgis-v1',\n} as const;\n","/**\n * Control-plane descriptor for the postgis extension.\n *\n * **Contract-space package layout.** The extension's contract\n * + migrations are emitted by the same pipeline application authors use:\n *\n * `prisma-next contract emit` → `<package>/src/contract.{json,d.ts}`\n * `prisma-next migration plan` → `<package>/migrations/<dir>/...`\n *\n * The descriptor wires those JSON artefacts via JSON-import declarations\n * so they flow through the consuming application's module resolver\n * without filesystem assumptions, and synthesises the canonical\n * `MigrationPackage` shape for the framework's runner / verifier to\n * consume.\n *\n * Wired surfaces:\n *\n * - `contractSpace.{contractJson,migrations,headRef}` — sourced from\n * the on-disk artefacts emitted by `build:contract-space`.\n * - `types.codecTypes.controlPlaneHooks[POSTGIS_GEOMETRY_CODEC_ID]` —\n * codec control hooks (`expandNativeType`, `resolveIdentityValue`)\n * the SQL planner extracts via `extractCodecControlHooks` and uses\n * to render `geometry(Geometry,${srid})` column types.\n *\n * @see docs/architecture docs/adrs/ADR 212 - Contract spaces.md\n * (contract-space package layout convention).\n */\n\nimport type { Contract } from '@prisma-next/contract/types';\nimport type {\n CodecControlHooks,\n SqlControlExtensionDescriptor,\n} from '@prisma-next/family-sql/control';\nimport { contractSpaceFromJson } from '@prisma-next/migration-tools/spaces';\nimport type { SqlStorage } from '@prisma-next/sql-contract/types';\nimport baselineMetadata from '../../migrations/20260601T0000_install_postgis_extension/migration.json' with {\n type: 'json',\n};\nimport baselineOps from '../../migrations/20260601T0000_install_postgis_extension/ops.json' with {\n type: 'json',\n};\nimport headRef from '../../migrations/refs/head.json' with { type: 'json' };\nimport contractJson from '../contract.json' with { type: 'json' };\nimport { POSTGIS_GEOMETRY_CODEC_ID } from '../core/constants';\nimport {\n POSTGIS_BASELINE_MIGRATION_NAME,\n POSTGIS_SPACE_ID,\n} from '../core/contract-space-constants';\nimport { postgisPackMeta, postgisQueryOperations } from '../core/descriptor-meta';\n\nconst geometryControlPlaneHooks: CodecControlHooks = {\n expandNativeType: ({ nativeType, typeParams }) => {\n const srid = typeParams?.['srid'];\n if (typeof srid === 'number' && Number.isInteger(srid) && srid >= 0) {\n // PostGIS prints the type-modifier list without a space — match\n // it here so the verifier doesn't see `geometry(Geometry, 4326)`\n // (DDL) mismatch `geometry(Geometry,4326)` (introspected).\n return `${nativeType}(Geometry,${srid})`;\n }\n return nativeType;\n },\n // PostGIS has no canonical \"identity\" geometry; backfilling a\n // non-null column requires the user to supply a valid value, so we\n // don't synthesise one here.\n resolveIdentityValue: () => null,\n};\n\nconst postgisContractSpace = contractSpaceFromJson<Contract<SqlStorage>>({\n contractJson,\n migrations: [\n {\n dirName: POSTGIS_BASELINE_MIGRATION_NAME,\n metadata: baselineMetadata,\n ops: baselineOps,\n },\n ],\n headRef,\n});\n\nconst postgisExtensionDescriptor: SqlControlExtensionDescriptor<'postgres'> = {\n ...postgisPackMeta,\n id: POSTGIS_SPACE_ID,\n contractSpace: postgisContractSpace,\n types: {\n ...postgisPackMeta.types,\n codecTypes: {\n ...postgisPackMeta.types.codecTypes,\n controlPlaneHooks: {\n [POSTGIS_GEOMETRY_CODEC_ID]: geometryControlPlaneHooks,\n },\n },\n },\n queryOperations: () => postgisQueryOperations(),\n create: () => ({\n familyId: 'sql' as const,\n targetId: 'postgres' as const,\n }),\n};\n\nexport { postgisExtensionDescriptor };\nexport default postgisExtensionDescriptor;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AIgBA,MAAa,mBAAmB;AAIhC,MAAa,kCAAkC;;;AC8B/C,MAAM,4BAA+C;CACnD,mBAAmB,EAAE,YAAY,iBAAiB;EAChD,MAAM,OAAO,aAAa;EAC1B,IAAI,OAAO,SAAS,YAAY,OAAO,UAAU,IAAI,KAAK,QAAQ,GAIhE,OAAO,GAAG,WAAW,YAAY,KAAK;EAExC,OAAO;CACT;CAIA,4BAA4B;AAC9B;AAEA,MAAM,uBAAuB,sBAA4C;CACvE,cAAA;CACA,YAAY,CACV;EACE,SAAS;EACT,UAAUA;EACV,KAAKC;CACP,CACF;CACA,SAAA;AACF,CAAC;AAED,MAAM,6BAAwE;CAC5E,GAAG;CACH,IAAI;CACJ,eAAe;CACf,OAAO;EACL,GAAG,gBAAgB;EACnB,YAAY;GACV,GAAG,gBAAgB,MAAM;GACzB,mBAAmB,GAChB,4BAA4B,0BAC/B;EACF;CACF;CACA,uBAAuB,uBAAuB;CAC9C,eAAe;EACb,UAAU;EACV,UAAU;CACZ;AACF"}
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/extension-postgis",
|
|
3
|
-
"version": "0.12.0-dev.
|
|
3
|
+
"version": "0.12.0-dev.51",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@prisma-next/contract": "0.12.0-dev.
|
|
9
|
-
"@prisma-next/contract-authoring": "0.12.0-dev.
|
|
10
|
-
"@prisma-next/family-sql": "0.12.0-dev.
|
|
11
|
-
"@prisma-next/framework-components": "0.12.0-dev.
|
|
12
|
-
"@prisma-next/migration-tools": "0.12.0-dev.
|
|
13
|
-
"@prisma-next/sql-contract": "0.12.0-dev.
|
|
14
|
-
"@prisma-next/sql-operations": "0.12.0-dev.
|
|
15
|
-
"@prisma-next/sql-relational-core": "0.12.0-dev.
|
|
16
|
-
"@prisma-next/sql-runtime": "0.12.0-dev.
|
|
17
|
-
"@prisma-next/sql-schema-ir": "0.12.0-dev.
|
|
8
|
+
"@prisma-next/contract": "0.12.0-dev.51",
|
|
9
|
+
"@prisma-next/contract-authoring": "0.12.0-dev.51",
|
|
10
|
+
"@prisma-next/family-sql": "0.12.0-dev.51",
|
|
11
|
+
"@prisma-next/framework-components": "0.12.0-dev.51",
|
|
12
|
+
"@prisma-next/migration-tools": "0.12.0-dev.51",
|
|
13
|
+
"@prisma-next/sql-contract": "0.12.0-dev.51",
|
|
14
|
+
"@prisma-next/sql-operations": "0.12.0-dev.51",
|
|
15
|
+
"@prisma-next/sql-relational-core": "0.12.0-dev.51",
|
|
16
|
+
"@prisma-next/sql-runtime": "0.12.0-dev.51",
|
|
17
|
+
"@prisma-next/sql-schema-ir": "0.12.0-dev.51",
|
|
18
18
|
"@standard-schema/spec": "^1.1.0",
|
|
19
19
|
"arktype": "^2.2.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@prisma-next/adapter-postgres": "0.12.0-dev.
|
|
23
|
-
"@prisma-next/cli": "0.12.0-dev.
|
|
24
|
-
"@prisma-next/operations": "0.12.0-dev.
|
|
25
|
-
"@prisma-next/postgres": "0.12.0-dev.
|
|
26
|
-
"@prisma-next/sql-contract-ts": "0.12.0-dev.
|
|
27
|
-
"@prisma-next/target-postgres": "0.12.0-dev.
|
|
28
|
-
"@prisma-next/test-utils": "0.12.0-dev.
|
|
29
|
-
"@prisma-next/tsconfig": "0.12.0-dev.
|
|
30
|
-
"@prisma-next/tsdown": "0.12.0-dev.
|
|
22
|
+
"@prisma-next/adapter-postgres": "0.12.0-dev.51",
|
|
23
|
+
"@prisma-next/cli": "0.12.0-dev.51",
|
|
24
|
+
"@prisma-next/operations": "0.12.0-dev.51",
|
|
25
|
+
"@prisma-next/postgres": "0.12.0-dev.51",
|
|
26
|
+
"@prisma-next/sql-contract-ts": "0.12.0-dev.51",
|
|
27
|
+
"@prisma-next/target-postgres": "0.12.0-dev.51",
|
|
28
|
+
"@prisma-next/test-utils": "0.12.0-dev.51",
|
|
29
|
+
"@prisma-next/tsconfig": "0.12.0-dev.51",
|
|
30
|
+
"@prisma-next/tsdown": "0.12.0-dev.51",
|
|
31
31
|
"tsdown": "0.22.0",
|
|
32
32
|
"typescript": "5.9.3",
|
|
33
33
|
"vitest": "4.1.6"
|
package/src/contract.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ import type {
|
|
|
23
23
|
} from '@prisma-next/sql-contract/types';
|
|
24
24
|
import type {
|
|
25
25
|
Contract as ContractType,
|
|
26
|
-
|
|
26
|
+
ContractModelDefinitions,
|
|
27
27
|
ExecutionHashBase,
|
|
28
28
|
NamespaceId,
|
|
29
29
|
ProfileHashBase,
|
|
@@ -31,7 +31,7 @@ import type {
|
|
|
31
31
|
} from '@prisma-next/contract/types';
|
|
32
32
|
|
|
33
33
|
export type StorageHash =
|
|
34
|
-
StorageHashBase<'sha256:
|
|
34
|
+
StorageHashBase<'sha256:a8f5d5bba258f1722003ec229ffbd3c97b52ea8bdcc9aef2a7568501270ff936'>;
|
|
35
35
|
export type ExecutionHash = ExecutionHashBase<string>;
|
|
36
36
|
export type ProfileHash =
|
|
37
37
|
ProfileHashBase<'sha256:9c8aa3114e84ed3b7ea2bd57526d9c2e1bf7c5292be694e9d3801f566fda7ccb'>;
|
|
@@ -56,10 +56,15 @@ type ContractBase = Omit<
|
|
|
56
56
|
ContractType<
|
|
57
57
|
{
|
|
58
58
|
readonly namespaces: {
|
|
59
|
+
readonly __unbound__: {
|
|
60
|
+
readonly id: '__unbound__';
|
|
61
|
+
readonly kind: 'postgres-unbound-schema';
|
|
62
|
+
readonly entries: { readonly table: {}; readonly type: Record<string, never> };
|
|
63
|
+
};
|
|
59
64
|
readonly public: {
|
|
60
65
|
readonly id: 'public';
|
|
61
|
-
readonly kind: '
|
|
62
|
-
readonly
|
|
66
|
+
readonly kind: 'postgres-schema';
|
|
67
|
+
readonly entries: { readonly table: {}; readonly type: Record<string, never> };
|
|
63
68
|
};
|
|
64
69
|
};
|
|
65
70
|
readonly types: {
|
|
@@ -108,7 +113,8 @@ type ContractBase = Omit<
|
|
|
108
113
|
readonly profileHash: ProfileHash;
|
|
109
114
|
};
|
|
110
115
|
|
|
116
|
+
export type Models = ContractModelDefinitions<Contract>;
|
|
117
|
+
|
|
111
118
|
export type Contract = ContractWithTypeMaps<ContractBase, TypeMaps>;
|
|
112
119
|
|
|
113
120
|
export type Namespaces = Contract['storage']['namespaces'];
|
|
114
|
-
export type Models = ContractModelsMap<Contract>;
|
package/src/contract.json
CHANGED
|
@@ -13,13 +13,22 @@
|
|
|
13
13
|
},
|
|
14
14
|
"storage": {
|
|
15
15
|
"namespaces": {
|
|
16
|
+
"__unbound__": {
|
|
17
|
+
"entries": {
|
|
18
|
+
"table": {}
|
|
19
|
+
},
|
|
20
|
+
"id": "__unbound__",
|
|
21
|
+
"kind": "postgres-unbound-schema"
|
|
22
|
+
},
|
|
16
23
|
"public": {
|
|
24
|
+
"entries": {
|
|
25
|
+
"table": {}
|
|
26
|
+
},
|
|
17
27
|
"id": "public",
|
|
18
|
-
"kind": "postgres-schema"
|
|
19
|
-
"tables": {}
|
|
28
|
+
"kind": "postgres-schema"
|
|
20
29
|
}
|
|
21
30
|
},
|
|
22
|
-
"storageHash": "sha256:
|
|
31
|
+
"storageHash": "sha256:a8f5d5bba258f1722003ec229ffbd3c97b52ea8bdcc9aef2a7568501270ff936",
|
|
23
32
|
"types": {
|
|
24
33
|
"geometry": {
|
|
25
34
|
"codecId": "pg/geometry@1",
|