@dbos-inc/dbos-sdk 0.9.8-preview → 0.9.15-preview.g32137f5fa0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/dbos-runtime/init.d.ts.map +1 -1
- package/dist/src/dbos-runtime/init.js +1 -0
- package/dist/src/dbos-runtime/init.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/examples/hello/knexfile.js +20 -0
- package/examples/hello/migrations/{create_dbos_hello_tables.ts → 20240212161006_create_dbos_hello_tables.js} +5 -5
- package/examples/hello/package-lock.json +1264 -9617
- package/examples/hello/package.json +1 -3
- package/package.json +5 -12
- package/examples/hello/knexfile.ts +0 -23
@@ -0,0 +1,20 @@
|
|
1
|
+
const { parseConfigFile } = require('@dbos-inc/dbos-sdk/dist/src/dbos-runtime/config');
|
2
|
+
const { DBOSConfig } = require('@dbos-inc/dbos-sdk/dist/src/dbos-executor');
|
3
|
+
|
4
|
+
const [dbosConfig, ] = parseConfigFile();
|
5
|
+
|
6
|
+
const config = {
|
7
|
+
client: 'pg',
|
8
|
+
connection: {
|
9
|
+
host: dbosConfig.poolConfig.host,
|
10
|
+
user: dbosConfig.poolConfig.user,
|
11
|
+
password: dbosConfig.poolConfig.password,
|
12
|
+
database: dbosConfig.poolConfig.database,
|
13
|
+
ssl: dbosConfig.poolConfig.ssl,
|
14
|
+
},
|
15
|
+
migrations: {
|
16
|
+
directory: './migrations'
|
17
|
+
}
|
18
|
+
};
|
19
|
+
|
20
|
+
module.exports = config;
|
@@ -1,12 +1,12 @@
|
|
1
|
-
|
1
|
+
const { Knex } = require("knex");
|
2
2
|
|
3
|
-
|
3
|
+
exports.up = async function(knex) {
|
4
4
|
return knex.schema.createTable('dbos_hello', table => {
|
5
5
|
table.text('name').primary();
|
6
6
|
table.integer('greet_count').defaultTo(0);
|
7
7
|
});
|
8
|
-
}
|
8
|
+
};
|
9
9
|
|
10
|
-
|
10
|
+
exports.down = async function(knex) {
|
11
11
|
return knex.schema.dropTable('dbos_hello');
|
12
|
-
}
|
12
|
+
};
|