Lighter-swift / Lighter

Swift APIs for SQLite: Type-safe down to the schema. Very, very, fast. Dependency free.
https://lighter-swift.github.io/documentation/lighter/
MIT License
459 stars 12 forks source link

AST generation fails when a column has over 183 columns #17

Open helje5 opened 1 year ago

helje5 commented 1 year ago

For example the CoreData database of the Apple Notes application has a table called ZICCLOUDSYNCINGOBJECT, which has 184 properties.

Generation for this eventually crashes due to the recursion done in:

  func generateBindStatementForProperty(
         _ property : EntityInfo.Property,
         index      : Expression,
         trailer    : () -> [ Statement ] = { [] }
       ) -> ( Statement, didRecurse: Bool )

Probably need to flatten that. Maybe not do recursive binds for tables with that many columns at all.