Ouiql
ORMless approach for working with SQL databases in Node, heavily inspired by yesql and this blog post
Currently this is an alpha-quality WIP!
Usage
Write your queries in SQL files, and then create a "store" object that reads them from the filesystem and converts them into JavaScript functions.
**In myproject/users/updateName.sql
:
UPDATE users SET name = :name WHERE id = :id;
**In myproject/users/store.js
const ouiql = const pool = 'pg'const backend = ouiql const userStore = ouiql // Now you can require userStore from elsewhere in your app and make a query like this:userStore // => Promise
Conventions
All query functions:
- return a Promise
- accept a single object parameter that contains named arguments
License
MIT