Files
turso/bindings/go
Pekka Enberg e47240705c Merge 'bindings/go: Progress on Go driver, first working incremental state' from Preston Thorpe
This PR brings the Go database/sql driver to it's first working state
and adds a Go package to demonstrate.
The example pkg demonstrates (in it's most bare/naive form at this
point):
1. Open database (memory, in this case)
2. Create connection
3. Prepare statement (Create table)
4. `Exec`
5. Prepare statement (Insert, bind 3 arguments (int, string, blob) (
6. `Exec`
7. Prepare statement (Select *)
8. `Columns` -> print columns
9. `Query` -> print rows
10. Close db connection
![image](https://github.com/user-
attachments/assets/b59ec9f5-9ac6-4a59-9cad-fbb57893fbf8)
still tons of work to do but I at least wanted to get it to a state
where it's not totally broken.
I'll add some actual tests tomorrow

Closes #796
2025-01-29 13:10:52 +02:00
..
2025-01-26 20:58:10 +02:00

Limbo driver for Go's database/sql library

NOTE: this is currently heavily W.I.P and is not yet in a usable state. This is merged in only for the purposes of incremental progress and not because the existing code here proper. Expect many and frequent changes.

This uses the purego library to call C (in this case Rust with C ABI) functions from Go without the use of CGO.

To test

Linux | MacOS

All commands listed are relative to the bindings/go directory in the limbo repository

cargo build --package limbo-go


# Your LD_LIBRARY_PATH environment variable must include limbo's `target/debug` directory

LD_LIBRARY_PATH="../../target/debug:$LD_LIBRARY_PATH" go test

Windows

cargo build --package limbo-go

# Copy the lib_limbo_go.dll into the current working directory (bindings/go)
# Alternatively, you could add the .dll to a location in your PATH

cp ../../target/debug/lib_limbo_go.dll .

go test