jhc-systems / sqlest

Write SQL in Scala
https://jhc-systems.github.io/sqlest/latest/api/
Apache License 2.0
30 stars 17 forks source link

Nice warning or error if a column is used in an extractor but the table is not included in the from() clause #42

Open nico78 opened 9 years ago

nico78 commented 9 years ago

Currently if a column is included in the where or select clause but the associated table is not included in the from() then sql is still produced referencing the column as if it had been included. Which can produce very cryptic error messages that are hard to track down the source of.

This is particularly likely if an extractor written for one query is reused for another similar query but with some tables omitted , say.

It would be good to have an error or warning that highlights if a column is being used without the associated table

DavidGregory084 commented 9 years ago

@brendanator, do you think we could potentially solve this with a solution like lihaoyi/scala.rx@4cb66a30f118736fd4c360f198876f89bc4a94d9? (The RxCtx that tracks the dependencies of the current code block)

I think potentially extractor.flatMap could be implemented with this pattern too?