2021-11-13 13:55:44 +02:00
|
|
|
// Code generated by "gocqlx/cmd/schemagen"; DO NOT EDIT.
|
|
|
|
|
|
|
|
|
|
package {{.PackageName}}
|
|
|
|
|
|
|
|
|
|
import "github.com/scylladb/gocqlx/v2/table"
|
|
|
|
|
|
2021-11-17 11:49:42 +01:00
|
|
|
// Table models.
|
|
|
|
|
var (
|
2021-11-13 13:55:44 +02:00
|
|
|
{{with .Tables}}
|
2021-11-17 11:49:42 +01:00
|
|
|
{{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}}
|
|
|
|
|
)
|