v0.7.0

Quick Start: REPL

Last updated


This page runs the bundled ToriiDB REPL and turns on vector commands with an OpenAI API key.

Run the REPL


  1. go run cmd/test/main.go
  2. # or
  3. make test

The REPL opens ./temp with store.New (not through the daemon):
  1. toriidb[0]> SET counter 1
  2. OK
  3. toriidb[0]> INCR counter
  4. 2
  5. toriidb[0]> SET user {"name":"Torii","profile":{"level":1}}
  6. OK
  7. toriidb[0]> GET user.profile.level
  8. 1
  9. toriidb[0]> SELECT 1
  10. OK
  11. toriidb[1]> KEYS *
  12. (empty list)

quit or exit ends the session. SIGINT and SIGTERM close the store before the process exits.

Enable Vector Operations


  1. export OPENAI_API_KEY="your-api-key"
  2. go run cmd/test/main.go

  1. SET article:1 Redis-style embedded storage VECTOR
  2. SET article:2 JSON document database VECTOR
  3. VSEARCH embedded vector search LIMIT 2
  4. VSIM article:1 article:2

The vector is attached in the background after SET returns, so a new entry becomes searchable shortly afterwards.

Build and Test


CommandAction
go build ./...Build all packages
go vet ./...Static analysis
make testRun the REPL
make unitgo test ./core/... -count=1 -cover
make embedRun the OpenAI embedding integration test

The Makefile includes and exports a local .env when present; the Go code itself never loads .env.

中文