Skip to content

[BUG (beta)]: RDS Data API pulling schema error #5308

@juxuanu

Description

@juxuanu

Report hasn't been filed before.

  • I have verified that the bug I'm about to report hasn't been filed before.

What version of drizzle-orm are you using?

1.0.0-beta.9-e89174b

What version of drizzle-kit are you using?

1.0.0-beta.9-e89174b

Other packages

No response

Describe the Bug

I tried drizzle-kit push --verbose. It seems it issues this SQL query:

SELECT
                        rolname,
                        rolsuper,
                        rolinherit,
                        rolcreaterole,
                        rolcreatedb,
                        rolcanlogin,
                        rolreplication,
                        rolconnlimit,
                        rolvaliduntil,
                        rolbypassrls
                FROM pg_catalog.pg_roles
                ORDER BY pg_catalog.lower(rolname);

but if you have drizzle.config.ts with driver: 'aws-data-api', the RDS Data API fails with InternalFailure: UnknownError. The same happens from within the AWS Console query editor.

Debugging this a bit, I noticed that if I cast rolname and rolvaliduntil to text, it works:

SELECT
                        rolname::text,
                        rolsuper,
                        rolinherit,
                        rolcreaterole,
                        rolcreatedb,
                        rolcanlogin,
                        rolreplication,
                        rolconnlimit,
                        rolvaliduntil::text,
                        rolbypassrls
                FROM pg_catalog.pg_roles
                ORDER BY pg_catalog.lower(rolname);

So, it seems it's a limitation of the RDS Data API, and it should be special cased when using it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions