You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current problem is that unlike traditional JDBC, the postgres-async driver doesn't seem to return full namespace and prefix metadata for SQL query results. This makes it difficult to parse results such as product.guid vs stockorderitem.guid or to specify the parsers using prefix namespaces at all.
We need a way to define parsers under a namespace, just like anorm allows. Example:
implicitvalbusinessParser:PostgresRowParser[Business] =for {
id <- get[UUID]("business.guid")
urn <- get[UUID]("business.guid").map(BusinessURN.apply)
name <- get[String]("business.name")
} yieldBusiness(id, urn, name)
Using this parser to extract results from an SQL ResultSet should be equivalent to using a parser definition without a namespace:
implicitvalbusinessParser:PostgresRowParser[Business] =for {
id <- get[UUID]("guid")
urn <- get[UUID]("guid").map(BusinessURN.apply)
name <- get[String]("name")
} yieldBusiness(id, urn, name)
However, in the case of joins, the parser should rely on the defined metadata to distinguish columns with the same name that belong to different tables. A ResultSet in the case of join can contain columns from multiple tables, and parsers should be able to automatically make use of them.
The text was updated successfully, but these errors were encountered:
The current problem is that unlike traditional JDBC, the
postgres-async
driver doesn't seem to return full namespace and prefix metadata for SQL query results. This makes it difficult to parse results such asproduct.guid
vsstockorderitem.guid
or to specify the parsers using prefix namespaces at all.We need a way to define parsers under a namespace, just like anorm allows. Example:
Using this parser to extract results from an SQL ResultSet should be equivalent to using a parser definition without a namespace:
However, in the case of joins, the parser should rely on the defined metadata to distinguish columns with the same name that belong to different tables. A ResultSet in the case of join can contain columns from multiple tables, and parsers should be able to automatically make use of them.
The text was updated successfully, but these errors were encountered: