formatting and typos

This commit is contained in:
DokaDoka committed 2022-12-11 15:00:43 +11:00
1 parent 75698216e0
commit 724c7e356d
99 files changed
+515 -305

No files matched your search

+7 -3
View File
@@ -1,17 +1,18 @@
# Prepare
The only function that provides true [prepared statements](https://github.com/sidorares/node-mysql2#using-prepared-statements), granting native protection and query planning by MySQL.
Prepare can be used to execute frequently called queries faster and accepts multiple sets of parameters to be used with a single query.
The only function that provides true [prepared statements](https://github.com/sidorares/node-mysql2#using-prepared-statements), granting native protection and query planning by MySQL.
Prepare can be used to execute frequently called queries faster and accepts multiple sets of parameters to be used with a single query.
- Date will not return the datestring commonly used in FiveM
- TINYINT 1 and BIT will not return a boolean
- You can only use `?` value placeholders, `??` column placeholders and named placeholders will throw an error
- You can only use `?` value placeholders, `??` column placeholders and named placeholders will throw an error
When using SELECT, the return value will match `query, single, or scalar` depending on the number of columns and rows selected.
## Lua
### Callback
```lua
-- alias: exports.oxmysql:prepare
-- alias: MySQL.Async.prepare
@@ -24,6 +25,7 @@ end)
```
### Promise
```lua
-- alias: exports.oxmysql:prepare_async
-- alias: MySQL.Sync.prepare
@@ -37,6 +39,7 @@ end
## JavaScript
### Callback
```js
// alias: exports.oxmysql.prepare
@@ -48,6 +51,7 @@ MySQL.prepare('SELECT * FROM users WHERE identifier = ?', [playerIdentifier], (r
```
### Promise
```js
// alias: exports.oxmysql.prepare_async