Skip to content

Commit a2e82a9

Browse files
committed
doc: schema and code comments in readme
1 parent bafa30b commit a2e82a9

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,12 @@ import (
273273
)
274274

275275
func main() {
276-
// Open the data.db file. It will be created if it doesn't exist.
276+
// Open or create the data.db file.
277277
db, err := redka.Open("data.db")
278278
if err != nil {
279279
log.Fatal(err)
280280
}
281+
// Always close the database when you are finished.
281282
defer db.Close()
282283
// ...
283284
}
@@ -347,10 +348,11 @@ rkey
347348
---
348349
id integer primary key
349350
key text not null
350-
type integer not null
351-
version integer not null
352-
etime integer
353-
mtime integer not null
351+
type integer not null -- 1 string, 2 list, 3 set, 4 hash
352+
-- 5 sorted set
353+
version integer not null -- incremented when the key value is updated
354+
etime integer -- expiration timestamp in unix milliseconds
355+
mtime integer not null -- modification timestamp in unix milliseconds
354356
355357
rstring
356358
---
@@ -373,7 +375,7 @@ select * from vstring;
373375
└────────┴──────┴───────┴────────┴───────┴─────────────────────┘
374376
```
375377

376-
Type in views is the Redis data type. Times are in UTC.
378+
`type` in views is the Redis data type. `etime` and `mtime` are in UTC.
377379

378380
## Performance
379381

0 commit comments

Comments
 (0)