Skip to content

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

Open
@jlvertol

Description

@jlvertol

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions