Compare commits
3 commits
dependabot
...
postgreSQL
Author | SHA1 | Date | |
---|---|---|---|
db6253cd04 | |||
secretspecter | 4846b22cd1 | ||
secretspecter | 0b806cec92 |
6
.editorconfig
Normal file
6
.editorconfig
Normal file
|
@ -0,0 +1,6 @@
|
|||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
indent_size = 4
|
||||
indent_style = space
|
7589
package-lock.json
generated
7589
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -26,8 +26,9 @@
|
|||
"knex": "^2.4.0",
|
||||
"lodash": "^4.17.21",
|
||||
"morgan": "^1.10.0",
|
||||
"mysql": "^2.18.1",
|
||||
"nodemailer": "^6.6.1",
|
||||
"pg": "^8.11.3",
|
||||
"pg-native": "^3.0.1",
|
||||
"prom-client": "^13.1.0",
|
||||
"proxy-addr": "^2.0.6",
|
||||
"pug": "^3.0.2",
|
||||
|
|
|
@ -11,7 +11,8 @@ import { CaptchaConfig } from './configuration/captchaconfig';
|
|||
const LOGGER = require('@calzoneman/jsli')('config');
|
||||
|
||||
var defaults = {
|
||||
mysql: {
|
||||
database: {
|
||||
client: "mysql",
|
||||
server: "localhost",
|
||||
port: 3306,
|
||||
database: "cytube3",
|
||||
|
|
|
@ -30,19 +30,19 @@ class Database {
|
|||
constructor(knexConfig = null) {
|
||||
if (knexConfig === null) {
|
||||
knexConfig = {
|
||||
client: 'mysql',
|
||||
client: Config.get('database.client'),
|
||||
connection: {
|
||||
host: Config.get('mysql.server'),
|
||||
port: Config.get('mysql.port'),
|
||||
user: Config.get('mysql.user'),
|
||||
password: Config.get('mysql.password'),
|
||||
database: Config.get('mysql.database'),
|
||||
host: Config.get('database.server'),
|
||||
port: Config.get('database.port'),
|
||||
user: Config.get('database.user'),
|
||||
password: Config.get('database.password'),
|
||||
database: Config.get('database.database'),
|
||||
multipleStatements: true, // Legacy thing
|
||||
charset: 'utf8mb4'
|
||||
},
|
||||
pool: {
|
||||
min: Config.get('mysql.pool-size'),
|
||||
max: Config.get('mysql.pool-size')
|
||||
min: Config.get('database.pool-size'),
|
||||
max: Config.get('database.pool-size')
|
||||
},
|
||||
debug: !!process.env.KNEX_DEBUG
|
||||
};
|
||||
|
@ -73,6 +73,8 @@ module.exports.init = function (newDB) {
|
|||
} else {
|
||||
db = new Database();
|
||||
}
|
||||
// FIXME Initial database connection failed: error: select 1 from dual
|
||||
// relation "dual" does not exist
|
||||
db.knex.raw('select 1 from dual')
|
||||
.catch(error => {
|
||||
LOGGER.error('Initial database connection failed: %s', error.stack);
|
||||
|
|
Loading…
Reference in a new issue