redwert / pg-dump-restore

Utility that gives ability to call pg_dump and pg_restore from nodejs.
7 stars 7 forks source link

Examples of tablePattern #1

Closed DivekJohns closed 11 months ago

DivekJohns commented 1 year ago

Hi, I am trying to use tablePattern option

Example table names I'm trying to match[ UserManagementSystem, UserLoginSystem, UserSessionSystem ]

what I have tried is tablePattern="User*" but no match is found

pg_dump: error: no matching tables were found

or

how to achieve something like pg_dump myDatabase -t table1 -t table2 > backup.sql;

Any help appreciated

redwert commented 1 year ago

Hi, actually try to achieve this using postrgess cli. The module is only a wrapper and it passes the arguments to cli. I included all possible options and that's it. There is no any extra logic aly passing arguments to cli

atlanteh commented 11 months ago

@redwert some arguments should be converted to arrays as they can occur multiple times in the cli (like excludeTablePattern)

redwert commented 11 months ago

@atlanteh welcome to make a pull request with changes

redwert commented 11 months ago

Will update version with this changes tomorrow

redwert commented 11 months ago

done

atlanteh commented 11 months ago

Thanks @redwert By the way, if you want to be thorough and you have time, there are a couple more options that can be used more than once.. Just look for the term "more than once" in the pg-dump and pg-restore docs Again, thanks!

redwert commented 11 months ago

@atlanteh, thanks will take a look