https://github.com/oxplot/filedb
FileDB is a simple file-based database written in Go.
https://github.com/oxplot/filedb
Last synced: 2 months ago
JSON representation
FileDB is a simple file-based database written in Go.
- Host: GitHub
- URL: https://github.com/oxplot/filedb
- Owner: oxplot
- License: bsd-3-clause
- Created: 2023-10-25T01:26:44.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-03T12:51:34.000Z (11 months ago)
- Last Synced: 2025-03-24T01:48:26.041Z (8 months ago)
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# FileDB
FileDB is a simple file-based database written in Go. It provides basic CRUD operations on documents, which are stored as JSON files in a directory structure. The library also handles concurrent modifications and provides a simple key-based access to the documents.
## Installation
To use FileDB in your Go project, you can install it by running:
```bash
go get github.com/oxplot/filedb
```
## Usage
Here is a basic example of how to use FileDB:
```go
package main
import (
"fmt"
"github.com/yourusername/filedb"
)
func main() {
db, err := filedb.Open("/path/to/db")
if err != nil {
panic(err)
}
err = db.Set("key", "value")
if err != nil {
panic(err)
}
value, err := db.Get("key")
if err != nil {
panic(err)
}
fmt.Println(value) // Output: value
}
```