Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql: support enum types #61

Closed
zhaopuming opened this issue Feb 8, 2018 · 2 comments
Closed

postgresql: support enum types #61

zhaopuming opened this issue Feb 8, 2018 · 2 comments

Comments

@zhaopuming
Copy link

When I query database with enum columns, this exception throws:

ddbc.core.SQLException@/home/sdev/.dub/packages/ddbc-0.3.7/ddbc/source/ddbc/drivers/pgsqlddbc.d(562): Unsupported column type 16451

where 16451 is a custom defined enum type, with something like:

create type status as enum ('received', 'rejected', 'sent', 'accepted');

Can you add support for these enum types?

@zhaopuming
Copy link
Author

currently adding this hack in fillData() works for me:

if (t > 10000) { // assuming custom type id are bigger than 10000
    v[col] = s;
} else switch (t) {
    case INT4OID:
        v[col] = parse!int(s);
    // ....
}

But I also found that numeric type (NUMERICOID=1700) is also not supported, along with other types.
Do you consider adding a custom parser API for people to deal with these types?

@SingingBush
Copy link
Collaborator

buggins/hibernated#24

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

No branches or pull requests

2 participants