Skip to content

Commit

Permalink
Merge pull request go-gorm#13 from mihaitodor/add-json-marshal-support
Browse files Browse the repository at this point in the history
Add support for marshalling complex types to JSON
  • Loading branch information
jinzhu authored Jan 30, 2023
2 parents 006b2f4 + e401a7c commit 475168b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion driver/columns.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package driver

import (
"cloud.google.com/go/bigquery"
"database/sql/driver"
"encoding/json"

"cloud.google.com/go/bigquery"
"gorm.io/driver/bigquery/adaptor"
)

Expand Down Expand Up @@ -34,6 +36,10 @@ type bigQueryReroutedColumn struct {
schema bigquery.Schema
}

func (c bigQueryReroutedColumn) MarshalJSON() ([]byte, error) {
return json.Marshal(c.values)
}

type bigQueryColumn struct {
Name string
Schema bigquery.Schema
Expand Down

0 comments on commit 475168b

Please sign in to comment.