postgres-fp
A wrapper around postgres in a functional programming style
Installation
npm install --save postgres-fp
Example
righto
Withconst righto = const connect = const execute = const getAll = const connection = const tableCreated = const testResults =
With promises
const postgres = ; { const connection = await postgres; await postgres; const results = await postgres; console;}
Functions signatures
connect -> filename -> [mode] -> (error, connection)
run -> connection -> sql -> [parameters] -> (error, result={lastId, changes})
insert -> connection -> tableName -> object -> (error, result={lastId, changes})
getAll -> connection -> sql -> (error, rows)
getOne -> connection -> sql -> (error, row)
batch (not implemented yet)
close -> connection -> (error)
License
This project is licensed under the terms of the MIT license.