JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q44027F
  • License MIT

Shell scripting CLI for nopg

Package Exports

  • nopg
  • nopg/src/norUtils.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nopg) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

nor-nopg-cli

Shell scripting CLI for nor-nopg

Install

npm install -g nopg

Status

Not well tested, but should work.

Example

#!/bin/bash -x
set -e

tr="$(nopg start)"

function finish {
    test -n "$tr" && nopg $tr rollback
}
trap finish EXIT

nopg $tr search User
nopg $tr commit
tr=''

Transactions

Start a transaction:

tr = "$(nopg start)"

End a transaction successfully:

nopg $tr commit

Rollback a transaction:

nopg $tr rollback

List all User documents

nopg $tr search User

List all User documents by email

nopg $tr search User --where-email='demo@example.com'

Create a User document

nopg $tr create User --set-email='demo@example.com'

Update a User document

nopg $tr update User --where-email='demo@example.com' --set-email='demo2@example.com'

Delete a User document by email

nopg $tr delete User --where-email='demo@example.com'

Force shutdown

You shouldn't normally need to use this, since rollback or commit does it also.

nopg $tr exit

...or, since $tr is just a pid:

kill $tr