Include some js samples

This commit is contained in:
Linden committed 2021-09-19 07:35:49 +10:00
1 parent 7ac73ccdb4
commit 93754a8efc
6 files changed
+60 -26

No files matched your search

+9 -5
View File
@@ -2,22 +2,26 @@
## Introduction
oxmysql is a database wrapper for FiveM utilising [node-mysql2](https://github.com/sidorares/node-mysql2) offering improved performance and security.
oxmysql is a database wrapper for FiveM utilising [node-mysql2](https://github.com/sidorares/node-mysql2) offering improved performance and security.
### Query cache
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
Every executed query is being prepared and stored into cache for faster performance when using prepared statements. These statements are also being sanitized from vulnerable SQL injection.
The following syntaxes are all supported.
```lua
'SELECT * FROM `users` WHERE `identifier` = ? AND `group` = ?', { playerIdentifier, playerGroup }
'SELECT * FROM `users` WHERE ?? = ? AND ?? = ?', {'identifier', playerIdentifier, 'group', playerGroup}
'SELECT * FROM `users` WHERE identifier = :identifier', {identifier=playerIdentifier}
'SELECT * FROM `users` WHERE identifier = @identifier', {['@identifier']=playerIdentifier}
```
### Installation
* Download `oxmysql.zip` from https://github.com/overextended/oxmysql/releases/latest
* Put `oxmysql` in the `resources` folder
* Configure in `server.cfg`
* Put `ensure oxmysql` before your resources
* Extract `oxmysql` to your resources folder
* Add `ensure oxmysql` before your resources in `server.cfg`
### Configuration