I am experimenting with some random idea of end-user expressing a query in yaml format. This yaml file would be fed into some intermediate transformer to convert yaml to SQL statement.
Following is sample yaml snippet, but when I think of having conditions, expressions, subqueries, joins. And the yaml becomes more complex as queries tends to be more complex.
Question: how to define a SQL query in yaml format and yet cover all the scenarios? (Are there any existing libraries that can do this kind of magic)
table:
schema: test
name: test_table
select:
columns:
- column: * # retrieve all columns
where:
columns:
- column: user_id
- column: customer_id
limit:
value: 10
# groupBy
# orderBy