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

@saltcorn/db-common

Package Overview
Dependencies
Maintainers
2
Versions
310
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@saltcorn/db-common - npm Package Compare versions

Comparing version 0.9.6-beta.11 to 0.9.6-beta.12

5

dist/sqlite-commons.d.ts

@@ -12,3 +12,3 @@ /**

*/
export declare const reprAsJson: (v: any) => boolean;
export declare const reprAsJson: (v: any, jsonCol?: boolean) => boolean;
/**

@@ -20,3 +20,3 @@ * @param opts

*/
export declare const mkVal: ([k, v]: [string, any]) => Value;
export declare const mkVal: ([k, v]: [string, any], jsonCol?: boolean) => Value;
/**

@@ -41,2 +41,3 @@ * return type of buildInsertSql()

replace?: boolean;
jsonCols?: string[];
}) => SqlAndValues;

@@ -43,0 +44,0 @@ declare type SqlAndValuesBulk = {

13

dist/sqlite-commons.js

@@ -15,3 +15,4 @@ "use strict";

*/
const reprAsJson = (v) => typeof v === "object" && v !== null && !(v instanceof Date);
const reprAsJson = (v, jsonCol) => (jsonCol && (v === true || v === false)) ||
(typeof v === "object" && v !== null && !(v instanceof Date));
exports.reprAsJson = reprAsJson;

@@ -24,3 +25,3 @@ /**

*/
const mkVal = ([k, v]) => (0, exports.reprAsJson)(v) ? JSON.stringify(v) : v;
const mkVal = ([k, v], jsonCol) => (0, exports.reprAsJson)(v, jsonCol) ? JSON.stringify(v) : v;
exports.mkVal = mkVal;

@@ -40,3 +41,3 @@ /**

? `coalesce((select max(_version) from "${(0, internal_1.sqlsanitize)(tbl)}" where id=${+v.next_version_by_id}), 0)+1`
: (0, exports.reprAsJson)(v)
: (0, exports.reprAsJson)(v, opts.jsonCols?.includes(k))
? "json(?)"

@@ -47,3 +48,5 @@ : "?")

.filter(([k, v]) => !(v && v.next_version_by_id))
.map(exports.mkVal);
.map(([k, v]) => {
return (0, exports.mkVal)([k, v], opts.jsonCols?.includes(k));
});
const ignoreExisting = opts.ignoreExisting ? "or ignore" : "";

@@ -77,3 +80,3 @@ const replace = opts.replace ? "or replace" : "";

.filter(([k, v]) => !(v && v.next_version_by_id))
.map(exports.mkVal);
.map(([k, v]) => (0, exports.mkVal)([k, v]));
if (!fieldsWithRows[fnames])

@@ -80,0 +83,0 @@ fieldsWithRows[fnames] = {

{
"name": "@saltcorn/db-common",
"version": "0.9.6-beta.11",
"version": "0.9.6-beta.12",
"description": "Db common structures for Saltcorn, open-source no-code platform",

@@ -5,0 +5,0 @@ "homepage": "https://saltcorn.com",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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