This is a Fivetran partner-built destination connector for SurrealDB.
The connector enables Fivetran to write data to SurrealDB tables. It implements the Fivetran Destination Connector SDK using gRPC.
- Writes data to SurrealDB tables
- Supports batch operations
- Handles schema changes (Note though schema changes in SurrealDB are metadata-only)
- Provides data type mapping
The connector implements the following gRPC services as defined in destination_sdk.proto
:
ConfigureService
: Handles connector configuration and validationDestinationService
: Manages write operations to SurrealDB
The connector requires the following configuration:
{
"url": "ws://localhost:8000/rpc",
"user": "root",
"pass": "root",
"ns": "test"
}
The configuration is exposed via the connector's ConfigurationForm API and should be provided by the end user.
In near future, we will support token-based authentication, too.
- Go 1.22 or later (toolchain go1.24.1 or later)
- Protocol Buffers compiler (protoc)
- SurrealDB instance for testing
- Docker (for running conformance tests)
cd fivetran-destination
go build -o bin/connector
# Build the Docker image
docker build -t fivetran-surrealdb-connector .
# Run the container
docker run -p 50052:50052 fivetran-surrealdb-connector
The connector will be available on port 50052. Make sure your SurrealDB instance is accessible from the container.
go test ./...
The connector includes a comprehensive set of conformance tests that verify its behavior against Fivetran's requirements. See tests/README.md for detailed instructions on running these tests.
- Start the connector:
./bin/connector --port 50052
- Configure Fivetran to connect to your local instance (refer to Fivetran documentation)
The connector handles different types of write operations:
- Insert: Creates new records
- Update: Modifies existing records
- Delete: Removes records
- Upsert: Updates or inserts based on primary key
Automatic mapping between Fivetran and SurrealDB data types:
Fivetran Type | SurrealDB Type |
---|---|
STRING | string |
NUMBER | number |
BOOLEAN | bool |
TIMESTAMP | datetime |
See mapping.go for the full list of mappings.
- Implements transaction rollback on failures
- Provides detailed error reporting
- Handles network interruptions
- Supports retry mechanisms
- Uses batch processing
- Implements connection pooling
- Optimizes write patterns
- Supports parallel processing
The connector exposes metrics for monitoring:
- Write latency
- Records processed
- Error rates
- Batch sizes
- Transaction success/failure rates
Common issues and solutions:
-
Connection issues
- Verify SurrealDB credentials
- Check network connectivity
- Confirm firewall settings
-
Write failures
- Check table permissions
- Verify schema compatibility
- Review data type mappings
-
Performance issues
- Adjust batch size
- Monitor SurrealDB performance
- Check resource utilization
For technical issues:
- Check the troubleshooting guide
- Review Fivetran documentation
- Open a GitHub issue
- Contact Fivetran support for SDK-specific questions