{"library":"machinepack-postgresql","title":"Machinepack PostgreSQL","description":"Structured Node.js bindings for connecting to and running queries against a PostgreSQL database. Version 4.0.2 is the latest stable release. It is part of the Sails.js ecosystem and implements the Waterline Driver Interface. Release cadence is irregular; primarily maintained for legacy Sails applications. Key differentiators: uses machine definitions for structured operations, integrates with Sails' Waterline ORM, wraps the `pg` driver. Unmaintained since 2017; prefer `pg` directly or newer Waterline adapters.","language":"javascript","status":"maintenance","last_verified":"Sat Apr 25","install":{"commands":["npm install machinepack-postgresql"],"cli":null},"imports":["import MPPostgresql from 'machinepack-postgresql'","var MPPostgresql = require('machinepack-postgresql');\nMPPostgresql.getConnection({...}).exec(...)","var MPPostgresql = require('machinepack-postgresql');\nMPPostgresql.sendQuery({...}).exec(...)"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"var MPPostgresql = require('machinepack-postgresql');\n\n// Get a connection\nMPPostgresql.getConnection({\n  host: 'localhost',\n  port: 5432,\n  user: 'postgres',\n  password: process.env.PGPASSWORD || '',\n  database: 'mydb'\n}).exec({\n  error: function(err) { console.log('Error:', err); },\n  success: function(connection) {\n    // Send a query\n    MPPostgresql.sendQuery({\n      connection: connection,\n      query: 'SELECT * FROM users LIMIT 1'\n    }).exec({\n      error: function(err) { console.log('Query error:', err); },\n      success: function(result) {\n        console.log('Result:', result);\n        MPPostgresql.releaseConnection({ connection: connection }).exec();\n      }\n    });\n  }\n});","lang":"javascript","description":"Connects to a PostgreSQL database, runs a SELECT query, and releases the connection using machinepack-postgresql's structured bindings.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}