@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.
@@ -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
- import { Knex } from "knex";
1
+ const { Knex } = require("knex");
2
2
 
3
- export async function up(knex: Knex): Promise<void> {
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
- export async function down(knex: Knex): Promise<void> {
10
+ exports.down = async function(knex) {
11
11
  return knex.schema.dropTable('dbos_hello');
12
- }
12
+ };