update oxmysql js usage

and somewhat clean up transaction docs
This commit is contained in:
Linden committed 2022-07-12 15:21:32 +10:00
1 parent 1363afcd2a
commit 3d627ba762
8 files changed
+178 -81

No files matched your search

+6 -2
View File
@@ -26,13 +26,17 @@ print(firstname)
### Callback
```js
exports.oxmysql.scalar('SELECT firstname FROM users WHERE identifier = ?', [playerIdentifier], (firstname) => {
// alias: exports.oxmysql.scalar
MySQL.scalar('SELECT firstname FROM users WHERE identifier = ?', [playerIdentifier], (firstname) => {
console.log(firstname)
})
```
### Promise
```js
const firstname = await exports.oxmysql.scalar_async('SELECT firstname FROM users WHERE identifier = ?', [playerIdentifier])
// alias: exports.oxmysql.scalar_async
const firstname = await MySQL.scalar('SELECT firstname FROM users WHERE identifier = ?', [playerIdentifier])
console.log(firstname)
```