3 ms·
I've found text manipulation of SQL can quickly degenerate into a nightmare of concatenation, nested quoting & escaping. I wrote up Using plain Jinja[1] or SQL
by gregn610 4y ago
I've found text manipulation of SQL can quickly degenerate into a nightmare of concatenation, nested quoting & escaping.
I wrote up Using plain Jinja[1] or SQLAlchemy+Jinja[2] as complementary techniques. The post is a bit dated but the principles should still work.
- [1](https://github.com/gregn610/plpgsql/wiki/meta-sql-with-python-&-sqlalchemy#jinja2 https://github.com/gregn610/plpgsql/wiki/meta-sql-with-pytho...)
- [2](https://github.com/gregn610/plpgsql/wiki/meta-sql-with-python-&-sqlalchemy#solution-3 https://github.com/gregn610/plpgsql/wiki/meta-sql-with-pytho...)