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
• No instance for (IsCustomSqlSyntax
(Database.Beam.Backend.SQL.SQL92.Sql92SelectTableExpressionSyntax
(Database.Beam.Backend.SQL.SQL92.Sql92SelectSelectTableSyntax
(Database.Beam.Backend.SQL.SQL92.Sql92SelectSyntax
(Database.Beam.Backend.SQL.BeamSqlBackendSyntax ctxt)))))
arising from a use of ‘customExpr_’
• In the expression: customExpr_ myFuncImpl
In an equation for ‘instr_’:
instr_
= customExpr_ myFuncImpl
where
myFuncImpl :: (Monoid a, IsString a) => a -> a -> a
myFuncImpl str needle = "instr(" <> str <> ", " <> needle <> ")"
The page says:
Your backend's syntax must implement the IsSqlCustomExpressionSyntax type class.
I don't know what that means. How to implement this? Where's an example?
The text was updated successfully, but these errors were encountered:
The instance it's complaining about is just the constraint you need to add to the declaration of instr_. It's implemented by the backend (Postgres or SQLite).
The Haddocks definitely don't make this clear enough, and we should probably have an example of this in the markdown docs too.
Actually it turns out we do have an example in the docs, but it's in the context of a query with a concrete backend, so we don't demonstrate the necessary context for defining a custom combinator.
I read these both pages:
And have still no idea how to write a custom query. I followed the first page, which points to the non-existent page https://haskell-beam.github.io/beam/user-guide/extensibility/extensibility. Then I followed the second page and I end up getting errors:
The page says:
I don't know what that means. How to implement this? Where's an example?
The text was updated successfully, but these errors were encountered: