This repository will walk you through the process of quickly getting started with Node.js and MariaDB using the MariaDB Node.js connector.
- Node.js
- MariaDB - to get started with MariaDB check out this guide!
The javascript folder provides simple examples using MariaDB Connector/Node.js with JavaScript.
-
- connection.js - a simple example of connecting to a MariaDB database instance.
- connection_skysql.js - a simple example of how to connect to MariaDB SkySQL
-
Examples that utilize a shared database module to perform various SQL operations.
- Create a database and table - required before executing any other script
- Drop a database
- Insert records into a table
- Read records from a table
- Update a record in a table
- Delete a record from a table
- Bulk insert - uses the Connection object Batch function
- Bulk insert - uses the Connection Pool object Batch function
⚠️ Coming soon!
First, clone this repo.
$ git clone https://github.com/mariadb-developers/nodejs-quickstart.git
Next, from within the nodejs-quickstart
directory (that you just pulled down), install the MariaDB Node.js driver (connector) using npm.
$ npm install mariadb
Finally, to execute the sample JavaScript files using the node
CLI command.
Note: Be sure to update the connection configuration to point to your database in the JavaScript sample files. For example, here.
$ node javascript/connect/connection.js
$ node javascript/query/create.js
$ node javascript/query/insert.js
$ node javascript/query/select.js
...
Please feel free to submit PR's, issues or requests to this project directly.
If you have any other questions, comments, or looking for more information on MariaDB please check out:
Or reach out to us directly via: