@dbos-inc/create 3.0.43-preview → 3.0.44-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,14 +1,15 @@
|
|
|
1
1
|
import { defineConfig } from 'drizzle-kit';
|
|
2
2
|
|
|
3
|
-
const {
|
|
3
|
+
const { readConfigFile, getDatabaseUrl } = require('@dbos-inc/dbos-sdk');
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const dbosConfig = readConfigFile();
|
|
6
|
+
const databaseUrl = getDatabaseUrl(dbosConfig);
|
|
6
7
|
|
|
7
8
|
export default defineConfig({
|
|
8
9
|
schema: './src/schema.ts',
|
|
9
10
|
out: './drizzle',
|
|
10
11
|
dialect: 'postgresql',
|
|
11
12
|
dbCredentials: {
|
|
12
|
-
url:
|
|
13
|
+
url: databaseUrl,
|
|
13
14
|
},
|
|
14
15
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { readConfigFile, getDatabaseUrl } = require('@dbos-inc/dbos-sdk');
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const dbosConfig = readConfigFile();
|
|
4
|
+
const databaseUrl = getDatabaseUrl(dbosConfig);
|
|
4
5
|
|
|
5
6
|
const config = {
|
|
6
7
|
client: 'pg',
|
|
7
|
-
connection:
|
|
8
|
+
connection: databaseUrl,
|
|
8
9
|
migrations: {
|
|
9
10
|
directory: './migrations',
|
|
10
11
|
},
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
const {
|
|
1
|
+
const { readConfigFile, getDatabaseUrl } = require('@dbos-inc/dbos-sdk');
|
|
2
2
|
const fs = require('node:fs');
|
|
3
3
|
const path = require('node:path');
|
|
4
4
|
|
|
5
5
|
// Load the configuration file
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
// Write out the .env file
|
|
9
|
-
const databaseURL = `postgresql://${dbosConfig.poolConfig.user}:${dbosConfig.poolConfig.password}@${dbosConfig.poolConfig.host}:${dbosConfig.poolConfig.port}/${dbosConfig.poolConfig.database}`;
|
|
6
|
+
const dbosConfig = readConfigFile();
|
|
7
|
+
const databaseUrl = getDatabaseUrl(dbosConfig);
|
|
10
8
|
|
|
11
9
|
try {
|
|
12
|
-
fs.writeFileSync(path.join(process.cwd(), 'prisma', '.env'), `DATABASE_URL="${
|
|
10
|
+
fs.writeFileSync(path.join(process.cwd(), 'prisma', '.env'), `DATABASE_URL="${databaseUrl}"`);
|
|
13
11
|
console.log('Wrote database URL to the prisma/.env file.');
|
|
14
12
|
} catch (error) {
|
|
15
13
|
console.error('Error writing prisma/.env file:', error.message);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TlsOptions } from 'tls';
|
|
1
|
+
import { readConfigFile, getDatabaseUrl } from '@dbos-inc/dbos-sdk';
|
|
3
2
|
import { DataSource } from 'typeorm';
|
|
4
3
|
|
|
5
|
-
const
|
|
4
|
+
const dbosConfig = readConfigFile();
|
|
5
|
+
const databaseUrl = getDatabaseUrl(dbosConfig);
|
|
6
6
|
|
|
7
7
|
const AppDataSource = new DataSource({
|
|
8
8
|
type: 'postgres',
|
|
9
|
-
url:
|
|
9
|
+
url: databaseUrl,
|
|
10
10
|
entities: ['dist/entities/*.js'],
|
|
11
11
|
migrations: ['dist/migrations/*.js'],
|
|
12
12
|
});
|