Skip to content

feat: Add support for parametrized queries, and move sql injection protection to a similar pattern.#67

Draft
EdgyEdgemond wants to merge 18 commits into
gorilla-co:masterfrom
EdgyEdgemond:feat/parametrized-queries
Draft

feat: Add support for parametrized queries, and move sql injection protection to a similar pattern.#67
EdgyEdgemond wants to merge 18 commits into
gorilla-co:masterfrom
EdgyEdgemond:feat/parametrized-queries

Conversation

@EdgyEdgemond
Copy link
Copy Markdown

No description provided.

@EdgyEdgemond EdgyEdgemond marked this pull request as draft June 9, 2025 15:52
Comment thread odata_query/sql/base.py
table_alias: Optional[str] = None,
*,
phandler: Optional[ParameterHandler] = None,
column_mapping: dict[str, str] | None = None,
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

supports filtering on more complex queries with more than one table.

        column_mapping={
            "city": "ci.city",
            "country": "co.country",
            "division": "di.division",
        },
    SELECT
        *
    FROM public.user u
    LEFT JOIN challenge c
        ON c.user_id = u.id
    LEFT JOIN challenge_payment cp
        JOIN payment p
            ON p.id = cp.payment_id
            AND p.success = true
        ON cp.challenge_id = c.id
    LEFT JOIN lu_country co ON u.country_id = co.id
    LEFT JOIN lu_division co ON u.division_id = di.id
    LEFT JOIN lu_city ci ON u.city_id = ci.id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant