Skip to content
New issue

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

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

Already on GitHub? # to your account

Cannot get columns for sqlite with Literal column type #2330

Closed
MasterOdin opened this issue Dec 3, 2024 · 1 comment · Fixed by #2331
Closed

Cannot get columns for sqlite with Literal column type #2330

MasterOdin opened this issue Dec 3, 2024 · 1 comment · Fixed by #2331

Comments

@MasterOdin
Copy link
Member

That said, it's not clean to just assume that getPhinxType returns a string for key "name" and then pass that to parseDefaultValue in getColumns. This leads to a type error when "name" is a Literal. Instead, a meaningful exception should be thrown in that case that mentions the table name, column name, and given type (string). But that's another issue.

Originally posted by @InvisibleSmiley in #2319

@MasterOdin
Copy link
Member Author

An example of a statement to create a table that uses a literal:

CREATE TABLE `test` (`real_col` FOO)

This currently causes phinx to throw an exception when doing getColumns.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant