Closed ShaishavGandhi closed 6 years ago
I think for the first argument we'll probably want to traverse the AST to try and find any string literal. This will allow parsing Collections.singleton("foo")
, Collections.singletonList("foo")
, Arrays.asList("foo", "bar")
, ImmutableList.of("foo", "bar")
, etc. We can just assume any literal inside the AST node for the first argument is a table name. Now this breaks if you do something crazy like "foo|bar".split("|")
but anyone doing such nonsense can suppress.
@jrodbx can you take a look? Ignore the formatting stuff I can fix that manually.
@JakeWharton Thanks. I can work on that and submit a separate PR if that's fine. Apologies for the 4 spaces instead of 2. I can update it if you want!
It's up to you. I don't mind reformatting it.
On Mon, Jan 29, 2018 at 6:49 PM Shaishav Gandhi notifications@github.com wrote:
@JakeWharton https://github.com/jakewharton Thanks. I can work on that and submit a separate PR if that's fine. Apologies for the 4 spaces instead of 2. I can update it if you want!
— You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/square/sqlbrite/pull/237#issuecomment-361327702, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEeQxXvQYlZLlcst65qW6IWKDUrL6ks5tPgSigaJpZM4Rd8UA .
Any update on this?
Closing this since most functionality is going to be transferred to SqlDelight.
58
I've added a lint check to make sure that table name being passed in
createQuery
actually exists in the SQL query.This doesn't yet cover checking for list of tables or SupportSQLiteQuery. I had a hard time finding documentation to evaluate values of lists.