From 9c4eb9814d8484a87e908e399ce40192742ecef9 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Wed, 18 Aug 2021 14:13:59 +1000 Subject: [PATCH] Update index.md --- index.md | 82 +++----------------------------------------------------- 1 file changed, 4 insertions(+), 78 deletions(-) diff --git a/index.md b/index.md index 413e324..792384c 100644 --- a/index.md +++ b/index.md @@ -13,85 +13,11 @@ TODO Every executed query is being prepared and stored into cache for faster performance using prepared statements. These statements are also being sanitized from vulnerable SQL injection and accepts two types of parameters: ```lua -...'SELECT * FROM `users` WHERE `identifier` = ? AND `group` = ?', { playerIdentifier, playerGroup } ... +...'SELECT * FROM `users` WHERE `identifier` = ? AND `group` = ?', +{ playerIdentifier, playerGroup } ... ``` ```lua -...'SELECT * FROM `users` WHERE `identifier` = :id AND `group` = :group', { id = playerIdentifier, group = playerGroup } +...'SELECT * FROM `users` WHERE `identifier` = :id AND `group` = :group', +{ id = playerIdentifier, group = playerGroup } ``` - -## Usage - -### Execute - -Will execute query and returns count of affected rows. - -```lua -exports.oxmysql:execute(query, {}, function(affectedRows) - -end) -print('I will be printed before query result') - --- - -local affectedRows = exports.oxmysql:executeSync(query, {}) -print('I will be printed after query result') -``` - -### Insert - -Async wrapper - -```lua -exports.oxmysql:insert(query, {}, function(insertId) - -end) -print('I will be printed before query result') - --- - -local insertId = exports.oxmysql:insertSync(query, {}) -print('I will be printed after query result') -``` -### Fetch - -```lua -exports.oxmysql:fetch(query, {}, function(result) - -end) -print('I will be printed before query result') - --- - -local result = exports.oxmysql:executeSync(query, {}) -print('I will be printed after query result') -``` - -### Single - -```lua -exports.oxmysql:execute(query, {}, function(rowData) - -end) -print('I will be printed before query result') - --- - -local rowData = exports.oxmysql:executeSync(query, {}) -print('I will be printed after query result') -``` - -### Scalar - -```lua -exports.oxmysql:execute(query, {}, function(affectedRows) - -end) -print('I will be printed before query result') - --- - -local affectedRows = exports.oxmysql:executeSync(query, {}) -print('I will be printed after query result') -``` -