New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@evs-chris/ts-pg-dao

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@evs-chris/ts-pg-dao - npm Package Compare versions

Comparing version 0.7.1 to 0.7.2

2

package.json
{
"name": "@evs-chris/ts-pg-dao",
"version": "0.7.1",
"version": "0.7.2",
"main": "runtime/main.js",

@@ -5,0 +5,0 @@ "typings": "runtime/main.d.ts",

@@ -230,3 +230,3 @@ "use strict";

const params = [${model.fields.filter(f => f.pkey || f.optlock).map(f => `model.${f.name}`).join(', ')}];
const res = await con.query(\`delete from "${model.table}" where ${model.fields.filter(f => f.pkey || f.optlock).map((f, i) => `${f.optlock ? `date_trunc('millisecond', "${f.name}")` : `"${f.name}"`} = $${i + 1}`).join(' AND ')}\`, params);
const res = await con.query(\`delete from "${model.table}" where ${model.fields.filter(f => f.pkey || f.optlock).map((f, i) => `${f.optlock ? `$\{params[${i}] == null ? \`"${f.name}" is null\` : \`date_trunc('millisecond', "${f.name}")\`}` : `"${f.name}"`} = $${i + 1}`).join(' AND ')}\`, params);
if (res.rowCount < 1) throw new Error('No matching row to delete for ${model.name}');

@@ -240,2 +240,9 @@ if (res.rowCount > 1) throw new Error('Too many matching rows deleted for ${model.name}');

}
static async deleteById(con: dao.Connection, ${model.pkeys.map(k => `${k.alias || k.name}: ${k.retype || k.type}`).join(', ')}): Promise<boolean> {
const params = [${model.pkeys.map(k => k.alias || k.name).join(', ')}];
const res = await con.query(\`delete from "${model.table}" where ${model.pkeys.map((k, i) => `"${k.name}" = $${i + 1}`).join(' AND ')}\`, params);
if (res.rowCount !== 1) return false;
return true;
}

@@ -242,0 +249,0 @@ ${model.queries.find(q => q.name === 'findById') ? '' : `static async findById(con: dao.Connection, ${model.pkeys.map(k => `${k.alias || k.name}: ${k.retype || k.type}`).join(', ')}, optional: boolean = false): Promise<${model.name}> {

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