Skip to content

Commit

Permalink
fix(config): Throw error when connection string not found
Browse files Browse the repository at this point in the history
  • Loading branch information
dunak-debug committed Jan 1, 2022
1 parent 8f7fc7b commit af75f14
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/server/db/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { createPool } from 'mysql2/promise';
import { mysql_connection_string, mysql_transaction_isolation_level, typeCast } from '../config.js';

const connectionString = (() => {
if (mysql_connection_string === '') throw new Error(`^1Missing mysql_connection_string in server.cfg! Refer to the documentation^0`);

if (mysql_connection_string.includes('mysql://')) return { uri: mysql_connection_string };

const options = mysql_connection_string
Expand Down

0 comments on commit af75f14

Please sign in to comment.