yinrong / node-sqlx Goto Github PK
View Code? Open in Web Editor NEWmysql driver with extended features like database changelog/oplog, connection auto release.
License: MIT License
mysql driver with extended features like database changelog/oplog, connection auto release.
License: MIT License
we should forbid something like:
where: {
field1: '1 ) or 1 = 1 ('
}
Node 7.7+ support async/await, we may:
const client = sqlx.createClient({
promise: true,
...
})
...
let result = await conn.insert('table7', {a:1, b:2})
console.log(result.rows)
conn_timeout = conn.timeout(30 * 1000) // 30 seconds
conn_timeout.insert(...) // will timeout in 30 seconds
conn.insert(...) // will not timeout or inherit default config
keep sqlx API, support mongodb just like mysql
following README, we need:
async.waterfall([
(next) => {
conn.beginTransaction(next) // new interface
},
(next) => {
conn.insert('table7', {id: 100, data: 2}, next)
},
(rows, info, next) => {
console.log(rows, info)
conn.commit(next) // new interface
},
(next) => {
// (a)
console.log('success')
},
], err => {
console.log('fail')
})
The {id: 100, ...}
will not be inserted unless (a) is reached.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.