Comments - JavaScript - mariasql for node.js
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
The current version is from 2008: https://www.npmjs.com/package/mariasql
Newest commits from 2008, pull requests and issues are ignored: https://github.com/mscdex/node-mariasql
I think that this page can be removed.
Sequelize version 5
npm install --save sequelize@next # will install v5-beta npm install --save mariadb
Then set `dialect: 'mariadb'`
The mariadb connector is much faster than MySQL2. I noticed the speed difference immediately on my platform.
https://github.com/MariaDB/mariadb-connector-nodejs
MariaDB provides benchmarks comparing the Connector with popular Node.js MySQL clients, including:
promise-mysql version 3.3.1 + mysql version 2.15.0 mysql2 version 1.5.3
promise-mysql : 1,366 ops/sec ±1.42% mysql2 : 1,469 ops/sec ±1.63% mariadb : 1,802 ops/sec ±1.19%
Here is what I recommend, use Sequelize and select the 'mysql' driver for connecting. Soon they will be integrating the 'mariadb' driver which will include the very latest optimized rendition. Sequelize is an absolute must due to security and structure. Do not go without using an ORM.
https://www.npmjs.com/package/sequelize
npm install sequelize yarn add sequelize
Since July 2018 the first alpha version of the MariaDB Connector/node.js exists, see https://mariadb.com/kb/en/library/about-mariadb-connector-nodejs/
Please note that the project does not seem to be maintained anymore, the last commit to the repo was in June 2016. I am not sure what a good alternative is at the moment.
Quite possibly, the alternative would be to use the mysql package which seems more stable and is still in active development: https://www.npmjs.com/package/mysql