Skip to content

Commit

Permalink
[support-mariadb-dumps-with-newline] Use aliased types instead of pri…
Browse files Browse the repository at this point in the history
…mitive types
  • Loading branch information
josacar committed Dec 28, 2023
1 parent 85bd50d commit 78bf45a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/triki.cr
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Triki
alias ColumnAction = Symbol
alias Between = Range(Int32, Int32)
alias ColumnList = Array(String)
alias Columns = Array(String)
alias RowContent = String | Int32 | Nil

alias RowAsHash = Hash(ColumnName, RowContent)
Expand Down
2 changes: 1 addition & 1 deletion src/triki/config_applicator.cr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Triki
alias RowContent = Triki::RowContent

# ameba:disable Metrics/CyclomaticComplexity
def self.apply_table_config(row : Array(String?), table_config : Triki::ConfigTableHash, columns : Columns, faker = Faker, dictionary = EnglishDictionary)
def self.apply_table_config(row : Array(String?), table_config : Triki::ConfigTableHash, columns : ColumnList, faker = Faker, dictionary = EnglishDictionary)
return row unless table_config.is_a?(Hash)

row_hash = row_as_hash(row, columns)
Expand Down
4 changes: 2 additions & 2 deletions src/triki/config_scaffold_generator.cr
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class Triki
end
next unless table_data

table_name = table_data["table_name"].as(String)
table_name = table_data["table_name"].as(TableName)
next if obfuscator.scaffolded_tables[table_name]? # only process each table_name once

columns = table_data["column_names"].as(Array(String))
columns = table_data["column_names"].as(ColumnList)
table_config = config[table_name]?
next if table_config == :truncate || table_config == :keep

Expand Down

0 comments on commit 78bf45a

Please sign in to comment.