@dbos-inc/create 3.0.58-preview → 3.0.60-preview.gc920193090
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 +1 -1
- package/templates/dbos-drizzle/drizzle.config.ts +3 -4
- package/templates/dbos-drizzle/src/main.ts +1 -1
- package/templates/dbos-knex/knexfile.js +3 -4
- package/templates/dbos-knex/src/main.ts +1 -1
- package/templates/dbos-prisma/generate_env.js +4 -3
- package/templates/dbos-prisma/src/main.ts +1 -1
- package/templates/dbos-typeorm/datasource.ts +3 -3
- package/templates/dbos-typeorm/src/main.ts +1 -1
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { defineConfig } from 'drizzle-kit';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const databaseUrl = getDatabaseUrl(dbosConfig);
|
|
3
|
+
const databaseUrl =
|
|
4
|
+
process.env.DBOS_DATABASE_URL ||
|
|
5
|
+
`postgresql://${process.env.PGUSER || 'postgres'}:${process.env.PGPASSWORD || 'dbos'}@${process.env.PGHOST || 'localhost'}:${process.env.PGPORT || '5432'}/${process.env.PGDATABASE || 'dbos_drizzle'}`;
|
|
7
6
|
|
|
8
7
|
export default defineConfig({
|
|
9
8
|
schema: './src/schema.ts',
|
|
@@ -91,7 +91,7 @@ app.get('/greeting/:name', (req: Request, res: Response) => {
|
|
|
91
91
|
async function main() {
|
|
92
92
|
DBOS.setConfig({
|
|
93
93
|
name: 'dbos-drizzle',
|
|
94
|
-
|
|
94
|
+
systemDatabaseUrl: process.env.DBOS_SYSTEM_DATABASE_URL,
|
|
95
95
|
});
|
|
96
96
|
await DBOS.launch();
|
|
97
97
|
const PORT = parseInt(process.env.NODE_PORT || '3000');
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
const
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const databaseUrl = getDatabaseUrl(dbosConfig);
|
|
1
|
+
const databaseUrl =
|
|
2
|
+
process.env.DBOS_DATABASE_URL ||
|
|
3
|
+
`postgresql://${process.env.PGUSER || 'postgres'}:${process.env.PGPASSWORD || 'dbos'}@${process.env.PGHOST || 'localhost'}:${process.env.PGPORT || '5432'}/${process.env.PGDATABASE || 'dbos_knex'}`;
|
|
5
4
|
|
|
6
5
|
const config = {
|
|
7
6
|
client: 'pg',
|
|
@@ -104,7 +104,7 @@ app.get('/greeting/:name', (req: Request, res: Response) => {
|
|
|
104
104
|
async function main() {
|
|
105
105
|
DBOS.setConfig({
|
|
106
106
|
name: 'dbos-knex',
|
|
107
|
-
|
|
107
|
+
systemDatabaseUrl: process.env.DBOS_SYSTEM_DATABASE_URL,
|
|
108
108
|
});
|
|
109
109
|
await DBOS.launch();
|
|
110
110
|
const PORT = parseInt(process.env.NODE_PORT || '3000');
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
const { readConfigFile, getDatabaseUrl } = require('@dbos-inc/dbos-sdk');
|
|
2
1
|
const fs = require('node:fs');
|
|
3
2
|
const path = require('node:path');
|
|
4
3
|
|
|
5
4
|
// Load the configuration file
|
|
6
|
-
const
|
|
7
|
-
|
|
5
|
+
const databaseUrl =
|
|
6
|
+
process.env['DBOS_DATABASE_URL'] ||
|
|
7
|
+
process.env['DATABASE_URL'] ||
|
|
8
|
+
`postgresql://${process.env.PGUSER || 'postgres'}:${process.env.PGPASSWORD || 'dbos'}@${process.env.PGHOST || 'localhost'}:${process.env.PGPORT || '5432'}/${process.env.PGDATABASE || 'dbos_prisma'}`;
|
|
8
9
|
|
|
9
10
|
try {
|
|
10
11
|
fs.writeFileSync(path.join(process.cwd(), 'prisma', '.env'), `DATABASE_URL="${databaseUrl}"`);
|
|
@@ -92,7 +92,7 @@ app.get('/greeting/:name', (req: Request, res: Response) => {
|
|
|
92
92
|
async function main() {
|
|
93
93
|
DBOS.setConfig({
|
|
94
94
|
name: 'dbos-prisma',
|
|
95
|
-
|
|
95
|
+
systemDatabaseUrl: process.env.DBOS_SYSTEM_DATABASE_URL,
|
|
96
96
|
});
|
|
97
97
|
await DBOS.launch();
|
|
98
98
|
const PORT = parseInt(process.env.NODE_PORT || '3000');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { readConfigFile, getDatabaseUrl } from '@dbos-inc/dbos-sdk';
|
|
2
1
|
import { DataSource } from 'typeorm';
|
|
3
2
|
|
|
4
|
-
const
|
|
5
|
-
|
|
3
|
+
const databaseUrl =
|
|
4
|
+
process.env.DBOS_DATABASE_URL ||
|
|
5
|
+
`postgresql://${process.env.PGUSER || 'postgres'}:${process.env.PGPASSWORD || 'dbos'}@${process.env.PGHOST || 'localhost'}:${process.env.PGPORT || '5432'}/${process.env.PGDATABASE || 'dbos_typeorm'}`;
|
|
6
6
|
|
|
7
7
|
const AppDataSource = new DataSource({
|
|
8
8
|
type: 'postgres',
|
|
@@ -89,7 +89,7 @@ app.get('/greeting/:name', (req: Request, res: Response) => {
|
|
|
89
89
|
async function main() {
|
|
90
90
|
DBOS.setConfig({
|
|
91
91
|
name: 'dbos-typeorm',
|
|
92
|
-
|
|
92
|
+
systemDatabaseUrl: process.env.DBOS_SYSTEM_DATABASE_URL,
|
|
93
93
|
});
|
|
94
94
|
await DBOS.launch();
|
|
95
95
|
const PORT = parseInt(process.env.NODE_PORT || '3000');
|