pgjones

Joined 11 years ago

Karma
173
Submissions
46
Member since
Apr 23
pgjones.dev

Quart, Flask, Werkzeug and Hypercorn maintainer, active in the Python async community.

View on Hacker News

Recent submissions

Comment · 1 year ago
The `sql_context` feature is meant to protect against SQL injection. I think for your usecase you would need to supply all columns, but you could used nested t-strings included based on whatever logic you need.
Comment · 1 year ago
It does parse the SQL. At the moment an expression is defined as all the text between the appropriate separators given the clause.
Comment · 1 year ago
Sorry that is a typo, I meant,

    with sql_context(columns={"x"}):
Comment · 1 year ago
Thank you! My Google foo did not find this.
Comment · 1 year ago
The presence of Absent removes the entire expression, and if that removal results in an empty clause (or group) it will remove that as well. For example if `a = Absent` `WHERE a = {a}` will remove everything, whereas `WHERE a = {a} AND b = {b}` will result in `WHERE b = {b}`.

> Do you support templating a sql tstring into an sql tstring for composition?

Yep

Comment · 1 year ago
Thanks, do you have a reference for SQL grammar - I've had no success finding an official source.
Comment · 1 year ago
Comment · 2 years ago
Quart, the ASGI version of Flask, also has background tasks, https://quart.palletsprojects.com/en/latest/how_to_guides/ba..., and there is an extension Quart-Tasks, https://github.com/pgjones/quart-tasks, to run them on a schedule. Via

    @tasks.cron("*/5 * * * *")  # every 5 minutes
    async def infrequent_task():
        ...
In addition Hypercorn, https://github.com/pgjones/hypercorn, (a ASGI and WSGI) also does not use gunicorn, having migrated many years ago.
Comment · 2 years ago
Comment · 3 years ago
Comment · 3 years ago
There are new logos for all the Pallets projects and Pallets itself, based on a common theme.
Comment · 3 years ago
https://pgjones.dev

I blog mostly about Python web developed, especially Flask, Quart and Hypercorn related aspects.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton