Release 2.5.0
Schemagen 🥇
This release adds schemagen
tool that generates goclqx table
models based on database schema.
Example:
Running the following command for examples
keyspace:
$GOBIN/schemagen -cluster="127.0.0.1:9042" -keyspace="examples" -output="models" -pkgname="models"
Generates models/models.go
as follows:
// Code generated by "gocqlx/cmd/schemagen"; DO NOT EDIT.
package models
import "github.com/scylladb/gocqlx/v2/table"
// 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",
},
})
Songs = table.New(table.Metadata{
Name: "songs",
Columns: []string{
"album",
"artist",
"data",
"id",
"tags",
"title",
},
PartKey: []string{
"id",
},
SortKey: []string{},
})
)
Installation
go get -u "github.com/scylladb/gocqlx/v2/cmd/schemagen"
What's Changed
- GetCAS: check if the query has a build error before trying to execute it by @ok32 in #187
- Correctly state in the GetQuery comment that it gets by primary key by @alfa-alex in #190
- Update godoc badge link by @quenbyako in #193
- qb: add support for USING TIMEOUT clause by @mmatczuk in #195
- schemagen cli by @Bobochka in #201
- schemagen refactoring by @mmatczuk in #203
New Contributors
- @ok32 made their first contribution in #187
- @alfa-alex made their first contribution in #190
- @quenbyako made their first contribution in #193
- @Bobochka made their first contribution in #201
Full Changelog: v2.4.0...v2.5.0