mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 14:38:50 +00:00
setup docs
This commit is contained in:
1 parent
c4939b936e
commit
9827c766e5
1 file changed
+85
-24
@@ -1,37 +1,98 @@
|
||||
## Welcome to GitHub Pages
|
||||
# Documentation
|
||||
|
||||
You can use the [editor on GitHub](https://github.com/overextended/oxmysql/edit/gh-pages/index.md) to maintain and preview the content for your website in Markdown files.
|
||||
## Introduction
|
||||
|
||||
Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files.
|
||||
oxmysql is a database wrapper for FiveM utilising [node-mysql2](https://github.com/sidorares/node-mysql2) offering improved performance and security.
|
||||
|
||||
### Markdown
|
||||
### Comparison
|
||||
|
||||
Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for
|
||||
TODO
|
||||
|
||||
```markdown
|
||||
Syntax highlighted code block
|
||||
### Query cache
|
||||
|
||||
# Header 1
|
||||
## Header 2
|
||||
### Header 3
|
||||
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:
|
||||
|
||||
- Bulleted
|
||||
- List
|
||||
|
||||
1. Numbered
|
||||
2. List
|
||||
|
||||
**Bold** and _Italic_ and `Code` text
|
||||
|
||||
[Link](url) and 
|
||||
- Unnamed
|
||||
```lua
|
||||
... 'SELECT * FROM `users` WHERE `identifier` = ? AND `group` = ?', { playerIdentifier, playerGroup } ...
|
||||
```
|
||||
- Named
|
||||
```lua
|
||||
... 'SELECT * FROM `users` WHERE `identifier` = :id AND `group` = :group', { id = playerIdentifier, group = playerGroup } ...
|
||||
```
|
||||
|
||||
For more details see [GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/).
|
||||
## Usage
|
||||
|
||||
### Jekyll Themes
|
||||
### Execute
|
||||
|
||||
Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/overextended/oxmysql/settings/pages). The name of this theme is saved in the Jekyll `_config.yml` configuration file.
|
||||
Will execute query and returns count of affected rows.
|
||||
|
||||
### Support or Contact
|
||||
```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')
|
||||
```
|
||||
|
||||
Having trouble with Pages? Check out our [documentation](https://docs.github.com/categories/github-pages-basics/) or [contact support](https://support.github.com/contact) and we’ll help you sort it out.
|
||||
Reference in new issue
Block a user