From 2938afd1c395a7d5a19a85dd4eb0389c6a4206c9 Mon Sep 17 00:00:00 2001 From: Nejc Zupan Date: Wed, 23 Aug 2023 18:35:20 +0200 Subject: [PATCH] Refactor pg-subsetter into pg_subsetter Refs #2 --- .github/workflows/go.yml | 2 +- README.md | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 959e46d..e03aa31 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -51,5 +51,5 @@ jobs: - name: Upload assets uses: actions/upload-artifact@v3 with: - name: pg-subsetter + name: pg_subsetter path: dist/* diff --git a/README.md b/README.md index 7b9e267..e4506fb 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,25 @@ -# pg-subsetter +# pg_subsetter -[![lint](https://github.com/teamniteo/pg-subsetter/actions/workflows/lint.yml/badge.svg)](https://github.com/teamniteo/pg-subsetter/actions/workflows/lint.yml) [![build](https://github.com/teamniteo/pg-subsetter/actions/workflows/go.yml/badge.svg)](https://github.com/teamniteo/pg-subsetter/actions/workflows/go.yml) [![vuln](https://github.com/teamniteo/pg-subsetter/actions/workflows/vuln.yml/badge.svg)](https://github.com/teamniteo/pg-subsetter/actions/workflows/vuln.yml) [![release](https://github.com/teamniteo/pg-subsetter/actions/workflows/release.yml/badge.svg)](https://github.com/teamniteo/pg-subsetter/actions/workflows/release.yml) +[![lint](https://github.com/teamniteo/pg_subsetter/actions/workflows/lint.yml/badge.svg)](https://github.com/teamniteo/pg_subsetter/actions/workflows/lint.yml) [![build](https://github.com/teamniteo/pg_subsetter/actions/workflows/go.yml/badge.svg)](https://github.com/teamniteo/pg_subsetter/actions/workflows/go.yml) [![vuln](https://github.com/teamniteo/pg_subsetter/actions/workflows/vuln.yml/badge.svg)](https://github.com/teamniteo/pg_subsetter/actions/workflows/vuln.yml) [![release](https://github.com/teamniteo/pg_subsetter/actions/workflows/release.yml/badge.svg)](https://github.com/teamniteo/pg_subsetter/actions/workflows/release.yml) -`pg-subsetter` is a tool designed to synchronize a fraction of a PostgreSQL database to another PostgreSQL database on the fly, it does not copy the SCHEMA. +`pg_subsetter` is a tool designed to synchronize a fraction of a PostgreSQL database to another PostgreSQL database on the fly, it does not copy the SCHEMA. ### Database Fraction Synchronization -`pg-subsetter` allows you to select and sync a specific subset of your database. Whether it's a fraction of a table or a particular dataset, you can have it replicated in another database without synchronizing the entire DB. +`pg_subsetter` allows you to select and sync a specific subset of your database. Whether it's a fraction of a table or a particular dataset, you can have it replicated in another database without synchronizing the entire DB. ### Integrity Preservation with Foreign Keys -Foreign keys play a vital role in maintaining the relationships between tables. `pg-subsetter` ensures that all foreign keys(one-to-one, one-to many, many-to-many) are handled correctly during the synchronization process, maintaining the integrity and relationships of the data. +Foreign keys play a vital role in maintaining the relationships between tables. `pg_subsetter` ensures that all foreign keys(one-to-one, one-to many, many-to-many) are handled correctly during the synchronization process, maintaining the integrity and relationships of the data. ### Efficient COPY Method -Utilizing the native PostgreSQL COPY command, `pg-subsetter` performs data transfer with high efficiency. This method significantly speeds up the synchronization process, minimizing downtime and resource consumption. +Utilizing the native PostgreSQL COPY command, `pg_subsetter` performs data transfer with high efficiency. This method significantly speeds up the synchronization process, minimizing downtime and resource consumption. ### Stateless Operation -`pg-subsetter` is built to be stateless, meaning it does not maintain any internal state between runs. This ensures that each synchronization process is independent, enhancing reliability and making it easier to manage and scale. +`pg_subsetter` is built to be stateless, meaning it does not maintain any internal state between runs. This ensures that each synchronization process is independent, enhancing reliability and making it easier to manage and scale. ### Sync required rows -`pg-subsetter` can be instructed to copy certain rows in specific tables, the command can be used multiple times to sync more data. +`pg_subsetter` can be instructed to copy certain rows in specific tables, the command can be used multiple times to sync more data. ## Usage @@ -54,7 +54,7 @@ psql -f schemadump.sql "postgres://test_target@localhost:5432/test_target?sslmod Copy a fraction of the database and force certain rows to be also copied over: ``` -pg-subsetter \ +pg_subsetter \ -src "postgres://test_source@localhost:5432/test_source?sslmode=disable" \ -dst "postgres://test_target@localhost:5432/test_target?sslmode=disable" \ -f 0.5 @@ -67,7 +67,7 @@ pg-subsetter \ # Installing ```bash -curl -Ls https://github.com/teamniteo/pg-subsetter/releases/latest/download/pg-subsetter_Linux_x86_64.tar.gz | tar -xz && mv pg-subsetter /usr/bin +curl -Ls https://github.com/teamniteo/pg_subsetter/releases/latest/download/pg_subsetter_Linux_x86_64.tar.gz | tar -xz && mv pg_subsetter /usr/bin ``` For other downloads see releases.