- Replace log.Faltal with error wrapping in schemagen func - Simplify tests, use temp dir and ioutil functions, remove boilerplate code - In test use schemagen keyspace to avoid name conflict with examples - Change template
33 lines
585 B
Cheetah
33 lines
585 B
Cheetah
// Code generated by "gocqlx/cmd/schemagen"; DO NOT EDIT.
|
|
|
|
package {{.PackageName}}
|
|
|
|
import "github.com/scylladb/gocqlx/v2/table"
|
|
|
|
// Table models.
|
|
var (
|
|
{{with .Tables}}
|
|
{{range .}}
|
|
{{$model_name := .Name | camelize}}
|
|
{{$model_name}} = table.New(table.Metadata {
|
|
Name: "{{.Name}}",
|
|
Columns: []string{
|
|
{{- range .OrderedColumns}}
|
|
"{{.}}",
|
|
{{- end}}
|
|
},
|
|
PartKey: []string {
|
|
{{- range .PartitionKey}}
|
|
"{{.Name}}",
|
|
{{- end}}
|
|
},
|
|
SortKey: []string{
|
|
{{- range .ClusteringColumns}}
|
|
"{{.Name}}",
|
|
{{- end}}
|
|
},
|
|
})
|
|
{{end}}
|
|
{{end}}
|
|
)
|