@z-ivan/mysql-util

2.0.1 • Public • Published

mysql util

Node.js CI Node.js Package

Unit Test

image image

How To Use

const { mysql } = require('@z-ivan/mysql-util')

const pool = mysql.createPool({
	host: 'localhost',
	port: 3306,
	user: 'root',
	password: 'root',
	database: 'test',
})

// SELECT * FROM test
await pool.exec((squel) => squel.select().from('test').where('a = ?', 1))


// SELECT * FROM test WHERE (a = ?) LIMIT 10 OFFSET 10
// SELECT COUNT(*) AS "_count" FROM test WHERE (a = ?)
await pool.page((squel) => squel.select().from('test').where('a = ?', 1).limit(10).offset(10))

pool.end()

Readme

Keywords

none

Package Sidebar

Install

npm i @z-ivan/mysql-util

Weekly Downloads

15

Version

2.0.1

License

ISC

Unpacked Size

5.93 kB

Total Files

8

Last publish

Collaborators

  • z43811702