How to use @mysql/xdevapi - 2 common examples

To help you get started, we’ve selected a few @mysql/xdevapi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github udaparts / socketpro / src / njadapter / perf_study / native_mysql.js View on Github external
var mysqlx = require('@mysql/xdevapi');
mysqlx.getSession({
    host: "10.16.50.19",
    user: "root",
    password: "Smash123"
}).then((session)=> {
	setInterval(()=>{
		var row;
		var stmt = 'SELECT * FROM sakila.actor WHERE actor_id between 11 and 12';
		var start = new Date();
		var count = 4000;
		for (var n = 0; n < count; ++n) {
			res = session.sql(stmt)
			.execute()
			.then((res)=>{
				while (row = res.fetchOne()) {
				}
			});
github udaparts / socketpro / stream_sql / mysql / DBPerf / nodejs / native_mysql.js View on Github external
var mysqlx = require('@mysql/xdevapi');
mysqlx.getSession({
    host: "10.16.50.19",
    user: "root",
    password: "Smash123"
}).then((session)=> {
	var row, res;
	var stmt = 'SELECT * FROM sakila.actor WHERE actor_id between 11 and 20';
	var start = new Date();
	var count = 100000;
	for (var n = 0; n < count; ++n) {
		res = session.sql(stmt)
		.execute()
		.then((res)=>{
			while (row = res.fetchOne()) {
			}
		});
	}

@mysql/xdevapi

MySQL Connector/Node.js - A Node.js driver for MySQL using the X Protocol and X DevAPI.

GPL-2.0
Latest version published 11 months ago

Package Health Score

61 / 100
Full package analysis

Popular @mysql/xdevapi functions