Skip to content

Reduce dependency footprint with feature-gated DuckDB and compression#52

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/reduce-dependency-footprint
Draft

Reduce dependency footprint with feature-gated DuckDB and compression#52
Copilot wants to merge 3 commits into
mainfrom
copilot/reduce-dependency-footprint

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

Description

This PR addresses the reported dependency bloat for consumers that only need SQL splitting/parsing. It introduces feature gates so heavy runtime/build dependencies are opt-in, while preserving current behavior for default builds.

Changes

  • Feature gating for heavy deps

    • Added Cargo features:
      • default = ["duckdb-query", "compression"]
      • duckdb-query (enables DuckDB + query command)
      • compression (enables gzip/bzip2/xz/zstd)
    • Marked duckdb, flate2, bzip2, xz2, zstd as optional.
  • Compile-time gating in code paths

    • Gated DuckDB module exports/imports and query command wiring behind duckdb-query.
    • Kept existing default CLI/library behavior unchanged by retaining both features in default.
  • Runtime behavior for no-compression builds

    • When compression is disabled, compressed extensions still detect as compressed but return a clear unsupported error instead of requiring codec deps.
  • Docs and focused test coverage

    • Added README section showing default-features = false and optional feature selection.
    • Updated splitter unit tests for feature-aware behavior (compression-enabled and compression-disabled cases).
[features]
default = ["duckdb-query", "compression"]
duckdb-query = ["dep:duckdb", "compression"]
compression = ["dep:flate2", "dep:bzip2", "dep:xz2", "dep:zstd"]

Checklist

  • Tests pass (cargo test)
  • Code is formatted (cargo fmt)
  • Linting passes (cargo clippy)
  • Documentation updated (if needed)

Related Issues

Copilot AI linked an issue May 12, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits May 12, 2026 10:48
Copilot AI changed the title [WIP] Refactor sql-splitter to minimize dependency footprint Reduce dependency footprint with feature-gated DuckDB and compression May 12, 2026
Copilot AI requested a review from HelgeSverre May 12, 2026 10:57
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.

Significant dependency footprint

2 participants