bitemyapp / bitemyapp/esqueleto

where constraint with a ValueList from an entity?

Open
#71 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
399
Forks
107
Avg merge
1d 17h
Merged PRs (30d)
1

Description

I have probably missed something simple, but I can't see how I can make a `where` constraint with a `ValueList` from an entity, like this:

E.where_ (E.val SomeValue `E.notIn` (someEntity E.^. SomeArray))

I would like to match `SomeValue` against a an array (`character varying[]`).

The compilation error looks like this (where `SomeValue` is of the type `ArrayValueType`):

Expected type: E.SqlExpr (E.ValueList ArrayValueType)
Actual type: E.SqlExpr (E.Value [ArrayValueType])

Any hints would be appreciated. :)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the `where_` expression and the reported `ValueList` versus `Value [ArrayValueType]` mismatch. Determine whether an entity array can be used in this constraint, then document or test the supported approach so the expression compiles.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.