mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 06:28:54 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abf259543d | ||
|
|
9d8a29388c | ||
|
|
00f9d0449c | ||
|
|
a46b586832 | ||
|
|
dc50fe6dbb | ||
|
|
a6d483ca48 | ||
|
|
b1babdbc09 | ||
|
|
f8f97344fd | ||
|
|
48ee030372 |
No files matched your search
+1
-1
@@ -3,7 +3,7 @@ game 'common'
|
||||
|
||||
name 'oxmysql'
|
||||
description 'Database wrapper for FiveM utilising node-mysql2 offering improved performance and security.'
|
||||
version '1.6.0'
|
||||
version '1.6.2'
|
||||
url 'https://github.com/overextended/oxmysql'
|
||||
author 'overextended'
|
||||
use_fxv2_oal 'yes'
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "oxmysql",
|
||||
"version": "1.6.0",
|
||||
"version": "1.6.2",
|
||||
"main": "oxmysql.js",
|
||||
"description": "node-mysql2 resource for Cfx",
|
||||
"repository": "[email protected]:overextended/oxmysql.git",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
diff --git a/node_modules/named-placeholders/index.js b/node_modules/named-placeholders/index.js
|
||||
index 527d723..e50595d 100644
|
||||
index 527d723..f63ce28 100644
|
||||
--- a/node_modules/named-placeholders/index.js
|
||||
+++ b/node_modules/named-placeholders/index.js
|
||||
@@ -3,7 +3,7 @@
|
||||
@@ -7,12 +7,21 @@ index 527d723..e50595d 100644
|
||||
// License: https://github.com/mscdex/node-mariasql/blob/master/LICENSE
|
||||
|
||||
-const RE_PARAM = /(?:\?)|(?::(\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g,
|
||||
+const RE_PARAM = /(?:\?)|(?:[:@](\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g,
|
||||
+const RE_PARAM = /(?:\?)|(?:(?<!["'])[:@](\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g,
|
||||
DQUOTE = 34,
|
||||
SQUOTE = 39,
|
||||
BSLASH = 92;
|
||||
@@ -96,13 +96,13 @@ function createCompiler(config) {
|
||||
@@ -94,15 +94,22 @@ function createCompiler(config) {
|
||||
if (typeof params == 'undefined')
|
||||
throw new Error('Named query contains placeholders, but parameters object is undefined');
|
||||
|
||||
+ for(const key in params) {
|
||||
+ if(key.charAt(0) === '@' || key.charAt(0) === ':') {
|
||||
+ params[key.substring(1)] = params[key];
|
||||
+ delete params[key];
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
const tokens = tree[1];
|
||||
for (let i=0; i < tokens.length; ++i) {
|
||||
- arr.push(params[tokens[i]]);
|
||||
@@ -27,7 +36,7 @@ index 527d723..e50595d 100644
|
||||
return s.slice(0, -1);
|
||||
}
|
||||
return s;
|
||||
@@ -115,7 +115,7 @@ function createCompiler(config) {
|
||||
@@ -115,7 +122,7 @@ function createCompiler(config) {
|
||||
|
||||
let unnamed = noTailingSemicolon(tree[0][0]);
|
||||
for (let i=1; i < tree[0].length; ++i) {
|
||||
@@ -36,7 +45,7 @@ index 527d723..e50595d 100644
|
||||
unnamed += config.placeholder;
|
||||
}
|
||||
unnamed += config.placeholder;
|
||||
@@ -124,7 +124,7 @@ function createCompiler(config) {
|
||||
@@ -124,7 +131,7 @@ function createCompiler(config) {
|
||||
|
||||
const last = tree[0][tree[0].length -1];
|
||||
if (tree[0].length == tree[1].length) {
|
||||
|
||||
+16
-1
@@ -1,4 +1,7 @@
|
||||
import { FormatError } from './errors';
|
||||
import * as createCompiler from 'named-placeholders';
|
||||
|
||||
const convertNamedPlaceholders = createCompiler();
|
||||
|
||||
const parseTypes = (field, next) => {
|
||||
//https://github.com/GHMatti/ghmattimysql/blob/37f1d2ae5c53f91782d168fe81fba80512d3c46d/packages/ghmattimysql/src/server/utility/typeCast.ts#L3
|
||||
@@ -27,7 +30,19 @@ const parseParameters = (query, parameters) => {
|
||||
|
||||
if (typeof parameters === 'function') return [query, []];
|
||||
|
||||
if (query.includes('@') || query.includes(':')) return [query, parameters];
|
||||
if (query.includes('@') || query.includes(':')) {
|
||||
const obj = parameters.length !== 0 ? parameters : (() => {
|
||||
let obj = {};
|
||||
const [_, paramNames] = convertNamedPlaceholders.parse(query);
|
||||
if (paramNames) {
|
||||
for (let i = 0; i < paramNames.length; i++)
|
||||
obj[paramNames[i]] = null;
|
||||
}
|
||||
return obj;
|
||||
})();
|
||||
|
||||
return [query, obj]
|
||||
};
|
||||
|
||||
const queryParams = query.match(/\?(?!\?)/g);
|
||||
|
||||
|
||||
@@ -60,9 +60,9 @@
|
||||
integrity sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==
|
||||
|
||||
"@types/node@*":
|
||||
version "16.11.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.0.tgz#4b95f2327bacd1ef8f08d8ceda193039c5d7f52e"
|
||||
integrity sha512-8MLkBIYQMuhRBQzGN9875bYsOhPnf/0rgXGo66S2FemHkhbn9qtsz9ywV1iCG+vbjigE4WUNVvw37Dx+L0qsPg==
|
||||
version "16.11.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.1.tgz#2e50a649a50fc403433a14f829eface1a3443e97"
|
||||
integrity sha512-PYGcJHL9mwl1Ek3PLiYgyEKtwTMmkMw4vbiyz/ps3pfdRYLVv+SN7qHVAImrjdAXxgluDEw6Ph4lyv+m9UpRmA==
|
||||
|
||||
"@webassemblyjs/[email protected]":
|
||||
version "1.11.1"
|
||||
@@ -291,9 +291,9 @@ buffer-from@^1.0.0:
|
||||
integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==
|
||||
|
||||
caniuse-lite@^1.0.30001265:
|
||||
version "1.0.30001267"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001267.tgz#b1cf2937175afc0570e4615fc2d2f9069fa0ed30"
|
||||
integrity sha512-r1mjTzAuJ9W8cPBGbbus8E0SKcUP7gn03R14Wk8FlAlqhH9hroy9nLqmpuXlfKEw/oILW+FGz47ipXV2O7x8lg==
|
||||
version "1.0.30001269"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001269.tgz#3a71bee03df627364418f9fd31adfc7aa1cc2d56"
|
||||
integrity sha512-UOy8okEVs48MyHYgV+RdW1Oiudl1H6KolybD6ZquD0VcrPSgj25omXO1S7rDydjpqaISCwA8Pyx+jUQKZwWO5w==
|
||||
|
||||
chalk@^2.4.2:
|
||||
version "2.4.2"
|
||||
@@ -880,8 +880,8 @@ minimist@^1.2.0:
|
||||
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
|
||||
|
||||
"mysql2@https://github.com/overextended/node-mysql2.git":
|
||||
version "2.3.0"
|
||||
resolved "https://github.com/overextended/node-mysql2.git#0bd156905d3093d33dddbde10adf1ca8ede18680"
|
||||
version "2.3.2"
|
||||
resolved "https://github.com/overextended/node-mysql2.git#60c66356b36d1dd194de6b1bc52d4216ee6f92d3"
|
||||
dependencies:
|
||||
denque "^2.0.1"
|
||||
generate-function "^2.3.1"
|
||||
|
||||
Reference in new issue
Block a user