Skip to content

chore: add pure-Go SQLite support via build tags for Windows compatibility #805

@tejasva-vardhan

Description

@tejasva-vardhan

Problem

Setting up Maglev on Windows currently requires a complex CGO toolchain (GCC/MinGW) because of the mattn/go-sqlite3 dependency. This creates a high barrier to entry for new contributors on Windows.

Proposed Solution

I propose adding a pure-Go SQLite driver (modernc.org/sqlite) as an alternative using Go build tags.

  • Create driver_cgo.go (with //go:build !windows || cgo tag).
  • Create driver_pure.go (with //go:build windows && !cgo tag).

This ensures that:

  1. Production/Linux builds remain unaffected (still using CGO).
  2. Windows developers can run go run ./cmd/api without any extra setup.

I have already verified this locally and would like to submit a PR if this approach aligns with the project goals.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions