diff --git a/config.go b/config.go index 012238c..6739f49 100644 --- a/config.go +++ b/config.go @@ -696,9 +696,9 @@ func loadConfigurationFile(path string) (options, error) { } o.Format = []rune(dbFormat)[0] - o.Schemas = parseIdentifierList(s.Key("schemas").String()) - o.ExcludedSchemas = parseIdentifierList(s.Key("exclude_schemas").String()) - o.Tables = parseIdentifierList(s.Key("tables").String()) + o.Schemas = s.Key("schemas").Strings(",") + o.ExcludedSchemas = s.Key("exclude_schemas").Strings(",") + o.Tables = s.Key("tables").Strings(",") o.ExcludedTables = s.Key("exclude_tables").Strings(",") if s.HasKey("pg_dump_options") { @@ -727,16 +727,6 @@ func loadConfigurationFile(path string) (options, error) { return opts, nil } -func parseIdentifierList(rawList string) []string { - ids := make([]string, 0) - if len(strings.TrimSpace(rawList)) > 0 { - for _, t := range strings.Split(rawList, ";") { - ids = append(ids, strings.TrimSpace(t)) - } - } - return ids -} - func mergeCliAndConfigOptions(cliOpts options, configOpts options, onCli []string) options { opts := configOpts diff --git a/testdata/fixture.sql b/testdata/fixture.sql index 6dd72d1..58ae9e6 100644 --- a/testdata/fixture.sql +++ b/testdata/fixture.sql @@ -15,9 +15,13 @@ GRANT CONNECT ON DATABASE b2 TO u2; SET ROLE u1; CREATE TABLE t1 AS SELECT generate_series(0, 9) i; CREATE TABLE t2 AS SELECT generate_series(10, 19) j; +CREATE TABLE t3 AS SELECT generate_series(0, 9) i; +CREATE TABLE t4 AS SELECT generate_series(10, 19) j; \c b2 SET ROLE u2; CREATE TABLE t1 AS SELECT generate_series(0, 9) i; CREATE TABLE t2 AS SELECT generate_series(10, 19) j; +CREATE TABLE t3 AS SELECT generate_series(0, 9) i; +CREATE TABLE t4 AS SELECT generate_series(10, 19) j;