mla/pg_sample

Is there a way to export a sample by a table row?

motishaku opened this issue · 3 comments

hey,
as the title asks, is there a way to export a sample of the db based on the relationships and the data from a single table?
example:
start from table A where the query given is A.id=1, go through all the tables foreign keys, and export the relavent data?

thanks in advance!

mla commented

Interesting. I don't think there is currently, sorry. I think you'd need to add --limit= rules for every table's FK where it -> a.id=1.

Thanks, but i have over 200 tables.
Do you plan by chance to add it one day?
I would, but i never touched Perl, if not, i might create a rust version tho if fine by you

mla commented

I'm open to adding that. Need to think about how it would be expressed. I'm a bit swamped currently so prob wouldn't be fast regardless. A rust version would be cool.