Skip to content

Conversation

@crishoj
Copy link

@crishoj crishoj commented Sep 11, 2025

In my project, Prisma is generating SQL queries where table names are prefixed with a schema name, e.g.:

SELECT `main`.`Plc`.`id`, `main`.`Plc`.`name`, `main`.`Plc`.`enabled`, `main`.`Plc`.`createdAt`, `main`.`Plc`.`updatedAt

This means that the regex in getTableFromQuery wouldn't match, and the adapter would fallback to non-declared types. (Which then would break handling of DATETIME columns, since these appear as numbers at run-time...)

I propose the change below, to also match qualified table names, and then using the form PRAGMA ${tableInfo.schema}.table_info(${tableInfo.table}) to get declared types.

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.

1 participant