cmd/schemagen: refactoring
- 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
This commit is contained in:
committed by
Michal Jan Matczuk
parent
39bf42f122
commit
8477485a45
73
cmd/schemagen/testdata/models.go.txt
vendored
73
cmd/schemagen/testdata/models.go.txt
vendored
@@ -1,42 +1,43 @@
|
||||
// Code generated by "gocqlx/cmd/schemagen"; DO NOT EDIT.
|
||||
|
||||
package {{pkgname}}
|
||||
package foobar
|
||||
|
||||
import "github.com/scylladb/gocqlx/v2/table"
|
||||
|
||||
var PlaylistsMetadata = table.Metadata{
|
||||
Name: "playlists",
|
||||
Columns: []string{
|
||||
"album",
|
||||
"artist",
|
||||
"id",
|
||||
"song_id",
|
||||
"title",
|
||||
},
|
||||
PartKey: []string{
|
||||
"id",
|
||||
},
|
||||
SortKey: []string{
|
||||
"title",
|
||||
"album",
|
||||
"artist",
|
||||
},
|
||||
}
|
||||
var PlaylistsTable = table.New(PlaylistsMetadata)
|
||||
// Table models.
|
||||
var (
|
||||
Playlists = table.New(table.Metadata{
|
||||
Name: "playlists",
|
||||
Columns: []string{
|
||||
"album",
|
||||
"artist",
|
||||
"id",
|
||||
"song_id",
|
||||
"title",
|
||||
},
|
||||
PartKey: []string{
|
||||
"id",
|
||||
},
|
||||
SortKey: []string{
|
||||
"title",
|
||||
"album",
|
||||
"artist",
|
||||
},
|
||||
})
|
||||
|
||||
var SongsMetadata = table.Metadata{
|
||||
Name: "songs",
|
||||
Columns: []string{
|
||||
"album",
|
||||
"artist",
|
||||
"data",
|
||||
"id",
|
||||
"tags",
|
||||
"title",
|
||||
},
|
||||
PartKey: []string{
|
||||
"id",
|
||||
},
|
||||
SortKey: []string{},
|
||||
}
|
||||
var SongsTable = table.New(SongsMetadata)
|
||||
Songs = table.New(table.Metadata{
|
||||
Name: "songs",
|
||||
Columns: []string{
|
||||
"album",
|
||||
"artist",
|
||||
"data",
|
||||
"id",
|
||||
"tags",
|
||||
"title",
|
||||
},
|
||||
PartKey: []string{
|
||||
"id",
|
||||
},
|
||||
SortKey: []string{},
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user