feat: add cursor extension to get columns by name #110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Columns by name, implemented with partially forked SqlDelight drivers. Tested on iOS, but I have another branch that intends to add some core testing, to actually run the db calls within the core test suite. Can discuss the relative priority of that, though.
The SqlDelight driver code doesn't expose much that can be extended within the platform-specific implementations, so much of the code is copied over. Jdbc is an exception, which allowed for some extension and less code copy. However, the SqlDriver implementations look and act the same as the stock drivers to SqlDelight calls. That means the bulk of the internal driver code remains the same. The only real difference in the driver implementation is the cursor extension, which allow grabbing column names and indexes.
The driver code for SqlDelight rarely changes at this point, so forking the code is of minimal risk as far as maintenance is concerned. In addition, the only meaningful changes from a functional perspective are the extended cursors, so if the drivers were to have meaningful future changes, adopting those would be straightforward.