I feel like it would be pretty sweet if there was a website similar to TryCF, but exclusive for QB. Often times when I’m writing queries with QB, I find I have to dump out the SQL to get things just right.
Would a QB sandbox like this be valuable? Assuming the answer is “yes”, how would one go about ensuring that the code generated by users in the sandbox is safe and limited to QB executions? Obviously running evaluate()
on the user input isn’t enough. I am guessing some type of parsing/filtering would be mandatory for this use case.
Here’s how I would imagine the flow of the app:
- User visits site (e,g. www.tryqb.io)
- User types in their qb statement in an editor similar to tryCF:
Note: The site would predefine a variableqb
to be an instance ofQueryBuilder
- User submits form.
- Server-side: Parses user
qb
statement - Server returns the result of
qb.toSql()