sqlite-tag-spawned
Advanced tools
Comparing version 0.3.2 to 0.4.0
@@ -19,3 +19,4 @@ 'use strict'; | ||
() => { | ||
if (errored) return; | ||
if (errored) | ||
return; | ||
const result = out.join('').trim(); | ||
@@ -52,16 +53,15 @@ if (type === 'query') | ||
*/ | ||
const sqlite = (type, bin, args, opts) => (..._) => | ||
new Promise((res, rej) => { | ||
let query = sql(rej, _); | ||
if (!query.length) | ||
return; | ||
if ( | ||
type === 'get' && | ||
/^SELECT\s+/i.test(query) && | ||
!/\s+LIMIT\s+\d+$/i.test(query) | ||
) { | ||
query += ' LIMIT 1'; | ||
} | ||
exec(res, rej, type, bin, args.concat(query), opts); | ||
}); | ||
const sqlite = (type, bin, args, opts) => (..._) => new Promise((res, rej) => { | ||
let query = sql(rej, _); | ||
if (!query.length) | ||
return; | ||
if ( | ||
type === 'get' && | ||
/^SELECT\s+/i.test(query) && | ||
!/\s+LIMIT\s+\d+$/i.test(query) | ||
) { | ||
query += ' LIMIT 1'; | ||
} | ||
exec(res, rej, type, bin, args.concat(query), opts); | ||
}); | ||
@@ -68,0 +68,0 @@ /** |
'use strict'; | ||
const plain = (m => /* c8 ignore start */ m.__esModule ? m.default : m /* c8 ignore stop */)(require('plain-tag')); | ||
const {asStatic, asParams} = require('static-params'); | ||
const {asStatic, asParams} = require('static-params/sql'); | ||
@@ -5,0 +5,0 @@ const error = (rej, reason) => { |
@@ -18,3 +18,4 @@ import {spawn} from 'child_process'; | ||
() => { | ||
if (errored) return; | ||
if (errored) | ||
return; | ||
const result = out.join('').trim(); | ||
@@ -51,16 +52,15 @@ if (type === 'query') | ||
*/ | ||
const sqlite = (type, bin, args, opts) => (..._) => | ||
new Promise((res, rej) => { | ||
let query = sql(rej, _); | ||
if (!query.length) | ||
return; | ||
if ( | ||
type === 'get' && | ||
/^SELECT\s+/i.test(query) && | ||
!/\s+LIMIT\s+\d+$/i.test(query) | ||
) { | ||
query += ' LIMIT 1'; | ||
} | ||
exec(res, rej, type, bin, args.concat(query), opts); | ||
}); | ||
const sqlite = (type, bin, args, opts) => (..._) => new Promise((res, rej) => { | ||
let query = sql(rej, _); | ||
if (!query.length) | ||
return; | ||
if ( | ||
type === 'get' && | ||
/^SELECT\s+/i.test(query) && | ||
!/\s+LIMIT\s+\d+$/i.test(query) | ||
) { | ||
query += ' LIMIT 1'; | ||
} | ||
exec(res, rej, type, bin, args.concat(query), opts); | ||
}); | ||
@@ -67,0 +67,0 @@ /** |
import plain from 'plain-tag'; | ||
import {asStatic, asParams} from 'static-params'; | ||
import {asStatic, asParams} from 'static-params/sql'; | ||
@@ -4,0 +4,0 @@ export const error = (rej, reason) => { |
{ | ||
"name": "sqlite-tag-spawned", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"description": "Same as sqlite-tag but without the native sqlite3 module dependency", | ||
@@ -39,3 +39,3 @@ "main": "./cjs/index.js", | ||
"plain-tag": "^0.1.3", | ||
"static-params": "^0.2.1" | ||
"static-params": "^0.3.0" | ||
}, | ||
@@ -42,0 +42,0 @@ "repository": { |
@@ -38,2 +38,6 @@ # sqlite-tag-spawned | ||
// [ { id: 1, name: 'Name0' }, { id: 2, name: 'Name1' } ] | ||
// use the IN clause through arrays | ||
const list = ['Name 0', 'Name 1']; | ||
await all`SELECT * FROM names WHERE name IN (${list})`; | ||
``` | ||
@@ -40,0 +44,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15299
50
+ Addedstatic-params@0.3.0(transitive)
- Removedstatic-params@0.2.1(transitive)
Updatedstatic-params@^0.3.0