Simple Integration,Multi-Language Support
Via C ABI header (talon.h) and talon_execute JSON universal entry point, one function call to access all engines. Go SDK ready, others in progress.
main.go
Go 1.21+
package main
import (
"fmt"
"log"
talon "github.com/darkmice/talon-sdk/go"
)
func main() {
db, err := talon.Open("./my_data")
if err != nil { log.Fatal(err) }
defer db.Close()
// SQL 引擎
db.RunSQL("CREATE TABLE users (id INT PRIMARY KEY, name TEXT, score REAL)")
db.RunSQL("INSERT INTO users VALUES (1, 'Alice', 95.5)")
// KV 引擎
db.KvSet([]byte("session:u1"), []byte("active"), 3600)
// talon_execute JSON 通用入口
result, _ := db.Execute(`{"module":"sql","action":"query",
"params":{"sql":"SELECT * FROM users LIMIT 10"}}`)
fmt.Println(result)
} terminal
Output / Console
$ go run main.go
[INFO] Talon opened: ./my_data
SQL: CREATE TABLE ok
SQL INSERT: 1 row affected
KV SET: session:u1 OK (TTL=3600s)
{"ok":true,"data":[[1,"Alice",95.5]]}
Process finished with exit code 0
speed
Unified JSON Entry
talon_execute — one function covers all engines. Input JSON command, get JSON result. No need to learn multiple APIs.
security
C ABI Zero-Dep
Link libtalon.so/dylib and go. Any language with C FFI support (Go/Python/Java/C#) can integrate directly.
hub
Embedded Zero-Overhead
In embedded mode, direct memory calls with no network round-trips or serialization. PK query latency <0.02ms.