mojolicious / mojolicious/sql-abstract-pg

Please allow this syntax: \[$string, @bind_args] in the table parameter of select

Open
#7 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Perl
Stars
5
Forks
3
PR merge metrics
No merged PRs in 30d

Description

This script doesn't show any bound values in the result. But inserting values like this script, inside the ON of the JOIN is a common scenario, so i think this is needed.

use SQL::Abstract::Pg;
use Data::Dumper;

my $abstract = SQL::Abstract::Pg->new;

my $user_id = 10;
my ($sql, @bind) = $abstract->select(
    \[ 't1 JOIN t2 ON (t1.id = t2.p_id AND t2.user = ?)', $user_id ],
    undef,
);

print Dumper({
    sql  => $sql,
    bind => \@bind,
});

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing SQL::Abstract::Pg's select handling for the table parameter, using the issue's Perl example as the reproduction case. Run the script and inspect its SQL and bind output; done means the JOIN syntax is accepted and the placeholder's value appears in the returned bind list.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl, postgresql
Domain
databases
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.