Skip to content
Snippets Groups Projects
Commit 72cc8bd8f4fa authored by Christophe de Vienne's avatar Christophe de Vienne
Browse files

generate_db_helpers: add a 'Select' function on table schemas

parent 99ba412ea469
No related branches found
No related tags found
No related merge requests found
Pipeline #7739 passed
......@@ -520,7 +520,8 @@
}
return {{.Name}}Table + " AS " + t.alias
}
func (t {{.Name}}TableSchema) ToSql() (string, []interface{}, error) {
return t.Sql(), nil, nil
}
......@@ -523,8 +524,10 @@
func (t {{.Name}}TableSchema) ToSql() (string, []interface{}, error) {
return t.Sql(), nil, nil
}
func (t {{.Name}}TableSchema) Select() squirrel.SelectBuilder {
return squirrel.Select(t.Columns(true)...).From(t.Sql())
}
{{- end}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment