mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 22:21:51 +00:00
refactor: remove typescript and refactor
This commit is contained in:
11 files changed
+283
-219
No files matched your search
+19
-2
@@ -1,5 +1,5 @@
|
||||
---
|
||||
-- Execute query and fetch all result
|
||||
-- Execute query and fetch affected rows
|
||||
--
|
||||
-- @param query tring
|
||||
-- @param parameters table
|
||||
@@ -15,6 +15,23 @@ local function executeSync(query, parameters)
|
||||
end
|
||||
exports('executeSync', executeSync)
|
||||
|
||||
---
|
||||
-- Execute query and fetch all result
|
||||
--
|
||||
-- @param query tring
|
||||
-- @param parameters table
|
||||
--
|
||||
-- @return table with result
|
||||
--
|
||||
local function fetchSync(query, parameters)
|
||||
local p = promise.new()
|
||||
exports['oxmysql']:fetch(query, parameters, function(result)
|
||||
p:resolve(result)
|
||||
end)
|
||||
return Citizen.Await(p)
|
||||
end
|
||||
exports('fetchSync', fetchSync)
|
||||
|
||||
---
|
||||
-- Execute query and fetch first row
|
||||
--
|
||||
@@ -50,7 +67,7 @@ end
|
||||
exports('scalarSync', scalarSync)
|
||||
|
||||
---
|
||||
-- Insert data and return table with inserted data
|
||||
-- Insert data and return inserted id
|
||||
--
|
||||
-- @param query tring
|
||||
-- @param parameters table
|
||||
|
||||
Reference in new issue
Block a user