Rename Exclude -> Blacklist

This commit is contained in:
Aaron L 2016-09-08 22:41:57 -07:00
parent c65c1f6a2c
commit 16b6a2b176
10 changed files with 40 additions and 41 deletions
bdb/drivers

View file

@ -82,8 +82,8 @@ func (p *PostgresDriver) UseLastInsertID() bool {
// TableNames connects to the postgres database and
// retrieves all table names from the information_schema where the
// table schema is schema. It uses a whitelist and exclude list.
func (p *PostgresDriver) TableNames(schema string, whitelist, exclude []string) ([]string, error) {
// table schema is schema. It uses a whitelist and blacklist.
func (p *PostgresDriver) TableNames(schema string, whitelist, blacklist []string) ([]string, error) {
var names []string
query := fmt.Sprintf(`select table_name from information_schema.tables where table_schema = ?`)
@ -93,10 +93,10 @@ func (p *PostgresDriver) TableNames(schema string, whitelist, exclude []string)
for _, w := range whitelist {
args = append(args, w)
}
} else if len(exclude) > 0 {
query += fmt.Sprintf("and table_name not in (%s);", strmangle.Placeholders(len(exclude), 1, 1))
for _, e := range exclude {
args = append(args, e)
} else if len(blacklist) > 0 {
query += fmt.Sprintf("and table_name not in (%s);", strmangle.Placeholders(len(blacklist), 1, 1))
for _, b := range blacklist {
args = append(args, b)
}
}