Re: Connection-Pooling Compile-Time ORM

2020-07-03 Thread JohnAD
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" Run That would be really clean.

Re: Connection-Pooling Compile-Time ORM

2020-07-03 Thread JohnAD
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

Re: Connection-Pooling Compile-Time ORM

2020-07-03 Thread JohnAD
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 Run could be DSL'd as: const data: SqlQuery = sqls: SELECT "blah" FROM

Re: Connection-Pooling Compile-Time ORM

2020-07-02 Thread jasonfi
Ok, but the general idea is the same, of using an underscore to differentiate code from the typical meaning. To me it's easier to read than those quotes the DSL currently uses.

Re: Connection-Pooling Compile-Time ORM

2020-07-02 Thread sschwarzer
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](https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles)

Re: Connection-Pooling Compile-Time ORM

2020-07-02 Thread Varriount
While this is a neat use of templates to create an SQL DSL, where does the ORM part come in? I don't see any place to automatically load values into an object/ref, aside from the procedures returning sequences.

Re: Connection-Pooling Compile-Time ORM

2020-07-01 Thread jasonfi
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

Re: Connection-Pooling Compile-Time ORM

2020-06-30 Thread ZadaZorg
I envy your productivity and inventiveness.

Connection-Pooling Compile-Time ORM

2020-06-29 Thread juancarlospaco
[https://juancarlospaco.github.io/nim-gatabase](https://juancarlospaco.github.io/nim-gatabase) * `0` Dependency, uses `system.nim` only, everything is done via `template` and `macro`, Docs, Examples, CI, etc etc (`db_postgres` for Postgres but Optional) * Running compile-time and