drizzle-orm-pg
Advanced tools
Comparing version 0.15.1-80901ff to 0.15.1-9728cc6
{ | ||
"name": "drizzle-orm-pg", | ||
"version": "0.15.1-80901ff", | ||
"version": "0.15.1-9728cc6", | ||
"description": "Drizzle ORM package for PostgreSQL database", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -38,2 +38,3 @@ import { GetColumnData } from 'drizzle-orm'; | ||
export interface PgSchema { | ||
schemaName: string; | ||
} | ||
@@ -46,2 +47,3 @@ export declare function isPgSchema(obj: unknown): obj is PgSchema; | ||
[isPgSchemaSym]: boolean; | ||
schemaName: T; | ||
}; | ||
@@ -48,0 +50,0 @@ export declare function pgTable<TTableName extends string, TColumnsMap extends Record<string, AnyPgColumnBuilder>>(name: TTableName, columns: TColumnsMap, extraConfig?: (self: BuildColumns<TTableName, TColumnsMap>) => PgTableExtraConfig): PgTableWithColumns<{ |
@@ -43,3 +43,3 @@ "use strict"; | ||
const columnFactory = (name, columns, extraConfig) => pgTableWithSchema(name, columns, schemaName, extraConfig); | ||
return Object.assign(columnFactory, { [isPgSchemaSym]: true }); | ||
return Object.assign(columnFactory, { [isPgSchemaSym]: true, schemaName }); | ||
} | ||
@@ -46,0 +46,0 @@ exports.pgSchema = pgSchema; |
@@ -13,2 +13,4 @@ import { SelectFields, SelectFieldsOrdered } from './operations'; | ||
checks: Check[]; | ||
name: string; | ||
schema: string | undefined; | ||
}; | ||
@@ -15,0 +17,0 @@ export declare function getTableColumns<TTable extends AnyPgTable>(table: TTable): import("./columns").AnyPgColumn<{ |
@@ -16,4 +16,6 @@ "use strict"; | ||
const foreignKeys = getTableForeignKeys(table); | ||
const name = table[drizzle_orm_1.Table.Symbol.Name]; | ||
const schema = table[drizzle_orm_1.Table.Symbol.Schema]; | ||
const extraConfig = table[table_1.PgTable.Symbol.ExtraConfig]; | ||
if (typeof extraConfig === 'undefined') | ||
if (typeof extraConfig === 'undefined') { | ||
return { | ||
@@ -24,3 +26,6 @@ columns, | ||
checks, | ||
name, | ||
schema | ||
}; | ||
} | ||
const builtConfig = extraConfig(table[table_1.PgTable.Symbol.Columns]); | ||
@@ -43,2 +48,4 @@ Object.entries(builtConfig).forEach(([_, builder]) => { | ||
checks, | ||
name, | ||
schema | ||
}; | ||
@@ -45,0 +52,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
229277
3435