stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.57k stars 1.54k forks source link

Add support for the WITH clause #1139

Closed marmphco closed 1 year ago

marmphco commented 1 year ago

Hello! I have been using SQLite.swift in one of my projects and so far it's been working great. Just one thing is missing that my project needs: the WITH clause. The WITH clause provides the ability to do hierarchical or recursive queries of tree and graph-like data. See https://www.sqlite.org/lang_with.html.

Thanks in advance for reviewing 🙂

API changes

Other

I left one linter warning unfixed: there's a file length violation in Query.swift. The file is 519 lines long, 19 over the limit. I'm not sure how to bring the line length back down below 500 without harming readability or moving a lot of stuff around (maybe you do?). Any suggestions on what to do here?

jberkel commented 1 year ago

@marmphco thanks for the PR. the simplest solution for the linter problem would be to start splitting Query into functional extensions, for example Query+with.swift.

marmphco commented 1 year ago

@jberkel Good point, I'll try that out.