:)
What does a multi-line where clause look like? I couldn't find an example, especially of a complex where clause, possibly using exists as one of the lines.
It's a pity the from keyword needs to be in single quotation marks. I was trying to think of an alternative (e.g. source), but then it wouldn't have the same syntax as SQL. A leading underscore would be better IMHO: _from. Python uses leading underscores in this situation.
Python code usually uses a leading underscore to mark an identifier "private" and trailing underscores to distinguish identifiers from keywords.
https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles
As to case, in this particular application, one could have a version that supports the typical styling guidelines for SQL statements.
SELECT blah FROM xyz WHERE zin=4
could be DSL'd as:
const data: SqlQuery = sqls:
SELECT "blah"
FROM "users"
WHERE "zin = 4"
It would avoid the use of backticks and have a certain visual appeal to SQL coders.
But then you would be violating nim's case guidelines. Sometimes one can't win. :-)
To followup on @Variount 's question. Is the ORM goal to be something like:
type
Pet = object {. tableName: "pets" .}
name: string
age: int {. fieldName: "age_years" .}
const data: SqlQuery = sqls:
select Pet.*
`from` Pet
where Peg.age = 4
Can't help myself:
const data: SqlQuery = sqls:
SELECT Pet.name
FROM Pet
INNER JOIN House
ON House.id = Pet.houseId
WHERE House.country = "CA"
That would be really clean.