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

modli-postgres

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

modli-postgres - npm Package Compare versions

Comparing version 3.2.0 to 3.3.0

.idea/.name

2

package.json
{
"name": "modli-postgres",
"version": "3.2.0",
"version": "3.3.0",
"description": "Modli adapter for PostgreSQL",

@@ -5,0 +5,0 @@ "main": "src",

@@ -19,2 +19,6 @@ const { Pool } = require('pg')

getTable () {
return this.schemaName ? `"${this.schemaName}"."${this.tableName}"` : this.tableName
}
/**

@@ -52,3 +56,3 @@ * Runs query against instance conn

let i = 1
let query = `CREATE TABLE IF NOT EXISTS ${this.tableName} (`
let query = `CREATE TABLE IF NOT EXISTS ${this.getTable()} (`
for (let prop in props) {

@@ -83,3 +87,3 @@ let comma = (i !== len) ? ', ' : ''

}, [])
const query = `INSERT INTO ${this.tableName} (${cols.join(',')}) VALUES (${vals.join(',')})`
const query = `INSERT INTO ${this.getTable()} (${cols.join(',')}) VALUES (${vals.join(',')})`
return this.query(query)

@@ -100,3 +104,3 @@ .then(data => {

const where = query ? ` WHERE ${query}` : ''
return this.query(`SELECT * FROM ${this.tableName}${where}`)
return this.query(`SELECT * FROM ${this.getTable()}${where}`)
.then((results) => {

@@ -135,3 +139,3 @@ return results.rows.map((r) => {

}
return this.query(`UPDATE ${this.tableName} SET ${changes} WHERE ${query}`)
return this.query(`UPDATE ${this.getTable()} SET ${changes} WHERE ${query}`)
.then(data => {

@@ -150,3 +154,3 @@ if (data.rowCount) return res

delete (query) {
return this.query(`DELETE FROM ${this.tableName} WHERE ${query}`)
return this.query(`DELETE FROM ${this.getTable()} WHERE ${query}`)
}

@@ -153,0 +157,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