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

pino-postgres

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pino-postgres - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

16

index.js

@@ -12,7 +12,5 @@ #! /usr/bin/env node

class PinoTransform extends Transform {
constructor (schema, table, column, sql) {
constructor (opts, sql) {
super()
this.table = table
this.schema = schema
this.column = column
this.opts = opts
this.sql = sql

@@ -22,2 +20,3 @@ }

_transform (chunk, encoding, callback) {
const { schema, table, column, passThrough } = this.opts
const content = chunk.toString('utf-8')

@@ -28,7 +27,7 @@ let log = {}

} catch (err) {
return callback(null, `${chunk}\n`)
return callback(null, passThrough ? `${chunk}\n` : null)
}
this.sql`
INSERT INTO ${this.sql(this.schema)}.${this.sql(this.table)} (${this.sql(this.column)}) VALUES (${this.sql.json(log)})
INSERT INTO ${this.sql(schema)}.${this.sql(table)} (${this.sql(column)}) VALUES (${this.sql.json(log)})
ON CONFLICT DO NOTHING;

@@ -39,3 +38,3 @@ `

console.error('error in pino-postgres transform', err)
callback(null, `${chunk}\n`)
callback(null, passThrough ? `${chunk}\n` : null)
})

@@ -57,2 +56,3 @@ }

.option('--debug', 'debug postgres client', false)
.option('--pass-through', 'pass logs through', false)

@@ -78,3 +78,3 @@ const opts = program.parse(process.argv).opts()

const sql = postgres(opts.connection, postgresOpts)
const transport = new PinoTransform(opts.schema, opts.table, opts.column, sql)
const transport = new PinoTransform(opts, sql)
transport.on('end', sql.end)

@@ -81,0 +81,0 @@ pipeline(process.stdin, split(), transport, process.stdout, err => {

{
"name": "pino-postgres",
"version": "0.0.7",
"version": "0.0.8",
"description": "Pino transport for Postgres",

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

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