├── .gitignore ├── src ├── ui │ ├── tailwind.css │ ├── fonts │ │ ├── fira-sans-v9-latin-700.woff │ │ ├── fira-sans-v9-latin-700.woff2 │ │ ├── fira-sans-v9-latin-italic.woff │ │ ├── fira-sans-v9-latin-italic.woff2 │ │ ├── fira-sans-v9-latin-regular.woff │ │ └── fira-sans-v9-latin-regular.woff2 │ └── Nui.vue ├── docs │ ├── .gitignore │ ├── content │ │ ├── configOptions │ │ │ ├── password.md │ │ │ ├── port.md │ │ │ ├── localAddress.md │ │ │ ├── user.md │ │ │ ├── database.md │ │ │ ├── localInfile.md │ │ │ ├── connectionLimit.md │ │ │ ├── stringifyObjects.md │ │ │ ├── socketPath.md │ │ │ ├── host.md │ │ │ ├── insecureAuth.md │ │ │ ├── connectTimeout.md │ │ │ ├── ssl.md │ │ │ ├── debug.md │ │ │ ├── supportBigNumbers.md │ │ │ ├── multipleStatements.md │ │ │ ├── trace.md │ │ │ ├── flags.md │ │ │ ├── queueLimit.md │ │ │ ├── timezone.md │ │ │ ├── charset.md │ │ │ ├── waitForConnections.md │ │ │ ├── acquireTimeout.md │ │ │ └── bigNumberStrings.md │ │ ├── pages │ │ │ ├── setup.md │ │ │ ├── setupDatabaseOptions.md │ │ │ ├── configurationAdditional.md │ │ │ ├── configurationOptions.md │ │ │ ├── gui&devTogglePrint.md │ │ │ ├── configuration.md │ │ │ ├── setupResource.md │ │ │ ├── gui&dev.md │ │ │ ├── transactions.md │ │ │ └── queries.md │ │ ├── serverVars │ │ │ ├── mysqlSlowQueryWarning.md │ │ │ ├── mysqlLogFileFormat.md │ │ │ ├── mysqlLogLevel.md │ │ │ └── mysqlDebug.md │ │ └── setup │ │ │ └── setupResource.md │ ├── src │ │ ├── assets │ │ │ └── img │ │ │ │ └── gui.webp │ │ ├── styles │ │ │ └── index.scss │ │ ├── pages │ │ │ ├── Gui.vue │ │ │ ├── Queries.vue │ │ │ ├── Config.vue │ │ │ └── Index.vue │ │ ├── main.js │ │ ├── layouts │ │ │ └── Default.vue │ │ └── components │ │ │ ├── Benchmark.vue │ │ │ └── ConfigFXServer.vue │ ├── package.json │ ├── gridsome.server.js │ └── gridsome.config.js ├── entry │ ├── nui.js │ └── server.ts ├── tsconfig.json ├── vue.config.js ├── tailwind.config.js ├── .eslintrc.js ├── template │ └── index.html ├── postcss.config.js ├── webpack.config.js └── package.json ├── ui ├── fonts │ ├── MaterialIcons-Regular.eot │ ├── MaterialIcons-Regular.ttf │ ├── MaterialIcons-Regular.woff │ ├── MaterialIcons-Regular.woff2 │ ├── fira-sans-v9-latin-700.woff │ ├── fira-sans-v9-latin-700.woff2 │ ├── fira-sans-v9-latin-italic.woff │ ├── fira-sans-v9-latin-italic.woff2 │ ├── fira-sans-v9-latin-regular.woff │ └── fira-sans-v9-latin-regular.woff2 ├── index.html └── css │ └── app.css ├── .gitmodules ├── .editorconfig ├── .circleci └── config.yml ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── fxmanifest.lua ├── LICENSE ├── README.md ├── example.lua ├── mysql-async-client.lua └── lib └── MySQL.lua /.gitignore: -------------------------------------------------------------------------------- 1 | src/node_modules 2 | src/package-lock.json 3 | dist 4 | 5 | .idea 6 | -------------------------------------------------------------------------------- /src/ui/tailwind.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | -------------------------------------------------------------------------------- /src/docs/.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | .cache 3 | .DS_Store 4 | src/.temp 5 | node_modules 6 | dist 7 | .env 8 | .env.* 9 | -------------------------------------------------------------------------------- /src/docs/content/configOptions/password.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 6 3 | name: 'password | pwd' 4 | --- 5 | The password of that MySQL user. -------------------------------------------------------------------------------- /src/docs/src/assets/img/gui.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/src/docs/src/assets/img/gui.webp -------------------------------------------------------------------------------- /src/docs/content/configOptions/port.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 2 3 | name: 'port' 4 | --- 5 | The port number to connect to. (Default: `3306`) -------------------------------------------------------------------------------- /ui/fonts/MaterialIcons-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/ui/fonts/MaterialIcons-Regular.eot -------------------------------------------------------------------------------- /ui/fonts/MaterialIcons-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/ui/fonts/MaterialIcons-Regular.ttf -------------------------------------------------------------------------------- /ui/fonts/MaterialIcons-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/ui/fonts/MaterialIcons-Regular.woff -------------------------------------------------------------------------------- /ui/fonts/MaterialIcons-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/ui/fonts/MaterialIcons-Regular.woff2 -------------------------------------------------------------------------------- /ui/fonts/fira-sans-v9-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/ui/fonts/fira-sans-v9-latin-700.woff -------------------------------------------------------------------------------- /ui/fonts/fira-sans-v9-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/ui/fonts/fira-sans-v9-latin-700.woff2 -------------------------------------------------------------------------------- /src/ui/fonts/fira-sans-v9-latin-700.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/src/ui/fonts/fira-sans-v9-latin-700.woff -------------------------------------------------------------------------------- /ui/fonts/fira-sans-v9-latin-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/ui/fonts/fira-sans-v9-latin-italic.woff -------------------------------------------------------------------------------- /ui/fonts/fira-sans-v9-latin-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/ui/fonts/fira-sans-v9-latin-italic.woff2 -------------------------------------------------------------------------------- /ui/fonts/fira-sans-v9-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/ui/fonts/fira-sans-v9-latin-regular.woff -------------------------------------------------------------------------------- /src/ui/fonts/fira-sans-v9-latin-700.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/src/ui/fonts/fira-sans-v9-latin-700.woff2 -------------------------------------------------------------------------------- /ui/fonts/fira-sans-v9-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/ui/fonts/fira-sans-v9-latin-regular.woff2 -------------------------------------------------------------------------------- /src/docs/content/pages/setup.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 11 3 | --- 4 | ## Setup 5 | 6 | To Install mysql-async your first need to have installed a MySQL Database. -------------------------------------------------------------------------------- /src/ui/fonts/fira-sans-v9-latin-italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/src/ui/fonts/fira-sans-v9-latin-italic.woff -------------------------------------------------------------------------------- /src/ui/fonts/fira-sans-v9-latin-italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/src/ui/fonts/fira-sans-v9-latin-italic.woff2 -------------------------------------------------------------------------------- /src/ui/fonts/fira-sans-v9-latin-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/src/ui/fonts/fira-sans-v9-latin-regular.woff -------------------------------------------------------------------------------- /src/ui/fonts/fira-sans-v9-latin-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brouznouf/fivem-mysql-async/HEAD/src/ui/fonts/fira-sans-v9-latin-regular.woff2 -------------------------------------------------------------------------------- /src/docs/content/configOptions/localAddress.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 3 3 | name: 'localAddress' 4 | --- 5 | The source IP address to use for TCP connection. (Optional) -------------------------------------------------------------------------------- /src/docs/content/configOptions/user.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 5 3 | name: 'user | user id | userid | user name | username | uid' 4 | --- 5 | The MySQL user to authenticate as. -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "src/vendor/ghmattimysql"] 2 | path = src/vendor/ghmattimysql 3 | url = https://github.com/GHMatti/ghmattimysql.git 4 | branch = master 5 | -------------------------------------------------------------------------------- /src/docs/content/configOptions/database.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 7 3 | name: 'database | initial catalog' 4 | --- 5 | Name of the database to use for this connection (Optional). -------------------------------------------------------------------------------- /src/docs/content/configOptions/localInfile.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 17 3 | name: 'localInfile' 4 | --- 5 | Allow `LOAD DATA INFILE` to use the LOCAL modifier. (Default: `true`) -------------------------------------------------------------------------------- /src/docs/content/configOptions/connectionLimit.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 23 3 | name: 'connectionLimit' 4 | --- 5 | The maximum number of connections to create at once. (Default: `10`) -------------------------------------------------------------------------------- /src/docs/content/configOptions/stringifyObjects.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 11 3 | name: 'stringifyObjects' 4 | --- 5 | Stringify objects instead of converting to values. (Default: `false`) -------------------------------------------------------------------------------- /src/docs/content/configOptions/socketPath.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 4 3 | name: 'socketPath' 4 | --- 5 | The path to a unix domain socket to connect to. When used `host` and `port` are ignored. -------------------------------------------------------------------------------- /src/docs/content/configOptions/host.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 1 3 | name: 'host | server | data source | datasource | addr | address' 4 | --- 5 | The hostname of the database you are connecting to. (Default: `localhost`) -------------------------------------------------------------------------------- /src/docs/content/configOptions/insecureAuth.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 12 3 | name: 'insecureAuth' 4 | --- 5 | Allow connecting to MySQL instances that ask for the old (insecure) authentication method. (Default: `false`) -------------------------------------------------------------------------------- /src/docs/content/configOptions/connectTimeout.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 10 3 | name: 'connectTimeout' 4 | --- 5 | The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: `10000`) -------------------------------------------------------------------------------- /src/docs/content/configOptions/ssl.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 20 3 | name: 'ssl' 4 | --- 5 | Object with ssl parameters or a string containing name of ssl profile. See [SSL options](https://github.com/mysqljs/mysql#ssl-options). -------------------------------------------------------------------------------- /src/docs/content/configOptions/debug.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 15 3 | name: 'debug' 4 | --- 5 | Prints protocol details to stdout. Can be `true`/`false` or an array of packet type names that should be 6 | printed. (Default: `false`) -------------------------------------------------------------------------------- /src/docs/content/configOptions/supportBigNumbers.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 13 3 | name: 'supportBigNumbers' 4 | --- 5 | When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option (Default: `false`). -------------------------------------------------------------------------------- /src/docs/content/configOptions/multipleStatements.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 18 3 | name: 'multipleStatements' 4 | --- 5 | Allow multiple mysql statements per query. Be careful with this, it could increase the scope of SQL injection attacks. (Default: `false`) -------------------------------------------------------------------------------- /src/docs/content/configOptions/trace.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 16 3 | name: 'trace' 4 | --- 5 | Generates stack traces on `Error` to include call site of library entrance ("long stack traces"). 6 | Slight performance penalty for most calls. (Default: `true`) -------------------------------------------------------------------------------- /src/docs/content/pages/setupDatabaseOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 14 3 | --- 4 | 5 | #### Database Options 6 | 7 | Included in the table are the benchmark results of 1,000,000 inserts, with 20 done per server tick, that should mean it is about 100 inserts per second. 8 | -------------------------------------------------------------------------------- /src/docs/content/pages/configurationAdditional.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 25 3 | --- 4 | #### Additional Configuration Options 5 | 6 | These additional configuration are to be set in the server configuration file, in a similar way to 7 | setting the `mysql_connection_string`. 8 | -------------------------------------------------------------------------------- /src/entry/nui.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import App from '../ui/Nui.vue'; 3 | import 'material-design-icons-iconfont/dist/material-design-icons.css'; 4 | 5 | Vue.config.productionTip = false; 6 | 7 | new Vue({ 8 | render: (h) => h(App), 9 | }).$mount('#app'); 10 | -------------------------------------------------------------------------------- /src/docs/content/serverVars/mysqlSlowQueryWarning.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 3 3 | name: 'mysql_slow_query_warning' 4 | --- 5 | Sets a limit in millisecondss, queries slower than this limit will be displayed with a warning at the specified location of 6 | `mysql_debug_output`, see above (Default: `100`) -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [**.js] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | max_line_length = null 11 | 12 | [**.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /src/docs/content/configOptions/flags.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 19 3 | name: 'flags' 4 | --- 5 | List of connection flags to use other than the default ones. It is also possible to blacklist default ones. 6 | For more information, check [Connection Flags](https://github.com/mysqljs/mysql#connection-flags). -------------------------------------------------------------------------------- /src/docs/content/configOptions/queueLimit.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 24 3 | name: 'queueLimit' 4 | --- 5 | The maximum number of connection requests the pool will queue before returning an error from `getConnection`. 6 | If set to `0`, there is no limit to the number of queued connection requests. (Default: `0`) -------------------------------------------------------------------------------- /src/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2017", 4 | "module": "commonjs", 5 | "types": ["@citizenfx/client", "@citizenfx/server", "@types/node", "@types/mysql"], 6 | }, 7 | "include": [ 8 | "**/*" 9 | ], 10 | "exclude": [ 11 | "node_modules" 12 | ] 13 | } -------------------------------------------------------------------------------- /src/docs/content/configOptions/timezone.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 9 3 | name: 'timezone' 4 | --- 5 | The timezone configured on the MySQL server. This is used to type cast server date/time values to JavaScript Date object 6 | and vice versa. This can be `'local'`, `'Z'`, or an offset in the form `+HH:MM` or 7 | `-HH:MM.` (Default: `'local'`) -------------------------------------------------------------------------------- /src/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | publicPath: './', 3 | outputDir: '../ui', 4 | filenameHashing: false, 5 | productionSourceMap: false, 6 | chainWebpack: (config) => { 7 | config.optimization.delete('splitChunks'); 8 | config.externals({ 9 | moment: 'moment', 10 | }); 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /src/docs/content/configOptions/charset.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 8 3 | name: 'charset' 4 | --- 5 | The charset for the connection. This is called "collation" in the SQL-level of MySQL (like `utf8_general_ci`). 6 | If a SQL-level charset is specified (like `utf8mb4`) then the default collation for that charset is used. 7 | (Default: `'UTF8_GENERAL_CI'`) -------------------------------------------------------------------------------- /src/docs/content/pages/configurationOptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 23 3 | --- 4 | 5 | #### Configuration Options 6 | 7 | This is taken directly from the [mysql.js Readme file](https://github.com/mysqljs/mysql#connection-options), but trimmed to only applicable connection and pooling options, or changed a bit to accomodate legacy settings. 8 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2.1 2 | jobs: 3 | build-and-lint: 4 | docker: 5 | - image: circleci/node:latest 6 | steps: 7 | - checkout 8 | - run: cd src && npm install 9 | - run: cd src && npm run lint 10 | - run: cd src && npm run build 11 | workflows: 12 | build-and-lint: 13 | jobs: 14 | - build-and-lint 15 | -------------------------------------------------------------------------------- /src/docs/content/serverVars/mysqlLogFileFormat.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 11 3 | name: 'mysql_log_file_format' 4 | --- 5 | Sets the log file format, relative to the working directory of the server. If `mysql_debug` is not set to File or FileAndConsole, 6 | then this option is useless. `%s` is replaced with the name of the resource, `%d` is replaced by a timestamp. 7 | (Default: `%s-%d.log`) -------------------------------------------------------------------------------- /src/docs/content/configOptions/waitForConnections.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 22 3 | name: 'waitForConnections' 4 | --- 5 | Determines the pool's action when no connections are available and the limit has been reached. If `true`, 6 | the pool will queue the connection request and call it when one becomes available. If `false`, the pool 7 | will immediately call back with an error. (Default: `true`) -------------------------------------------------------------------------------- /src/docs/content/pages/gui&devTogglePrint.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 55 3 | --- 4 | 5 | #### Toggle Debug Print 6 | 7 | Given you have admin rights, you can use the command `mysql:debug` which flips interally the value 8 | for `mysql_debug` to `1` or `0`, so it enables you to turn on the debug prints 9 | to the console or a file, or both given your settings for `mysql_debug_output`. 10 | -------------------------------------------------------------------------------- /src/docs/content/serverVars/mysqlLogLevel.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: 10 3 | name: 'mysql_log_level' 4 | --- 5 | This variable gives control over what goes to the console, and what does not. Add the numbers to get the value to set it to. 6 | 1: Info, 2: Success, 4: Warning, 8: Error. For example you wanted only Info's and Error's appearing in the server console, you would set it to 9. 7 | (Default: `15`) -------------------------------------------------------------------------------- /src/tailwind.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | purge: false, 3 | theme: { 4 | fontFamily: { 5 | sans: ['Fira Sans', 'sans-serif'], 6 | }, 7 | extend: { 8 | backgroundOpacity: { 9 | 10: '0.1', 10 | }, 11 | margin: { 12 | '-2px': '-2px', 13 | }, 14 | }, 15 | }, 16 | variants: {}, 17 | plugins: [], 18 | }; 19 | -------------------------------------------------------------------------------- /ui/index.html: -------------------------------------------------------------------------------- 1 |
5 | General settings on how you want to configure your FXServer.
Be careful, if you go back to any previous step, nothing set on this page
6 | will be remembered.
7 |
server.cfg instead of the config.json
14 | This section contains the actual configuration of the server.
27 | 28 || Debug Information Controls where debug output should go. |
32 | |
| Slow Query Warning Sets a time in milliseconds after which a warning will be issued for a slow performing query. |
36 | |
| Log Level Controls what type of information should go to Console |
40 |
41 | |
46 |
| Log File Format Sets a format of the generated log file on server start. Can be used to log to a subdirectory. |
49 |
This are the options to configure the connection.
56 | 57 |Select options from this drop down you want to have configured.
58 |Fill in the values in this table below, or remove the options you do not want to use.
64 || {{ option.name }} | 68 |
69 | |
72 |
73 | |
75 |
server.cfg, at best above all other ensure lines.
81 | And then download and paste the config.json in the mysql-async folder with the one
85 | from the following link:
Congratulations, you have successfully setup mysql-async to work with the FiveM server.
97 |