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

Support for Array fields like uuid[] on Postgres #40

Open
jlvertol opened this issue Oct 14, 2024 · 1 comment
Open

Support for Array fields like uuid[] on Postgres #40

jlvertol opened this issue Oct 14, 2024 · 1 comment

Comments

@jlvertol
Copy link
Contributor

jlvertol commented Oct 14, 2024

Hi! As far as I could tell while using Scalasql with Postgres, SQL array columns are not supported.

I tried to add a property of type T[Seq[String]] to my table, but got this error:

[error] 109 |object Invoice extends Table[Invoice]:
[error]     |                                     ^
[error]     |No given instance of type scalasql.core.Queryable.Row[scalasql.core.Expr[Seq[String]], Seq[String]] was found.
[error]     |I found:
[error]     |
[error]     |    scalasql.core.Expr.ExprQueryable[scalasql.core.Expr, Seq[String]](
[error]     |      scalasql.core.TypeMapper.enumTypeFromDialectTypeMappers[T])
[error]     |
[error]     |But method enumTypeFromDialectTypeMappers in object TypeMapper does not match type scalasql.core.TypeMapper[Seq[String]].

Additionally, if I just try to use T[String] as a workaround, I get a different error when querying the table instead:

org.postgresql.util.PSQLException: ERROR: operator does not exist: uuid[] ~~ text
  Hint: No operator matches the given name and argument types. You might need to add explicit type casts.

Am I correct that we don't support these types?

If so, I'd like to try my hand at solving it, but first I want to make sure this is actually not supported and there's no workarounds (ḧence my question above)

@lihaoyi
Copy link
Member

lihaoyi commented Oct 20, 2024

Yes they're not supported right now, would love to have your help in adding support!

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