Open wwaaijer-exh opened 2 years ago
Looking at pure character count, it might even be easier to export an Rql
helper for the rqlbuilder
.
// Internalize
find({ rql: q => q.eq('userId', userId) })
// V.s. helper
find({ rql: Rql.eq('userId', userId) })
Works nicer with sub-queries (like or
/contains
) as well?
// Internalize
find({ rql: (q) => q.contains('enlistment', subQ => subQ.or(
subQ => subQ.eq('active', true).eq('groupId', groupId)),
subQ => subQ.eq('active', false).eq('groupId', groupId2))
)})
// V.s. helper
find({ rql: Rql.contains('enlistment', Rql.or(
Rql.eq('active', true).eq('groupId', groupId),
Rql.eq('active', false).eq('groupId', groupId2)
)})
rqlBuilder
.rql
option. (to test)
Longer term thingy.
Some lose notes:
find({ rql: q => q.eq('userId', userId) })
contains
/and
/ .... rql operators:query.contains('enlistment', subQuery => subQuery.eq('active', true).eq('groupId', groupId))
interface { rql: string | (q:RqlBuider) => RqlBuider }