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
71
README.md
71
README.md
@@ -141,42 +141,43 @@ package models
|
||||
|
||||
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{},
|
||||
})
|
||||
)
|
||||
```
|
||||
|
||||
## Examples
|
||||
|
||||
Reference in New Issue
Block a user