oooooooooorrrrrrrmm-lib


License
BSD-3-Clause
Install
psc-package install oooooooooorrrrrrrmm-lib

Documentation

oooooooooorrrrrrrmm-lib

A smöl PureScript library for working with SQL generated by oooooooooorrrrrrrmm.

It currently consists of two functions, both of which are in the test.

  • toValues: converts a record to an array of values consumable by pg.
  • useMaybe: takes a pg return type with Nullable entires and converts them to Maybes.
vals :: Array Foreign
vals = toValues { "$1": 42, "$2": "hello" }

ret :: Array { id :: Int, name :: Maybe String }
ret = useMaybe [ { id: 42, name: notNull "hello" }, { id: 43, name: null } ]