penberg / limbo

Limbo is a work-in-progress, in-process OLTP database management system, compatible with SQLite.
MIT License
960 stars 53 forks source link

core/translate: #154: implement WHERE IN (...) #236

Closed jussisaurio closed 1 month ago

jussisaurio commented 1 month ago

Fixes #154

Implemented for now using as a series of OR checks (foo IN (...)) or AND checks (foo NOT IN (...)). SQLite uses a similar approach for small lists of values and starts making ephemeral indexes for larger lists. For now we just always do SQLite's "small list" approach since we don't have all the plumbing for ephemeral indexes yet.

I also refactored translate_condition_expr to take a ConditionMetadata argument always containing explicit success/failure jump labels plus jump_on_success: bool, which at least to my dumb ass, made the code a bit clearer. Your mileage may vary.