文件名称:prepare-sql:SQL模板字符串,防止SQL注入
文件大小:7KB
文件格式:ZIP
更新时间:2024-05-17 04:06:33
JavaScript
prepare-sql SQL模板字符串 用法 var SQL = require ( 'prepare-sql' ) const username = 'emilbayes' // Query with template string const select = SQL `SELECT * FROM users WHERE username = ${ username } ` const insertRows = [ 'mafintosh' , 'chm-diederichs' ] . map ( u => SQL `( ${ u } , ${ Date . now ( ) } )` ) // SQL.join can combine queries const insert = SQL `INSERT INTO users (username, create_at) VAL
【文件预览】:
prepare-sql-master
----example.js(805B)
----test.js(3KB)
----.travis.yml(2KB)
----LICENSE(766B)
----README.md(3KB)
----index.js(4KB)
----package.json(806B)