mojolicious / mojolicious/sql-abstract-pg
Allow table aliases in JOIN queries
Nobody has claimed this yet.
- Dominant language
- Perl
- Stars
- 5
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
- SQL::Abstract::Pg version: 1.0
- Perl version: v5.34
- Operating system: Ubuntu Linux 21.04
It's not possible to create table aliases in generated SQL queries. This would be useful for generating queries where a table is JOINed to itself. Especially useful if someone wants to create an ORM based on Mojo::Pg.
A suggestion would be to allow the following syntax:
$abstract->select(
[
\'"a" as "t1"',
[ \'"a" as "t2"', '"t2"."parent_id"' => '"t1"."id"' ],
],
);
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the select API and the proposed self-join syntax in the issue, then trace how JOIN arguments are converted into SQL and review existing query-generation tests. Done means table aliases are accepted and produce valid PostgreSQL for a table joined to itself, with regression coverage.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- perl, postgresql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100