Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 64 lines (46 sloc) 1.49 kb
f5e25a2 @txus add readme
authored
1 # ShitDB
18b7253 @txus first commit
authored
2
f5e25a2 @txus add readme
authored
3 Shitty key-value store in C inspired by Redis.
18b7253 @txus first commit
authored
4
5 ## Usage
6
f5e25a2 @txus add readme
authored
7 $ make
e65c81a @txus Make port configurable via args
authored
8 $ bin/shitdb [port]
f5e25a2 @txus add readme
authored
9
10 Example session:
11
12 $ nc localhost 4999
13 SET foo "bar"
14 OK
15 GET foo
16 "bar"
17 SET bar 123
18 OK
19 GET bar
20 123
21 QUIT
22 Bye!
18b7253 @txus first commit
authored
23
ae322e9 @txus Add APUSH and APOP
authored
24 ## Basic types
25
26 * Integer: 2834
27 * String: "yuhuuuu"
28 * Array: [42,"foo",9999]
0365848 @txus Those are commands
authored
29 * Hashes: (no literal representation)
ae322e9 @txus Add APUSH and APOP
authored
30
0365848 @txus Those are commands
authored
31 ## Commands
ae322e9 @txus Add APUSH and APOP
authored
32
33 * GET [key]: Returns the content of a key.
34 * SET [key] [value]: Sets key to a value of any of the basic types.
592cacf @txus Fix some memory leaks, add a NOTFOUND error code, and add CLEAR and D…
authored
35 * DELETE [key]: Deletes a key.
36 * CLEAR: Clears all keys.
ae322e9 @txus Add APUSH and APOP
authored
37 * QUIT: Ends the connection.
38
0365848 @txus Those are commands
authored
39 ### Array commands
ae322e9 @txus Add APUSH and APOP
authored
40
41 * APUSH [key] [value]: Pushes value to the array located at key.
42 * APOP [key]: Pops the array located at key and returns the popped value.
421e125 @txus Implement AAT and expose ACOUNT to the server
authored
43 * AAT [key] [index]: Gets the array element at a certain index.
c2523a8 @txus Added ACOUNT to count array elements
authored
44 * ACOUNT [key]: Returns the number of elements in the array.
ae322e9 @txus Add APUSH and APOP
authored
45
0365848 @txus Those are commands
authored
46 ### Hash commands
a78b675 @txus Implement basic hash operations
authored
47
48 * HSET [key] [hashkey] [value]: Sets the hashkey in the Hash object in key to a value.
49 * HGET [key] [hashkey]: Gets the value of the hashkey in the Hash object in key.
50
18b7253 @txus first commit
authored
51 ## Contributing
52
53 1. Fork it
54 2. Create your feature branch (`git checkout -b my-new-feature`)
55 3. Commit your changes (`git commit -am 'Added some feature'`)
56 4. Push to the branch (`git push origin my-new-feature`)
57 5. Create new Pull Request
f5e25a2 @txus add readme
authored
58
59 ## Who's this
60
61 This was made by [Josep M. Bach (Txus)](http://txustice.me) under the MIT
62 license. I'm [@txustice](http://twitter.com/txustice) on twitter (where you
63 should probably follow me!).
Something went wrong with that request. Please try again.