Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sqlite-tag-spawned

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sqlite-tag-spawned - npm Package Compare versions

Comparing version 0.3.2 to 0.4.0

30

cjs/index.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc