@dbos-inc/typeorm-datasource 3.4.10-preview → 3.4.12

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/typeorm-datasource",
3
- "version": "3.4.10-preview",
3
+ "version": "3.4.12",
4
4
  "description": "DBOS DataSource library for TypeORM with PostgreSQL support",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -16,7 +16,7 @@ class Greeting {
16
16
  }
17
17
 
18
18
  const config = { user: 'postgres', database: 'typeorm_ds_test_datasource' };
19
- const dataSource = new TypeOrmDataSource('app-db', config, [Greeting]);
19
+ const dataSource = TypeOrmDataSource.createFromConfig('app-db', config, [Greeting]);
20
20
 
21
21
  interface transaction_completion {
22
22
  workflow_id: string;
@@ -347,7 +347,7 @@ async function createDatabases(createTxCompletions: boolean) {
347
347
 
348
348
  async function insertFunction(user: string) {
349
349
  type Result = Array<{ greet_count: number }>;
350
- const rows = await TypeOrmDataSource.entityManager.sql<Result>`
350
+ const rows = await dataSource.entityManager.sql<Result>`
351
351
  INSERT INTO greetings(name, greet_count) VALUES(${user}, 1)
352
352
  ON CONFLICT(name) DO UPDATE SET greet_count = greetings.greet_count + 1
353
353
  RETURNING greet_count`;