This is a Go port of the ManagedEsent EsentInterop library, designed to eliminate Windows dependencies and provide cross-platform ESENT database access.
This project is currently in beta/work-in-progress status. While the core functionality is implemented, including complete error code coverage, grbits, and native Windows ESENT bindings, there is still work to be done:
- Additional testing and validation needed for production use
- Cross-platform support is not yet implemented
- Performance optimization and benchmarking pending
- Documentation and examples need expansion
- Error handling needs further refinement
The library successfully provides a Go interface to ESENT with comprehensive type coverage and graceful fallback mechanisms, but should be considered beta quality until the above items are addressed. Production use should include thorough testing and validation.
- Basic project structure
- Core enums and types
- Complete error codes (JET_err) - 397 error codes implemented
- Complete grbits (flags and options)
- Core structures
- API interfaces
- Native API implementation with Windows ESENT bindings
- Tests
- Basic example
- Cross-platform support
types/
- Core ESENT types and enumsapi/
- API interfaces and implementationserrors/
- Error handling and codestests/
- Test filesexamples/
- Usage examples
package main
import (
"github.com/draper1/esent-go/api"
"github.com/draper1/esent-go/types"
)
func main() {
// Initialize ESENT
instance := api.NewInstance()
defer instance.Term()
// Create database
db, err := instance.CreateDatabase("test.db", types.CreateDatabaseGrbitNone)
if err != nil {
panic(err)
}
}
go mod tidy
go build ./...
go test ./...
go run ./examples/basic_usage.go
The current implementation provides:
- Core Types: All major ESENT data structures (JET_SESID, JET_DBID, JET_TABLEID, etc.)
- Error Codes: Complete set of 397 ESENT error codes with string representations
- Grbits: Comprehensive flag constants for all ESENT operations
- API Interface: Complete interface definition matching the C# API
- Native Implementation: Full Windows ESENT bindings with 41 native functions
- Tests: Comprehensive tests for all components
- Examples: Working examples demonstrating the API usage
The Windows implementation is complete with native ESENT bindings. Remaining work:
- Cross-platform: Research alternatives to ESENT for Linux/macOS
- Performance: Optimize for Go's memory model and concurrency
- Error Handling: Enhance error propagation and recovery
- Documentation: Create comprehensive API documentation
- This is a fully functional Windows implementation with native ESENT bindings
- All major ESENT operations are implemented and working
- The library maintains API compatibility with the original C# library
- Cross-platform support requires research into alternatives to ESENT