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

@imatic/pgqb

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@imatic/pgqb - npm Package Compare versions

Comparing version 0.1.29 to 0.1.30

5

dist/qb.js

@@ -87,2 +87,5 @@ "use strict";

function columnList(columns) {
if (columns.length === 0) {
return '';
}
return wrapInParens(columns.map((v) => escape(v)).join(', '));

@@ -312,3 +315,3 @@ }

columns: (columns) => columnList(columns),
values: (list) => appendToStatement(sql_template_strings_1.SQL `VALUES `, intersperse(', ', list.map((row) => valueList(row)))),
values: (list) => list.length === 0 ? 'DEFAULT VALUES' : appendToStatement(sql_template_strings_1.SQL `VALUES `, intersperse(', ', list.map((row) => valueList(row)))),
on_conflict: (columns) => `ON CONFLICT ${columnList(columns)}`,

@@ -315,0 +318,0 @@ do_update: exprsHandler('DO UPDATE SET '),

2

package.json
{
"name": "@imatic/pgqb",
"version": "0.1.29",
"version": "0.1.30",
"description": "Functional PostgreSQL query builder",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

@@ -191,2 +191,6 @@ import {SQL, SQLStatement} from 'sql-template-strings';

function columnList(columns: string[]): string {
if (columns.length === 0) {
return '';
}
return wrapInParens(columns.map((v) => escape(v)).join(', '));

@@ -517,3 +521,3 @@ }

values: (list: Value[][]) =>
appendToStatement(
list.length === 0 ? 'DEFAULT VALUES' : appendToStatement(
SQL`VALUES `,

@@ -520,0 +524,0 @@ intersperse(

@@ -8,2 +8,15 @@ import {expect} from 'chai';

{
name: 'insert default values',
actual: h.merge(
h.insertInto('table_name'),
h.columns([]),
h.values([])
),
expected: {
insert_into: 'table_name',
columns: [],
values: []
},
},
{
name: 'insert_into',

@@ -10,0 +23,0 @@ actual: h.merge(

@@ -17,2 +17,14 @@ import {expect} from 'chai';

{
name: 'insert default values',
map: {
insert_into: 'table_name',
columns: [],
values: []
},
sql: {
text: 'INSERT INTO "table_name" DEFAULT VALUES',
values: []
}
},
{
name: 'insert_into',

@@ -19,0 +31,0 @@ map: {

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