Skip to content

Conversation

@wmTJc9IK0Q
Copy link
Contributor

This exposes the VARIANT type on the C API, allowing language drivers to add support for tables with variant columns (such as appending).

I primarily just added the enum and support on the duckdb_get_type_id function, but let me know if I am missing anything to make this useful.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds VARIANT type support to DuckDB's C API, enabling language drivers to interact with tables containing variant columns. The core changes include adding the VARIANT enum type and its conversion functions.

Key Changes

  • Added DUCKDB_TYPE_VARIANT enum value to the C API type system
  • Implemented type conversion functions for VARIANT in the helper module
  • Added comprehensive test coverage for VARIANT type operations
  • Applied code formatting changes to extension header files

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/include/duckdb/main/capi/header_generation/header_base.hpp.template Added DUCKDB_TYPE_VARIANT enum entry with documentation
src/include/duckdb.h Added DUCKDB_TYPE_VARIANT to the public API along with formatting changes
src/main/capi/helper-c.cpp Implemented bidirectional conversion between LogicalTypeId::VARIANT and DUCKDB_TYPE_VARIANT
test/api/capi/test_capi_variant.cpp Added comprehensive test coverage for VARIANT type including queries, prepared statements, and NULL handling
src/include/duckdb_extension.h Extensive formatting changes including whitespace normalization and macro consolidation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wmTJc9IK0Q wmTJc9IK0Q marked this pull request as ready for review December 16, 2025 04:41
@duckdb-draftbot duckdb-draftbot marked this pull request as draft December 16, 2025 05:04
@wmTJc9IK0Q wmTJc9IK0Q marked this pull request as ready for review December 16, 2025 05:08
@duckdb-draftbot duckdb-draftbot marked this pull request as draft December 16, 2025 19:41
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