Skip to content

Commit 0b75c8b

Browse files
committed
added usage instructions and a new set of tests
1 parent abab207 commit 0b75c8b

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,36 @@
22

33
database version control (postgres for now)
44

5+
# purpose
6+
7+
verdb manages the execution of postgres DDL scripts. It expects to be executed
8+
in a directory containing list of sub-directories, each of which corresponds
9+
to a set of changes. The sub-directories must contain an 'up.sql' and a 'down.sql'
10+
script. (although these filename may be changed)
11+
12+
The list, and order of the changes, must be maintained in a control file. This file
13+
is simply an order list of sub-directories. The pointer will point to a single
14+
sub-directory name contained in this file.
15+
16+
verdb maintains a pointer to the last batch (directory) of ddl scripts that
17+
executed correctly.
18+
519
# example
620

721
```
822
verdb init database postgres batches
923
verdb status
1024
verdb up all
1125
```
26+
27+
# install
28+
29+
With [npm](https://npmjs.org) do:
30+
31+
```
32+
sudo npm install verdb -g
33+
```
34+
35+
# license
36+
37+
MIT

test/set.coffee

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env coffee
2+
test = require('tap').test
3+
set = require '../lib/set'
4+
5+
test "set", (t) ->
6+
7+
consol =
8+
log: (m) ->
9+
t.equal m, "pointer set to v"
10+
11+
set.inject consol
12+
13+
nconf =
14+
set: (k, v) ->
15+
t.equal k, 'pointer', 'pointer set'
16+
t.equal v, 'v', 'v set'
17+
18+
persist = (_nconf) ->
19+
t.equal _nconf, nconf, "persist called with correct nconf"
20+
21+
set.run nconf, ['pointer', 'v'], persist
22+
23+
t.end()

0 commit comments

Comments
 (0)