ankane / ankane/pgsync

variables with multiple values

Open
#206 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
3.5k
Forks
219
PR merge metrics
No merged PRs in 30d

Description

Hi,

Is it possible to run pgsync with a variable that is a list? e.g.

groups:
  product:
    products: "where id in {1}"

and

pgsync product:\(123,456\)

This syntax works if only 1 value is passed in to the variable, since the SQL evaluates to where id in (123), which is valid. But it looks like if there's a comma anywhere, it gets treated as a delimiter for a table name, so I get the error

Table not found in source: 456)

(Trying to escape the comma like \, or putting quotes " around the whole string does not make a difference.)
Thank you!

https://github.com/ankane/pgsync?tab=readme-ov-file#variables

Contributor guide

No contributing guide indexed for this repository

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 with the Variables section of README and the pgsync command shown in the report, then trace how command-line values containing commas are parsed. Done means a list such as (123,456) can be used in the documented SQL condition without treating 456) as a table name; add or update coverage if the repository provides a relevant test entry point.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, ruby
Domain
cli, 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.