Skip to content
This repository was archived by the owner on Jan 20, 2020. It is now read-only.

Commit 113fd04

Browse files
author
Luciano Nooijen
committed
Added knex debug mode
1 parent 42bb445 commit 113fd04

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ENABLE_SQREEN=false
88
SQREEN_TOKEN=token
99

1010
# Database
11+
KNEX_DEBUG=false
1112
DB_CLIENT=postgres
1213
DB_HOST=localhost
1314
DB_USER=root

knexfile-test.js

+5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ require('dotenv').config();
22

33
// eslint-disable-next-line
44
const {
5+
KNEX_DEBUG,
56
DB_CLIENT_TEST,
67
DB_HOST_TEST,
78
DB_USER_TEST,
89
DB_NAME_TEST,
910
DB_PASS_TEST,
1011
} = process.env;
1112

13+
const debug = KNEX_DEBUG === 'true';
14+
1215
module.exports = {
1316
client: DB_CLIENT_TEST,
1417
connection: {
@@ -24,4 +27,6 @@ module.exports = {
2427
migrations: {
2528
tableName: 'knex_migrations',
2629
},
30+
debug,
31+
asyncStackTraces: debug,
2732
};

knexfile.js

+5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ require('dotenv').config();
22

33
// eslint-disable-next-line
44
const {
5+
KNEX_DEBUG,
56
DB_CLIENT,
67
DB_HOST,
78
DB_USER,
89
DB_NAME,
910
DB_PASS,
1011
} = process.env;
1112

13+
const debug = KNEX_DEBUG === 'true';
14+
1215
module.exports = {
1316
client: DB_CLIENT,
1417
connection: {
@@ -24,4 +27,6 @@ module.exports = {
2427
migrations: {
2528
tableName: 'knex_migrations',
2629
},
30+
debug,
31+
asyncStackTraces: debug,
2732
};

0 commit comments

Comments
 (0)