[Python] Prepared query with Jinja and BigQuery

Discussão em 'Python' iniciado por Stack, Janeiro 24, 2025.

  1. Stack

    Stack Membro Participativo

    For now, I use python, with sql templating (jinja2) for BigQuery API (not sdk) + fastapi.

    The queries are generated from api parameters to sql code. Those queries are sent to BQ.

    To prevent sql injection, I try the JinjaSQL module, but I can't send the prepared query directly to BQ, I must convert to "pure sql", so it's not useful...

    Have you an idea to prepare/secure the query with sql in jinja template ?

    Thanx

    Continue reading...

Compartilhe esta Página