Skip to content

Commit

Permalink
null uuid sql store insert fix (#5288)
Browse files Browse the repository at this point in the history
  • Loading branch information
k-anshul authored and begelundmuller committed Jul 17, 2024
1 parent f6e72bc commit 03beddd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions runtime/drivers/duckdb/transporter_sqlstore_to_duckDB.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ func CreateTableQuery(schema *runtimev1.StructType, name string) (string, error)

func convert(row []driver.Value, schema *runtimev1.StructType) error {
for i, v := range row {
if v == nil {
continue
}
if schema.Fields[i].Type.Code == runtimev1.Type_CODE_UUID {
val, ok := v.([16]byte)
if !ok {
Expand Down
2 changes: 1 addition & 1 deletion runtime/drivers/postgres/sql_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,11 @@ func (r *rowIterator) Next(ctx context.Context) ([]sqldriver.Value, error) {
}

for i := range r.schema.Fields {
mapper := r.fieldMappers[i]
if vals[i] == nil {
r.row[i] = nil
continue
}
mapper := r.fieldMappers[i]
r.row[i], err = mapper.value(vals[i])
if err != nil {
return nil, err
Expand Down

1 comment on commit 03beddd

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://ui.rilldata.com as production
🚀 Deployed on https://669786c49a25f57d393d1f42--rill-ui.netlify.app

Please sign in to comment.