Skip to content

Implement getUDTs method#645

Open
Algebrazebra wants to merge 4 commits intoduckdb:mainfrom
Algebrazebra:implement-getUDTs-method
Open

Implement getUDTs method#645
Algebrazebra wants to merge 4 commits intoduckdb:mainfrom
Algebrazebra:implement-getUDTs-method

Conversation

@Algebrazebra
Copy link
Copy Markdown

@Algebrazebra Algebrazebra commented Apr 12, 2026

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.

@Algebrazebra
Copy link
Copy Markdown
Author

Ah I know what the problem is, I had x_index as myint before but renamed it to have the exact same examples as in the docs. Which changes the matches of the %m typeNamePattern. Then I ran the tests on the previous build artifact before creating the PR. I'll double-check locally, sorry for the noise/wasted runs.

staticlibs added a commit to staticlibs/duckdb-java that referenced this pull request Apr 12, 2026
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 added a commit that referenced this pull request Apr 12, 2026
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](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>
@Algebrazebra
Copy link
Copy Markdown
Author

My changes were back-ported by @staticlibs and made it into the v1.5.20 release.

This is why I am closing this PR.

@staticlibs
Copy link
Copy Markdown
Collaborator

@Algebrazebra

Sorry for the confusion, this PR is still useful for the main branch. Just I am waiting with merging it (and a few other PRs too) to have the updated engine sources to be integrated into main first. And the main branch in duckdb/duckdb CI has not run for some time. So I will open this to be integrated later when the main is updated.

@staticlibs staticlibs reopened this Apr 14, 2026
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.

2 participants