ankane / pgslice

Postgres partitioning as easy as pie
MIT License
1.11k stars 67 forks source link

feat: Add :unique_key option to filling script in order to iterate on a custom column #54

Closed LucasMontorio closed 11 months ago

LucasMontorio commented 11 months ago

Context

By default, in the fill script, the gem uses the table's primary_key on which it iterates in order to constitute batches of data to be copied from the source_table to the intermediate_table (cf this piece of code)

This PR proposes a new optional param unique_key that can replace the table's primary key with a custom iterative column in order to fulfil this task.