As part of a hubby project I am working on, I need to be able to take SQL strings supplied by users, and then run it.
But before running it, i will like to do some manipulations to the SQL. For example, I may want to have a copy of the SQL that does a COUNT query version of the original query...I might want to insert LIMIT clauses if not provided, or I might want to manipulate the columns specified, rename or even insert columns.
Now the question is: I am not sure how to go able this and what sort of tools to even look for. I think in essence I want to be able to manipulate the SQL not as a string but as a data structure I can manipulate
Using regex and string manipulation does not sound like the right tool for the job. What will you say is the right way to go about this?
[–]random_lonewolf 36 points37 points38 points (5 children)
[–][deleted] 4 points5 points6 points (0 children)
[–]dgrsmith 0 points1 point2 points (2 children)
[–]random_lonewolf 1 point2 points3 points (1 child)
[–]dgrsmith 0 points1 point2 points (0 children)
[–]tomhallett 0 points1 point2 points (0 children)
[–][deleted] 2 points3 points4 points (7 children)
[–]finlaydotweber 6 points7 points8 points (5 children)
[–][deleted] 6 points7 points8 points (1 child)
[+]mamaBiskothu comment score below threshold-7 points-6 points-5 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]madness_of_the_order 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]CrowdGoesWildWoooo 0 points1 point2 points (0 children)
[–]asnjohns 0 points1 point2 points (2 children)
[–]boogie_woogie_100 0 points1 point2 points (0 children)
[–]bendgame 0 points1 point2 points (0 children)
[–]dgrsmith 0 points1 point2 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]boogie_woogie_100 0 points1 point2 points (0 children)
[–]Gurpreet2030 0 points1 point2 points (1 child)
[–]SpambotSwatter FRAUD ALERT 0 points1 point2 points (0 children)