Add more UseSchema tests.
Rename newly generated file to avoid potentional conflict with tables named table or views named view.
This commit is contained in:
parent
a9aa25416a
commit
5e34bef288
10 changed files with 250 additions and 160 deletions
|
|
@ -99,9 +99,8 @@ func new{{tableTemplate.TypeName}}Impl(schemaName, tableName, alias string) {{st
|
|||
|
||||
var tableSqlBuilderSetSchemaTemplate = `package {{package}}
|
||||
|
||||
// UseSchema changes all global tables/views with the value returned
|
||||
// returned by calling FromSchema on them. Passing an empty string to this function
|
||||
// will cause queries to be generated without any table/view alias.
|
||||
// UseSchema sets a new schema name for all generated {{type}} SQL builder types. It is recommended to invoke
|
||||
// this method only once at the beginning of the program.
|
||||
func UseSchema(schema string) {
|
||||
{{- range .}}
|
||||
{{ .InstanceName }} = {{ .InstanceName }}.FromSchema(schema)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue