Skip to content

Commit

Permalink
fix: Typos "partioned/partioning" => "partitioned/partitioning"
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Vérité <[email protected]>
  • Loading branch information
dverite committed Oct 1, 2024
1 parent 8ed3d4d commit 9e58a82
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func NewRootCommand() (*cobra.Command, error) {
Use: "postgresql-partition-manager ",
Version: fmt.Sprintf("%s, commit %s, built at %s", build.Version, build.CommitSHA, build.Date),
Short: "PostgreSQL partition manager",
Long: "Simplified PostgreSQL partioning management",
Long: "Simplified PostgreSQL partitioning management",
TraverseChildren: true,
}

Expand Down
6 changes: 3 additions & 3 deletions internal/infra/postgresql/partition.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ var (
// ErrUnsupportedPartitionStrategy represents an error indicating that the partitioning strategy on the table is not supported.
ErrUnsupportedPartitionStrategy = errors.New("unsupported partitioning strategy")

// ErrTableIsNotPartioned represents an error indicating the specified table don't have partitioning
ErrTableIsNotPartioned = errors.New("table is not partioned")
// ErrTableIsNotPartitioned represents an error indicating the specified table don't have partitioning
ErrTableIsNotPartitioned = errors.New("table is not partitioned")
)

type PartitionResult struct {
Expand Down Expand Up @@ -132,7 +132,7 @@ func (p Postgres) GetPartitionSettings(schema, table string) (strategy, key stri
}

if len(partkeydef) == 0 {
return "", "", ErrTableIsNotPartioned
return "", "", ErrTableIsNotPartitioned
}

strategy = partkeydef[0]
Expand Down
2 changes: 1 addition & 1 deletion internal/infra/postgresql/partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func TestGetPartitionSettings(t *testing.T) {
mock.ExpectQuery(query).WillReturnRows(mock.NewRows([]string{"partkeydef"}).AddRow([]string{}))
_, _, err = p.GetPartitionSettings(schema, table)
assert.Error(t, err, "GetPartitionSettings should fail")
assert.ErrorIs(t, err, postgresql.ErrTableIsNotPartioned)
assert.ErrorIs(t, err, postgresql.ErrTableIsNotPartitioned)

mock.ExpectQuery(query).WillReturnError(ErrPostgreSQLConnectionFailure)
_, _, err = p.GetPartitionSettings(schema, table)
Expand Down
2 changes: 1 addition & 1 deletion scripts/bats/00_cli.bats
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ setup() {
run postgresql-partition-manager --help

assert_success
assert_output --partial "Simplified PostgreSQL partioning management"
assert_output --partial "Simplified PostgreSQL partitioning management"
}
8 changes: 4 additions & 4 deletions scripts/bats/20_check.bats
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ setup() {
local RETENTION=2
local PREPROVISIONED=2

# Create partioned table 2 retention days
create_daily_partioned_table ${TABLE} ${RETENTION} ${PREPROVISIONED}
# Create partitioned table 2 retention days
create_daily_partitioned_table ${TABLE} ${RETENTION} ${PREPROVISIONED}

local CONFIGURATION=$(cat << EOF
partitions:
Expand Down Expand Up @@ -54,7 +54,7 @@ EOF
local NEW_RETENTION=2
local PREPROVISIONED=1

create_daily_partioned_table ${TABLE} ${TABLE} ${INITIAL_RETENTION} ${PREPROVISIONED}
create_daily_partitioned_table ${TABLE} ${TABLE} ${INITIAL_RETENTION} ${PREPROVISIONED}

# Generate configuration with only 1 retention
local CONFIGURATION=$(cat << EOF
Expand Down Expand Up @@ -84,7 +84,7 @@ EOF
local INITIAL_PREPROVISIONED=2
local NEW_PREPROVISIONED=3

create_daily_partioned_table ${TABLE} ${RETENTION} ${INITIAL_PREPROVISIONED}
create_daily_partitioned_table ${TABLE} ${RETENTION} ${INITIAL_PREPROVISIONED}

# Increase preProvisioned partitions
local CONFIGURATION=$(cat << EOF
Expand Down
20 changes: 10 additions & 10 deletions scripts/bats/30_provisioning.bats
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ setup() {
local RETENTION=1
local PREPROVISIONED=1

# Create partioned table
create_partioned_table ${TABLE} ${INTERVAL} ${RETENTION} ${PREPROVISIONED}
# Create partitioned table
create_partitioned_table ${TABLE} ${INTERVAL} ${RETENTION} ${PREPROVISIONED}

local CONFIGURATION=$(cat << EOF
partitions:
Expand Down Expand Up @@ -49,8 +49,8 @@ EOF
local RETENTION=1
local PREPROVISIONED=1

# Create partioned table
create_partioned_table ${TABLE} ${INTERVAL} ${RETENTION} ${PREPROVISIONED}
# Create partitioned table
create_partitioned_table ${TABLE} ${INTERVAL} ${RETENTION} ${PREPROVISIONED}

local CONFIGURATION=$(cat << EOF
partitions:
Expand Down Expand Up @@ -97,8 +97,8 @@ EOF
local EXPECTED_CURRENT_TABLE="${TABLE}_$(get_current_date_adjusted_by_month 0)"
local EXPECTED_NEXT_TABLE="${TABLE}_$(get_current_date_adjusted_by_month +1)"

# Create partioned table
create_partioned_table ${TABLE} ${INTERVAL} ${RETENTION} ${PREPROVISIONED}
# Create partitioned table
create_partitioned_table ${TABLE} ${INTERVAL} ${RETENTION} ${PREPROVISIONED}

local CONFIGURATION=$(cat << EOF
partitions:
Expand Down Expand Up @@ -134,8 +134,8 @@ EOF
local EXPECTED_CURRENT_TABLE="${TABLE}_$(get_current_date_adjusted_by_quarter 0)"
local EXPECTED_NEXT_TABLE="${TABLE}_$(get_current_date_adjusted_by_quarter +1)"

# Create partioned table
create_partioned_table ${TABLE} ${INTERVAL} ${RETENTION} ${PREPROVISIONED}
# Create partitioned table
create_partitioned_table ${TABLE} ${INTERVAL} ${RETENTION} ${PREPROVISIONED}

local CONFIGURATION=$(cat << EOF
partitions:
Expand Down Expand Up @@ -170,8 +170,8 @@ EOF
local EXPECTED_CURRENT_TABLE="${TABLE}_$(get_current_date_adjusted_by_year 0)"
local EXPECTED_NEXT_TABLE="${TABLE}_$(get_current_date_adjusted_by_year +1)"

# Create partioned table
create_partioned_table ${TABLE} ${INTERVAL} ${RETENTION} ${PREPROVISIONED}
# Create partitioned table
create_partitioned_table ${TABLE} ${INTERVAL} ${RETENTION} ${PREPROVISIONED}

local CONFIGURATION=$(cat << EOF
partitions:
Expand Down
4 changes: 2 additions & 2 deletions scripts/bats/40_cleanup.bats
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ setup() {
local INITIAL_RETENTION=3
local INITIAL_PREPROVISIONED=3

# Create partioned table
create_daily_partioned_table ${TABLE} ${INITIAL_RETENTION} ${INITIAL_PREPROVISIONED}
# Create partitioned table
create_daily_partitioned_table ${TABLE} ${INITIAL_RETENTION} ${INITIAL_PREPROVISIONED}

for ((i=1; i<= INITIAL_RETENTION; i++));do
assert_table_exists public $(generate_daily_partition_name ${TABLE} -${i})
Expand Down
4 changes: 2 additions & 2 deletions scripts/bats/test/libs/partitions.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
create_partioned_table() {
create_partitioned_table() {
local TABLE=$1
local INTERVAL=$2
local RETENTION=$3
Expand All @@ -7,7 +7,7 @@ create_partioned_table() {
create_table_from_template ${TABLE}
}

create_daily_partioned_table() {
create_daily_partitioned_table() {
local TABLE=$1
local RETENTION=$2
local PREPROVISIONED=$3
Expand Down

0 comments on commit 9e58a82

Please sign in to comment.