Skip to content

Conversation

@davidvasandani
Copy link

Summary

This PR adds SQLite as an additional destination option for the Zendesk connector and implements multi-destination support with configurable enabled/disabled flags for each destination.

Key Features

  • SQLite destination: Store records in a local SQLite database
  • 🔀 Multi-destination support: Write to Zendesk, SQLite, or both simultaneously
  • ⚙️ Flexible configuration: Choose destination type via destination.type config
  • Backward compatible: Default behavior remains unchanged (Zendesk only)
  • 🧪 Comprehensive tests: Full test coverage for all new functionality

Implementation Details

New Components

  1. SQLite Writer (sqlite/writer.go)

    • Implements the Writer interface for SQLite storage
    • Creates a configurable table with all OpenCDC record fields
    • Handles JSON marshaling of metadata and payloads
    • Supports INSERT OR REPLACE for upsert operations
  2. Multi-Destination Infrastructure

    • MultiDestination: Main destination that routes to appropriate writers
    • MultiWriter: Writes to multiple destinations in parallel
    • MultiConfig: Extended configuration for destination selection
  3. Configuration Options

    destination.type: zendesk|sqlite|multi  # Select destination type
    destination.zendesk.enabled: true/false  # Enable Zendesk (multi mode)
    destination.sqlite.enabled: true/false   # Enable SQLite (multi mode)
    destination.sqlite.dbPath: /path/to/db   # SQLite database path
    destination.sqlite.tableName: records    # Table name (default: records)

Usage Examples

Zendesk Only (Default, Backward Compatible)

destination.type: zendesk  # Optional, this is the default
zendesk.domain: yourcompany
zendesk.userName: user@example.com
zendesk.apiToken: your-token

SQLite Only

destination.type: sqlite
destination.sqlite.dbPath: /path/to/database.db
destination.sqlite.tableName: tickets

Both Destinations

destination.type: multi
destination.zendesk.enabled: true
destination.sqlite.enabled: true
zendesk.domain: yourcompany
zendesk.userName: user@example.com
zendesk.apiToken: your-token
destination.sqlite.dbPath: /path/to/database.db

Testing

  • ✅ All existing tests pass
  • ✅ New unit tests for SQLite writer
  • ✅ New unit tests for multi-destination configuration
  • ✅ New unit tests for multi-writer functionality
  • ✅ Linting passes with no issues

Breaking Changes

None. The default behavior remains unchanged - the connector will continue to write to Zendesk only unless explicitly configured otherwise.

Future Enhancements

  • Add support for custom SQL queries in SQLite destination
  • Add support for other database backends (PostgreSQL, MySQL)
  • Add destination-specific error handling strategies

🤖 Generated with Claude Code

- Add SQLite writer implementation for local database storage
- Implement multi-destination support with enabled/disabled flags
- Support writing to Zendesk, SQLite, or both simultaneously
- Add comprehensive configuration options for destination selection
- Include full test coverage for new functionality
- Maintain backward compatibility with existing Zendesk-only setup

The destination.type config now supports:
- "zendesk": Zendesk only (default, backward compatible)
- "sqlite": SQLite only
- "multi": Both destinations with individual enable flags

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@davidvasandani davidvasandani requested a review from a team as a code owner July 25, 2025 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant