@nina-protocol/nina-db 0.0.3 → 0.0.5

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/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
+ import "dotenv/config.js";
1
2
  import Knex from 'knex';
2
3
  import { Model } from 'objection';
3
4
  import Models from './models/index.js';
4
- import knexConfig from './utils/knexfile.js';
5
+ import knexConfig from './knexfile.js';
5
6
  export const initDb = async () => {
6
7
  const db = Knex(knexConfig.development);
7
8
  await db.raw(`SELECT 'CREATE DATABASE ${process.env.POSTGRES_DATABASE}'
package/dist/knexfile.js CHANGED
@@ -1,7 +1,7 @@
1
- // Update with your config settings.
2
1
  /**
3
2
  * @type { Object.<string, import("knex").Knex.Config> }
4
3
  */
4
+ import "dotenv/config.js";
5
5
  export default {
6
6
  development: {
7
7
  client: 'postgresql',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nina-protocol/nina-db",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/index.js",
package/src/index.js CHANGED
@@ -1,7 +1,8 @@
1
+ import "dotenv/config.js";
1
2
  import Knex from 'knex'
2
3
  import { Model } from 'objection'
3
4
  import Models from './models/index.js'
4
- import knexConfig from './utils/knexfile.js'
5
+ import knexConfig from './knexfile.js'
5
6
 
6
7
  export const initDb = async () => {
7
8
  const db = Knex(knexConfig.development)
package/src/knexfile.js CHANGED
@@ -1,8 +1,7 @@
1
- // Update with your config settings.
2
-
3
1
  /**
4
2
  * @type { Object.<string, import("knex").Knex.Config> }
5
3
  */
4
+ import "dotenv/config.js";
6
5
 
7
6
  export default {
8
7
 
@@ -15,7 +14,6 @@ export default {
15
14
  password: process.env.POSTGRES_PASSWORD,
16
15
  },
17
16
  },
18
-
19
17
  staging: {
20
18
  client: 'postgresql',
21
19
  connection: {
@@ -25,7 +23,6 @@ export default {
25
23
  password: process.env.POSTGRES_PASSWORD,
26
24
  },
27
25
  },
28
-
29
26
  production: {
30
27
  client: 'postgresql',
31
28
  connection: {
@@ -35,5 +32,4 @@ export default {
35
32
  password: process.env.POSTGRES_PASSWORD,
36
33
  },
37
34
  }
38
-
39
35
  };