Skip to content

Parsing error with DELETE … USING and table aliases #245

@Leo5878

Description

@Leo5878

Expected behavior
sqlx-ts should correctly parse DELETE queries that use USING with table aliases, consistent with PostgreSQL syntax.

Actual behavior
The parser throws an error:

[E014] Failed to find a table name from a FROM statement: statement: `uc.user_id`

Minimal reproducible example

DELETE FROM user_configs uc
USING users u
WHERE uc.user_id = u.id
  AND u.user_id_tg = $1
  AND uc.config_id = $2;

This query is valid PostgreSQL, but sqlx-ts fails to parse it.

Expected outcome
Support alias resolution for tables referenced via USING, allowing correct analysis of joined delete statements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions