@@ -21,6 +21,8 @@ itself a port of [xitdb](https://github.com/radarroark/xitdb), written in Zig.
21
21
22
22
` xitdb-clj ` provides atom-like semantics when working with the database from Clojure.
23
23
24
+ [ ![ Clojars Project] ( https://img.shields.io/clojars/v/io.github.codeboost/xitdb-clj.svg )] ( https://clojars.org/io.github.codeboost/xitdb-clj )
25
+
24
26
## Main characteristics
25
27
26
28
- Embeddable, tiny library.
@@ -34,7 +36,7 @@ itself a port of [xitdb](https://github.com/radarroark/xitdb), written in Zig.
34
36
35
37
## Architecture
36
38
37
- ` xitdb-clj ` builds on ` xitdb-java ` which implements:
39
+ ` xitdb-clj ` builds on [ xitdb-java] ( https://github.com/radarroark/xitdb-java ) which implements:
38
40
39
41
- ** Hash Array Mapped Trie (HAMT)** - For efficient map and set operations
40
42
- ** RRB Trees** - For vector operations with good concatenation performance
@@ -47,20 +49,23 @@ The Clojure wrapper adds:
47
49
- Thread-local read connections for scalability
48
50
- Integration with Clojure's sequence abstractions
49
51
50
- ## Why you always wanted this in your life
52
+ ## Quickstart
53
+
54
+ Add the dependency to your project, start a REPL.
51
55
52
56
### You already know how to use it!
53
57
54
- For the programmer, a ` xitdb ` database behaves exactly like a Clojure atom.
58
+ For the programmer, a ` xitdb ` database is like a Clojure atom.
55
59
` reset! ` or ` swap! ` to reset or update, ` deref ` or ` @ ` to read.
56
60
57
61
``` clojure
62
+ (require '[xitdb.db :as xdb])
58
63
(def db (xdb/xit-db " my-app.db" ))
59
64
; ; Use it like an atom
60
65
(reset! db {:users {" alice" {:name " Alice" :age 30 }
61
66
" bob" {:name " Bob" :age 25 }}})
62
67
; ; Read the entire database
63
- (common /materialize @db)
68
+ (xdb /materialize @db)
64
69
; ; => {:users {"alice" {:name "Alice", :age 30}, "bob" {:name "Bob", :age 25}}}
65
70
66
71
(get-in @db [:users " alice" :age ])
@@ -168,15 +173,6 @@ values of the database, by setting the `*return-history?*` binding to `true`.
168
173
- ** File-based** - Data persisted to disk with crash recovery
169
174
- ** In-memory** - Fast temporary storage for testing or caching
170
175
171
-
172
- ## Installation
173
-
174
- Add to your ` deps.edn ` :
175
-
176
- ``` clojure
177
- {:deps {io.github.codeboost/xitdb-clj {:mvn/version " 0.1.0" }}}
178
- ```
179
-
180
176
## Examples
181
177
182
178
### User Management System
@@ -232,20 +228,7 @@ Add to your `deps.edn`:
232
228
- ** Memory Usage** : Minimal overhead with automatic deduplication of identical subtrees
233
229
- ** Concurrency** : Thread-safe with optimized read-write locks
234
230
235
- ## Testing
236
-
237
- Run the test suite:
238
-
239
- ``` bash
240
- clojure -M:test
241
- ```
242
-
243
-
244
- ## Contributing
245
-
246
- This project welcomes contributions. Please ensure all tests pass and follow the existing code style.
247
231
248
232
## License
249
233
250
- [ License information needed]
251
-
234
+ MIT
0 commit comments