mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-04 14:38:50 +00:00
refactor: enable JS exports for more recent artifacts
We still don't have a bump in recommended artifact, so for now check for the existence of new(ish) native.
This commit is contained in:
1 parent
3e266ec952
commit
dbe107e669
3 files changed
+6
-2
No files matched your search
@@ -28,6 +28,9 @@ CreateThread(function()
|
||||
end, 'GET')
|
||||
end)
|
||||
|
||||
-- Check for a recent native since the recommended artifact doesn't support JS async_retval or dependency constraints
|
||||
if not GetEntityAttachedTo then
|
||||
|
||||
---@param query string
|
||||
---@param parameters? table
|
||||
---@return integer result
|
||||
@@ -125,3 +128,4 @@ exports('prepareSync', function(query, parameters)
|
||||
end, GetInvokingResource())
|
||||
return Citizen.Await(p)
|
||||
end)
|
||||
end
|
||||
+1
-1
@@ -16,6 +16,6 @@ const isolationLevel = (() => {
|
||||
}
|
||||
})();
|
||||
|
||||
const resourceName = GetCurrentResourceName() || 'oxmysql';
|
||||
const resourceName = GetCurrentResourceName();
|
||||
|
||||
export { slowQueryWarning, debug, isolationLevel, resourceName };
|
||||
+1
-1
@@ -60,7 +60,7 @@ global.exports('prepare', (query, parameters, cb, resource = GetInvokingResource
|
||||
safeCallback(cb || parameters, result, resource, query))
|
||||
});
|
||||
|
||||
if (!GetResourceMetadata(GetCurrentResourceName(), 'server_script', 1)) {
|
||||
if (GetEntityAttachedTo || !GetResourceMetadata(GetCurrentResourceName(), 'server_script', 1)) {
|
||||
global.exports('prepareSync', async (query, parameters) => {
|
||||
const result = await preparedStatement(query, parameters, GetInvokingResource());
|
||||
return result;
|
||||
|
||||
Reference in new issue
Block a user