@dbos-inc/drizzle-datasource 4.12.8-preview → 4.13.4-preview

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbos-inc/drizzle-datasource",
3
- "version": "4.12.8-preview",
3
+ "version": "4.13.4-preview",
4
4
  "description": "DBOS DataSource library for Drizzle ORM with PostgreSQL support",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -26,7 +26,6 @@
26
26
  "devDependencies": {
27
27
  "@types/jest": "^29.5.14",
28
28
  "@types/pg": "^8.15.2",
29
- "drizzle-kit": "^0.31.5",
30
29
  "drizzle-orm": "^0.44.5",
31
30
  "jest": "^29.7.0",
32
31
  "typescript": "^5.4.5"
@@ -5,8 +5,6 @@ import { dropDB, ensureDB } from './test-helpers';
5
5
  import { randomUUID } from 'crypto';
6
6
  import SuperJSON from 'superjson';
7
7
  import { pgTable, text, integer } from 'drizzle-orm/pg-core';
8
- import { drizzle } from 'drizzle-orm/node-postgres';
9
- import { pushSchema } from 'drizzle-kit/api';
10
8
  import { sql } from 'drizzle-orm';
11
9
 
12
10
  const config = { user: 'postgres', database: 'drizzle_pool_test_userdb' };
@@ -69,14 +67,9 @@ describe('DrizzleDataSource with custom Pool', () => {
69
67
  poolClient.release();
70
68
  }
71
69
 
72
- const drizzlePool = new Pool(config);
73
- const db = drizzle(drizzlePool);
74
- try {
75
- const res = await pushSchema({ greetingsTable }, db);
76
- await res.apply();
77
- } finally {
78
- await drizzlePool.end();
79
- }
70
+ await customPool.query(
71
+ `CREATE TABLE IF NOT EXISTS greetings (name TEXT PRIMARY KEY NOT NULL, greet_count INTEGER DEFAULT 0)`,
72
+ );
80
73
  });
81
74
 
82
75
  afterAll(async () => {
@@ -5,8 +5,6 @@ import { dropDB, ensureDB } from './test-helpers';
5
5
  import { randomUUID } from 'crypto';
6
6
  import SuperJSON from 'superjson';
7
7
  import { pgTable, text, integer } from 'drizzle-orm/pg-core';
8
- import { drizzle } from 'drizzle-orm/node-postgres';
9
- import { pushSchema } from 'drizzle-kit/api';
10
8
  import { eq, sql } from 'drizzle-orm';
11
9
 
12
10
  const config = { user: 'postgres', database: 'drizzle_ds_test_userdb' };
@@ -19,14 +17,14 @@ interface transaction_completion {
19
17
  error: string | null;
20
18
  }
21
19
 
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);
25
22
  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
+ );
28
26
  } finally {
29
- await drizzlePool.end();
27
+ await pool.end();
30
28
  }
31
29
  }
32
30
 
@@ -344,7 +342,7 @@ async function createDatabases(createTxCompletions: boolean) {
344
342
  if (createTxCompletions) {
345
343
  await DrizzleDataSource.initializeDBOSSchema(config);
346
344
  }
347
- await createSchema(config, { greetingsTable });
345
+ await createSchema(config);
348
346
  }
349
347
 
350
348
  async function insertFunction(user: string) {