Skip to content

This repository contains code samples for getting started with Node.js and MariaDB.

License

Notifications You must be signed in to change notification settings

mariadb-developers/nodejs-quickstart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Quick Start: Node.js and MariaDB

This repository will walk you through the process of quickly getting started with Node.js and MariaDB using the MariaDB Node.js connector.

Requirements

You can easily run a MariaDB Server using Docker:

docker run --name mariadb --detach --publish 3306:3306 --env MARIADB_ROOT_PASSWORD='RootPassword123!' mariadb

Samples

JavaScript

The javascript folder provides simple examples using MariaDB Connector/Node.js with JavaScript.

Get Started with the Sample Scripts

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

... check additional scripts in the javascript/query/ directory ...

Helpful Resources

Support and Contribution

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:

License

License