Add support for user defined types

This commit is contained in:
fabianlindfors 2023-11-21 23:23:23 +01:00
parent 9512c80de9
commit b4baef2bc8

View File

@ -209,7 +209,7 @@ impl Schema {
let real_columns: Vec<(String, String, bool, Option<String>)> = db
.query(&format!(
"
SELECT column_name, data_type, is_nullable, column_default
SELECT column_name, CASE WHEN data_type = 'USER-DEFINED' THEN udt_name ELSE data_type END, is_nullable, column_default
FROM information_schema.columns
WHERE table_name = '{table}' AND table_schema = 'public'
ORDER BY ordinal_position