Open cyberhuman opened 9 years ago
E.g. I would like to SELECT * FROM table WHERE column IN (item1, item2, ...), where the list on the right of IN is built at run time.
The syntax could be like this:
-- @get_column SELECT * FROM table WHERE column IN (@1)
And sqlgg would generate code like this:
let get_column_in db ~sqlgg_raw_1 callback = ... T.select db ("SELECT * FROM table WHERE column IN (" ^ sqlgg_raw_1 ^ ")") set_params invoke_callback
https://github.com/ygrek/sqlgg/commit/c36679d0e35a29caf1c2f0a7bd30ccb8b70741a2
the issue is about arbitrary (unsafe) substitutions (i like the syntax << ... >> now), not just in tuple
<< ... >>
E.g. I would like to SELECT * FROM table WHERE column IN (item1, item2, ...), where the list on the right of IN is built at run time.
The syntax could be like this:
And sqlgg would generate code like this: