1.4.0 • Published 9 years ago

nopg v1.4.0

Weekly downloads
25
License
MIT
Repository
github
Last release
9 years ago

nor-nopg-cli

Shell scripting CLI for nor-nopg

Install

npm install -g nopg

Status

Not well tested, but should work.

Example

#!/bin/bash
set -e
tr=''
function finish {
	status="$?"
	test -n "$tr" && nopg -b -q $tr rollback
	exit "$status"
}
trap finish EXIT
tr="$(nopg -b -q start)"

nopg -b -q $tr search User
nopg -b -q $tr commit
tr=''
exit 0

Transactions

Start a transaction:

tr = "$(nopg -b -q 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
1.4.0

9 years ago

1.3.0

9 years ago

1.0.17

9 years ago

1.0.16

9 years ago

1.0.15

9 years ago

1.0.14

9 years ago

1.0.13

9 years ago

1.0.12

9 years ago

1.0.11

9 years ago

1.0.10

9 years ago

1.0.9

9 years ago

1.0.8

9 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.0

9 years ago