mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-03 06:28:53 +00:00
refactor: Split files into src folder, fix parser
This commit is contained in:
8 files changed
+244
-222
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { ConnectionStringParser } from 'connection-string-parser';
|
||||
|
||||
const connectionString = GetConvar('mysql_connection_string', '');
|
||||
|
||||
if (connectionString === '') throw new Error(`Set up mysql_connection_string in server.cfg`);
|
||||
|
||||
const config = new ConnectionStringParser({
|
||||
scheme: 'mysql',
|
||||
hosts: [],
|
||||
}).parse(connectionString);
|
||||
|
||||
if (Object.keys(config).length === 0)
|
||||
throw new Error(`Set up mysql_connection_string in correct format - 'mysql://user:password@host/database'`);
|
||||
|
||||
const slowQueryWarning = GetConvarInt('mysql_slow_query_warning', 100);
|
||||
const debug = GetConvar('mysql_debug', 'false') === 'true';
|
||||
|
||||
export { config, slowQueryWarning, debug };
|
||||
Reference in new issue
Block a user