Skip to content

Commit

Permalink
kept backward compativility in drivers/interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Krush committed Jul 7, 2022
1 parent e44ae05 commit dda941f
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 7 deletions.
8 changes: 7 additions & 1 deletion drivers/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,13 @@ type TableColumnTypeTranslator interface {

// Tables returns the metadata for all tables, minus the tables
// specified in the blacklist.
func Tables(c Constructor, schema string, whitelist, blacklist []string, concurrency int) ([]Table, error) {
func Tables(c Constructor, schema string, whitelist, blacklist []string) ([]Table, error) {
return TablesConcurrently(c, schema, whitelist, blacklist, 1)
}

// TablesConcurrently is a concurrent version of Tables. It returns the
// metadata for all tables, minus the tables specified in the blacklist.
func TablesConcurrently(c Constructor, schema string, whitelist, blacklist []string, concurrency int) ([]Table, error) {
var err error
var ret []Table

Expand Down
2 changes: 1 addition & 1 deletion drivers/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (m testMockDriver) UseIndexPlaceholders() bool {
func TestTables(t *testing.T) {
t.Parallel()

tables, err := Tables(testMockDriver{}, "public", nil, nil, 1)
tables, err := TablesConcurrently(testMockDriver{}, "public", nil, nil, 1)
if err != nil {
t.Error(err)
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/mocks/mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (m *MockDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, er
whitelist, _ := config.StringSlice(drivers.ConfigWhitelist)
blacklist, _ := config.StringSlice(drivers.ConfigBlacklist)

dbinfo.Tables, err = drivers.Tables(m, schema, whitelist, blacklist, 1)
dbinfo.Tables, err = drivers.TablesConcurrently(m, schema, whitelist, blacklist, 1)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/sqlboiler-mssql/driver/mssql.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (m *MSSQLDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, e
UseCaseWhenExistsClause: true,
},
}
dbinfo.Tables, err = drivers.Tables(m, schema, whitelist, blacklist, concurrency)
dbinfo.Tables, err = drivers.TablesConcurrently(m, schema, whitelist, blacklist, concurrency)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/sqlboiler-mysql/driver/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (m *MySQLDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, e
},
}

dbinfo.Tables, err = drivers.Tables(m, schema, whitelist, blacklist, concurrency)
dbinfo.Tables, err = drivers.TablesConcurrently(m, schema, whitelist, blacklist, concurrency)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/sqlboiler-psql/driver/psql.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (p *PostgresDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo
UseDefaultKeyword: true,
},
}
dbinfo.Tables, err = drivers.Tables(p, schema, whitelist, blacklist, concurrency)
dbinfo.Tables, err = drivers.TablesConcurrently(p, schema, whitelist, blacklist, concurrency)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/sqlboiler-sqlite3/driver/sqlite3.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (s SQLiteDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, e
},
}

dbinfo.Tables, err = drivers.Tables(s, "", whitelist, blacklist, concurrency)
dbinfo.Tables, err = drivers.TablesConcurrently(s, "", whitelist, blacklist, concurrency)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit dda941f

Please sign in to comment.