@@ -5,8 +5,6 @@ import { dropDB, ensureDB } from './test-helpers';
55import { randomUUID } from 'crypto' ;
66import SuperJSON from 'superjson' ;
77import { pgTable , text , integer } from 'drizzle-orm/pg-core' ;
8- import { drizzle } from 'drizzle-orm/node-postgres' ;
9- import { pushSchema } from 'drizzle-kit/api' ;
108import { eq , sql } from 'drizzle-orm' ;
119
1210const config = { user : 'postgres' , database : 'drizzle_ds_test_userdb' } ;
@@ -19,14 +17,14 @@ interface transaction_completion {
1917 error : string | null ;
2018}
2119
22- async function createSchema ( config : PoolConfig , entities : { [ key : string ] : object } ) {
23- const drizzlePool = new Pool ( config ) ;
24- const db = drizzle ( drizzlePool ) ;
20+ async function createSchema ( config : PoolConfig ) {
21+ const pool = new Pool ( config ) ;
2522 try {
26- const res = await pushSchema ( entities , db ) ;
27- await res . apply ( ) ;
23+ await pool . query (
24+ `CREATE TABLE IF NOT EXISTS greetings (name TEXT PRIMARY KEY NOT NULL, greet_count INTEGER DEFAULT 0)` ,
25+ ) ;
2826 } finally {
29- await drizzlePool . end ( ) ;
27+ await pool . end ( ) ;
3028 }
3129}
3230
@@ -344,7 +342,7 @@ async function createDatabases(createTxCompletions: boolean) {
344342 if ( createTxCompletions ) {
345343 await DrizzleDataSource . initializeDBOSSchema ( config ) ;
346344 }
347- await createSchema ( config , { greetingsTable } ) ;
345+ await createSchema ( config ) ;
348346}
349347
350348async function insertFunction ( user : string ) {
0 commit comments