Skip to content

Commit dda941f

Browse files
author
Pavel Krush
committed
kept backward compativility in drivers/interface
1 parent e44ae05 commit dda941f

File tree

7 files changed

+13
-7
lines changed

7 files changed

+13
-7
lines changed

drivers/interface.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,13 @@ type TableColumnTypeTranslator interface {
106106

107107
// Tables returns the metadata for all tables, minus the tables
108108
// specified in the blacklist.
109-
func Tables(c Constructor, schema string, whitelist, blacklist []string, concurrency int) ([]Table, error) {
109+
func Tables(c Constructor, schema string, whitelist, blacklist []string) ([]Table, error) {
110+
return TablesConcurrently(c, schema, whitelist, blacklist, 1)
111+
}
112+
113+
// TablesConcurrently is a concurrent version of Tables. It returns the
114+
// metadata for all tables, minus the tables specified in the blacklist.
115+
func TablesConcurrently(c Constructor, schema string, whitelist, blacklist []string, concurrency int) ([]Table, error) {
110116
var err error
111117
var ret []Table
112118

drivers/interface_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (m testMockDriver) UseIndexPlaceholders() bool {
115115
func TestTables(t *testing.T) {
116116
t.Parallel()
117117

118-
tables, err := Tables(testMockDriver{}, "public", nil, nil, 1)
118+
tables, err := TablesConcurrently(testMockDriver{}, "public", nil, nil, 1)
119119
if err != nil {
120120
t.Error(err)
121121
}

drivers/mocks/mock.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (m *MockDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, er
6666
whitelist, _ := config.StringSlice(drivers.ConfigWhitelist)
6767
blacklist, _ := config.StringSlice(drivers.ConfigBlacklist)
6868

69-
dbinfo.Tables, err = drivers.Tables(m, schema, whitelist, blacklist, 1)
69+
dbinfo.Tables, err = drivers.TablesConcurrently(m, schema, whitelist, blacklist, 1)
7070
if err != nil {
7171
return nil, err
7272
}

drivers/sqlboiler-mssql/driver/mssql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func (m *MSSQLDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, e
111111
UseCaseWhenExistsClause: true,
112112
},
113113
}
114-
dbinfo.Tables, err = drivers.Tables(m, schema, whitelist, blacklist, concurrency)
114+
dbinfo.Tables, err = drivers.TablesConcurrently(m, schema, whitelist, blacklist, concurrency)
115115
if err != nil {
116116
return nil, err
117117
}

drivers/sqlboiler-mysql/driver/mysql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (m *MySQLDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, e
117117
},
118118
}
119119

120-
dbinfo.Tables, err = drivers.Tables(m, schema, whitelist, blacklist, concurrency)
120+
dbinfo.Tables, err = drivers.TablesConcurrently(m, schema, whitelist, blacklist, concurrency)
121121
if err != nil {
122122
return nil, err
123123
}

drivers/sqlboiler-psql/driver/psql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (p *PostgresDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo
123123
UseDefaultKeyword: true,
124124
},
125125
}
126-
dbinfo.Tables, err = drivers.Tables(p, schema, whitelist, blacklist, concurrency)
126+
dbinfo.Tables, err = drivers.TablesConcurrently(p, schema, whitelist, blacklist, concurrency)
127127
if err != nil {
128128
return nil, err
129129
}

drivers/sqlboiler-sqlite3/driver/sqlite3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ func (s SQLiteDriver) Assemble(config drivers.Config) (dbinfo *drivers.DBInfo, e
9696
},
9797
}
9898

99-
dbinfo.Tables, err = drivers.Tables(s, "", whitelist, blacklist, concurrency)
99+
dbinfo.Tables, err = drivers.TablesConcurrently(s, "", whitelist, blacklist, concurrency)
100100
if err != nil {
101101
return nil, err
102102
}

0 commit comments

Comments
 (0)