https://github.com/coderivan/mysql-util
https://github.com/coderivan/mysql-util
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/coderivan/mysql-util
- Owner: CoderIvan
- Created: 2020-07-06T14:30:34.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-07T19:50:34.000Z (about 3 years ago)
- Last Synced: 2025-03-06T09:42:53.384Z (11 months ago)
- Language: JavaScript
- Size: 315 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mysql util


# Unit Test


# How To Use
```javascript
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()
```