Installation
The Go bindings use CGO to link against a pre-built static library. Your final binary is fully self-contained with no external dependencies.1
Get the package
2
Download the native library
.a file) for your platform from GitHub releases and caches it in lib/<platform>/.3
Build your application
Benefits:
- Single self-contained binary
- No external library files needed
- Perfect for production deployment
- Works in Docker containers, cloud functions, etc.
- No Rust compiler needed
Quick start
API reference
Database
Opening databases
Configuration
Database info
Transaction
Creating transactions
- Manual transaction
- Auto-retry transaction
CRUD operations
Transaction control
Collection management
Collection
For non-transactional operations with auto-commit:Basic CRUD
Querying
Bulk operations
Advanced operations
Indexing
Schema validation
Maintenance
Error handling
error interface:
Requirements
- CGO enabled (default on most systems)
- Internet connection on first build (to download native library)
- C compiler:
- macOS:
xcode-select --install - Linux:
apt install build-essentialoryum install gcc - Windows: Install MinGW-w64
- macOS:
Platform support
- macOS: ARM64 (Apple Silicon) and x64 (Intel)
- Linux: ARM64 and x64
- Windows: x64
Windows ARM64 is not currently supported.
Troubleshooting
Library download fails
- Ensure you have internet connectivity
- Check that the GitHub release exists with the required files
- Verify your platform is supported
Build fails with CGO errors
Make sure you have a C compiler installed for your platform.Static linking fails
- Make sure you ran
go generatefirst - Check that the
.afile exists:ls bindings/go/lib/*/ - Verify you have system dependencies installed