11import postgresAdapter from '@prisma-next/adapter-postgres/runtime' ;
2- import {
3- contractModels ,
4- type Contract as FrameworkContract ,
5- UNBOUND_DOMAIN_NAMESPACE_ID ,
6- } from '@prisma-next/contract/types' ;
2+ import { contractModels , type Contract as FrameworkContract } from '@prisma-next/contract/types' ;
73import pgvectorRuntime from '@prisma-next/extension-pgvector/runtime' ;
84import { SqlContractSerializer } from '@prisma-next/family-sql/ir' ;
9- import { UNBOUND_NAMESPACE_ID } from '@prisma-next/framework-components/ir' ;
5+
6+ const POSTGRES_DEFAULT_NAMESPACE_ID = 'public' as const ;
7+
108import { AsyncIterableResult } from '@prisma-next/framework-components/runtime' ;
119import type { SqlStorage } from '@prisma-next/sql-contract/types' ;
1210import type { RuntimeQueryable } from '@prisma-next/sql-orm-client' ;
@@ -54,7 +52,7 @@ export function withPatchedDomainModels<T extends FrameworkContract<SqlStorage>>
5452 contract : T ,
5553 patch : ( models : Record < string , unknown > ) => Record < string , unknown > ,
5654) : T {
57- const namespaceId = UNBOUND_DOMAIN_NAMESPACE_ID ;
55+ const namespaceId = POSTGRES_DEFAULT_NAMESPACE_ID ;
5856 const namespace = contract . domain . namespaces [ namespaceId ] ! ;
5957 const models = contractModels ( contract ) ;
6058 return {
@@ -83,7 +81,7 @@ type MutableDomainModel = {
8381function unboundDomainModels ( raw : {
8482 domain : { namespaces : Record < string , { models : Record < string , unknown > } > } ;
8583} ) : Record < string , MutableDomainModel > {
86- return raw . domain . namespaces [ UNBOUND_DOMAIN_NAMESPACE_ID ] ! . models as Record <
84+ return raw . domain . namespaces [ POSTGRES_DEFAULT_NAMESPACE_ID ] ! . models as Record <
8785 string ,
8886 MutableDomainModel
8987 > ;
@@ -151,7 +149,7 @@ export function buildMixedPolyContract(): TestContract {
151149 base : 'Task' ,
152150 } ;
153151
154- raw . storage . namespaces [ UNBOUND_NAMESPACE_ID ] . tables . tasks = {
152+ raw . storage . namespaces [ POSTGRES_DEFAULT_NAMESPACE_ID ] . tables . tasks = {
155153 columns : {
156154 id : { nativeType : 'int4' , codecId : 'pg/int4@1' , nullable : false } ,
157155 title : { nativeType : 'text' , codecId : 'pg/text@1' , nullable : false } ,
@@ -164,7 +162,7 @@ export function buildMixedPolyContract(): TestContract {
164162 foreignKeys : [ ] ,
165163 } ;
166164
167- raw . storage . namespaces [ UNBOUND_NAMESPACE_ID ] . tables . features = {
165+ raw . storage . namespaces [ POSTGRES_DEFAULT_NAMESPACE_ID ] . tables . features = {
168166 columns : {
169167 id : { nativeType : 'int4' , codecId : 'pg/int4@1' , nullable : false } ,
170168 priority : { nativeType : 'int4' , codecId : 'pg/int4@1' , nullable : false } ,
@@ -216,17 +214,17 @@ export function buildStiPolyContract(): TestContract {
216214 base : 'User' ,
217215 } ;
218216
219- raw . storage . namespaces [ UNBOUND_NAMESPACE_ID ] . tables . users . columns . kind = {
217+ raw . storage . namespaces [ POSTGRES_DEFAULT_NAMESPACE_ID ] . tables . users . columns . kind = {
220218 codecId : 'pg/text@1' ,
221219 nativeType : 'text' ,
222220 nullable : false ,
223221 } ;
224- raw . storage . namespaces [ UNBOUND_NAMESPACE_ID ] . tables . users . columns . role = {
222+ raw . storage . namespaces [ POSTGRES_DEFAULT_NAMESPACE_ID ] . tables . users . columns . role = {
225223 codecId : 'pg/text@1' ,
226224 nativeType : 'text' ,
227225 nullable : true ,
228226 } ;
229- raw . storage . namespaces [ UNBOUND_NAMESPACE_ID ] . tables . users . columns . plan = {
227+ raw . storage . namespaces [ POSTGRES_DEFAULT_NAMESPACE_ID ] . tables . users . columns . plan = {
230228 codecId : 'pg/text@1' ,
231229 nativeType : 'text' ,
232230 nullable : true ,
0 commit comments