Delete swaths of unused code
This commit is contained in:
parent
5f86014847
commit
b0cd6828b2
4 changed files with 0 additions and 43 deletions
|
@ -24,16 +24,6 @@ func ColumnNames(cols []Column) []string {
|
||||||
return names
|
return names
|
||||||
}
|
}
|
||||||
|
|
||||||
// ColumnTypes of the columns.
|
|
||||||
func ColumnTypes(cols []Column) []string {
|
|
||||||
types := make([]string, len(cols))
|
|
||||||
for i, c := range cols {
|
|
||||||
types[i] = c.Type
|
|
||||||
}
|
|
||||||
|
|
||||||
return types
|
|
||||||
}
|
|
||||||
|
|
||||||
// ColumnDBTypes of the columns.
|
// ColumnDBTypes of the columns.
|
||||||
func ColumnDBTypes(cols []Column) map[string]string {
|
func ColumnDBTypes(cols []Column) map[string]string {
|
||||||
types := map[string]string{}
|
types := map[string]string{}
|
||||||
|
|
11
bdb/keys.go
11
bdb/keys.go
|
@ -78,14 +78,3 @@ func SQLColDefinitions(cols []Column, names []string) SQLColumnDefs {
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
// SQLColDefStrings turns SQLColumnDefs into strings.
|
|
||||||
func SQLColDefStrings(defs []SQLColumnDef) []string {
|
|
||||||
strs := make([]string, len(defs))
|
|
||||||
|
|
||||||
for i, d := range defs {
|
|
||||||
strs[i] = d.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
return strs
|
|
||||||
}
|
|
||||||
|
|
|
@ -30,23 +30,3 @@ func TestSQLColDefinitions(t *testing.T) {
|
||||||
t.Error("wrong def:", got)
|
t.Error("wrong def:", got)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSQLDefStrings(t *testing.T) {
|
|
||||||
t.Parallel()
|
|
||||||
|
|
||||||
cols := []Column{
|
|
||||||
{Name: "one", Type: "int64"},
|
|
||||||
{Name: "two", Type: "string"},
|
|
||||||
{Name: "three", Type: "string"},
|
|
||||||
}
|
|
||||||
|
|
||||||
defs := SQLColDefinitions(cols, []string{"one", "three"})
|
|
||||||
strs := SQLColDefStrings(defs)
|
|
||||||
|
|
||||||
if got := strs[0]; got != "one int64" {
|
|
||||||
t.Error("wrong str:", got)
|
|
||||||
}
|
|
||||||
if got := strs[1]; got != "three string" {
|
|
||||||
t.Error("wrong str:", got)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -171,8 +171,6 @@ var templateFunctions = template.FuncMap{
|
||||||
// dbdrivers ops
|
// dbdrivers ops
|
||||||
"filterColumnsByDefault": bdb.FilterColumnsByDefault,
|
"filterColumnsByDefault": bdb.FilterColumnsByDefault,
|
||||||
"sqlColDefinitions": bdb.SQLColDefinitions,
|
"sqlColDefinitions": bdb.SQLColDefinitions,
|
||||||
"sqlColDefStrings": bdb.SQLColDefStrings,
|
|
||||||
"columnNames": bdb.ColumnNames,
|
"columnNames": bdb.ColumnNames,
|
||||||
"columnTypes": bdb.ColumnTypes,
|
|
||||||
"columnDBTypes": bdb.ColumnDBTypes,
|
"columnDBTypes": bdb.ColumnDBTypes,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue