Skip to content

Implement getUDTs method (1.5)#652

Merged
staticlibs merged 1 commit intoduckdb:v1.5-variegatafrom
staticlibs:udts_15
Apr 12, 2026
Merged

Implement getUDTs method (1.5)#652
staticlibs merged 1 commit intoduckdb:v1.5-variegatafrom
staticlibs:udts_15

Conversation

@staticlibs
Copy link
Copy Markdown
Collaborator

This is a backport of the PR #645 to v1.5-variegata stable branch.

I ran into the fact that the getUDTs method isn't implemented when writing a Slick extension for DuckDB.

This implementation uses a query against duckdb_types() and maps the DuckDB result columns to the column names required by the JDBC interface definition:

  • database_name -> TYPE_CAT
  • schema_name -> TYPE_SCHEM
  • type_name -> TYPE_NAME
  • comment -> REMARKS
  • CLASS_NAME returned as NULL

The types themselves are mapped to the base type when a scalar base type is available, but STRUCT and UNION don't have one so it maps to NULL.

This is a backport of the PR duckdb#645 to `v1.5-variegata` stable branch.

I ran into the fact that the getUDTs method isn't implemented when
writing a [Slick extension for DuckDB](https://github.com/Algebrazebra/slick-duckdb).

This implementation uses a query against `duckdb_types()` and maps
the DuckDB result columns to the column names required by the JDBC
interface definition:
- `database_name -> TYPE_CAT`
- `schema_name -> TYPE_SCHEM`
- `type_name -> TYPE_NAME`
- `comment -> REMARKS`
- `CLASS_NAME` returned as `NULL`

The types themselves are mapped to the base type when a scalar base
type is available, but `STRUCT` and `UNION` don't have one so it
maps to `NULL`.

Co-Authored-By: Algebrazebra <Algebrazebra@users.noreply.github.com>
@staticlibs staticlibs merged commit d475d1c into duckdb:v1.5-variegata Apr 12, 2026
@staticlibs staticlibs deleted the udts_15 branch April 12, 2026 22:00
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