haxetink / tink_sql

SQL embedded into Haxe
MIT License
53 stars 16 forks source link

WIP tink.sql.Query #60

Closed benmerckx closed 6 years ago

benmerckx commented 6 years ago

I was implementing #58 and I'm a bit stuck right now on how to work out subqueries, so I might as well ask this way. Ideally we'd we able to do something like this:

db.Table1.where({col1: db.Table2.select({col2: Table2.col2})})

Since selects are a macro it's rather easy to keep track of the kind of selections (single column, multiple columns of same type, or something else). Use of subqueries should be more or less like this:

Edit: Hitting enter apparently submits the pull request, I'm still working on the description here :)

benmerckx commented 6 years ago

I'll come back to this later (wasn't really ready for a PR).