Querying #2
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Research
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No project
No assignees
1 participant
Notifications
Total time spent: 12 hours 31 minutes
Due date
c.fahner
12 hours 31 minutes
No due date set.
Blocks
#3 Data manipulation
slendium/ocd
#15 Database and collection access objects
slendium/ocd
Reference
slendium/ocd#2
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Most methods of the
Collectioninterface depend on being able to specify a filter.The following query operations seem to be supported by both MongoDB and SQL:
<, <=, >, >=)This would be a perfect use case for tagged unions, but sadly this RFC is still in draft.
Every operation will be implemented as an AST node. A
Predicatebase class will contain static "query builder" methods while a provided "visitor" interface can be used by implementors to cover all cases.Decided to remove the
Notoperand to limit the amount of expression objects generated. IntroducedNotEqual,NotExistsandNotOfTypeto cover the gap.Allowing users to build one predicate and then negate it does not really make sense when they could just construct the negated expression immediately. This saves object allocations at the declaration site and reduces the amount of objects to process on the database-implementation side.
Decided not to reject
NANorINFvalues during query building since it would add checks + branches for a rare edge case. Presumably SQL-based databases or their drivers will reject these cases already.Only MongoDB seems to allow these kinds of values so for compatibility they should be rejected at some point. The data model should just be forced to reserve a separate column that indicates these values if needed (eg. enum with finite, NaN and Infinite cases).