Skip to content

Commit

Permalink
fix: sql should returning id
Browse files Browse the repository at this point in the history
  • Loading branch information
t0t07 committed Nov 10, 2021
1 parent c8b0b7c commit 43ee23e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/database/metadatav2/postgres/feature_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func (db *DB) CreateFeatureGroup(ctx context.Context, opt metadatav2.CreateFeatu
return 0, fmt.Errorf("illegal category %s, should be either 'stream' or 'batch'", opt.Category)
}
var featureGroupId int16
query := "insert into feature_group(name, entity_id, category, description) values($1, $2, $3, $4)"
query := "insert into feature_group(name, entity_id, category, description) values($1, $2, $3, $4) returning id"
err := db.GetContext(ctx, &featureGroupId, query, opt.Name, opt.EntityID, opt.Category, opt.Description)
if err != nil {
if e2, ok := err.(*pq.Error); ok {
Expand Down

0 comments on commit 43ee23e

Please sign in to comment.