mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 06:28:54 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af75f140ac | ||
|
|
8f7fc7bee7 |
No files matched your search
@@ -6,6 +6,8 @@ Oxmysql is an alternative to the unmaintained mysql-async/ghmattimysql resources
|
||||
|
||||
As of v1.9.0 the preferred method of utilising oxmysql is via lib/MySQL, which can be loaded by adding `@oxmysql/lib/MySQL.lua` to your resource manifests. This resource should be 100% backwards compatible with mysql-async functionality on top of providing newer export wrappers and functionality.
|
||||
|
||||
Refer to [issue #77](https://github.com/overextended/oxmysql/issues/77) for information on replacing your queries from older versions of oxmysql or ghmattimysql.
|
||||
|
||||
### Features
|
||||
- Support for URI connection strings and semicolon separated values
|
||||
- Asynchronous queries utilising mysql2/promises connection pool
|
||||
@@ -62,4 +64,4 @@ instead of using
|
||||
<br><br><br><br><br>
|
||||
<hr>
|
||||
<p align='center'><a href='https://discord.io/overextended'>Discord</a></p>
|
||||
<hr>
|
||||
<hr>
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user