You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of com.clickhouse.jdbc.ClickHouseDatabaseMetaData.getPrimaryKeys() in com.clickhouse:clickhouse-jdbc:0.6.0-patch4 just returns an empty ResultSet, though I think it would be relatively simple to implement this correctly.
For my own purposes, I run a query like this one:
selectsystem.tables.database,
system.tables.name,
(('KEY_'||system.tables.name) ||'_PRIMARY') constraint_name,
trim(c.1) column_name,
c.2 column_index
fromsystem.tables
array join arrayZip(splitByChar(',', primary_key), arrayEnumerate(splitByChar(',', primary_key))) as c
where (
system.tables.primary_key <>''andsystem.tables.database in ('default')
)
It generates a synthetic constraint name, because apparently the original name isn't stored in the catalog. Feel free to re-use this in some way in the driver.
The text was updated successfully, but these errors were encountered:
The current implementation of
com.clickhouse.jdbc.ClickHouseDatabaseMetaData.getPrimaryKeys()
incom.clickhouse:clickhouse-jdbc:0.6.0-patch4
just returns an emptyResultSet
, though I think it would be relatively simple to implement this correctly.For my own purposes, I run a query like this one:
It generates a synthetic constraint name, because apparently the original name isn't stored in the catalog. Feel free to re-use this in some way in the driver.
The text was updated successfully, but these errors were encountered: