You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/reference/go.md
+152-1Lines changed: 152 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,4 +3,155 @@ title: TidesDB GO Reference
3
3
description: TidesDB GO FFI Library reference.
4
4
---
5
5
6
-
Coming soon.
6
+
> You must make sure you have the TidesDB shared C library installed on your system. Be sure to also compile with `TIDESDB_WITH_SANITIZER` and `TIDESDB_BUILD_TESTS` OFF.
7
+
8
+
## Installing
9
+
```go
10
+
go get github.com/tidesdb/tidesdb-go
11
+
```
12
+
13
+
## Usage
14
+
15
+
### Opening and closing
16
+
```go
17
+
db, err:= tidesdb_go.Open("/path/to/db") // will reopen the database if it already exists
18
+
if err != nil {
19
+
...
20
+
}
21
+
defer db.Close() // Closes TidesDB gracefully
22
+
```
23
+
24
+
### Creating and dropping a column family
25
+
Column families are used to store data in TidesDB. You can create a column family using the `CreateColumnFamily` method.
Compaction is done manually or in background incrementally.
140
+
141
+
Merging operations, pair and merge sstables, removing expired keys if TTL set and tombstoned data.
142
+
143
+
#### Manual
144
+
```go
145
+
err:= db.CompactSSTables("example_cf", 4) // 4 is the number of threads to use for compaction. Each thread will compact a pair of sstables.
146
+
if err != nil {
147
+
...
148
+
}
149
+
```
150
+
151
+
#### Background
152
+
```go
153
+
err:= db.StartIncrementalMerge("example_cf", 60, 1000) // merge a pair of sstables starting at oldest pair every 60 seconds only when we have a minimum of 1000 sstables
0 commit comments