You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot provide a playground link because the playground doesn't support testing the bigquery driver
Here is instead a very simple way to reproduce:
package main
import (
"gorm.io/driver/bigquery""gorm.io/gorm""log"
)
typeComplexRecordstruct {
Namestring`gorm:"column:Name"`RecordComplexSubRecord`gorm:"column:Record:type:RECORD"`
}
typeComplexSubRecordstruct {
Namestring`gorm:"column:Name"`Ageint`gorm:"column:Age"`
}
funcmain() {
// You can also pass custom endpoint and/or skip authentication by using query parameters like this:// bigquery://go-bigquery-driver/playground?endpoint=http://localhost:56758&disable_auth=truedb, err:=gorm.Open(bigquery.Open("bigquery://go-bigquery-driver/playground"), &gorm.Config{})
iferr!=nil {
log.Fatal(err)
}
varresult*ComplexSubRecord// Delete complex record table if existsdb.Migrator().DropTable(&ComplexRecord{})
// Make sure we have a complex_records tabledb.AutoMigrate(&ComplexRecord{})
// Insert new records to tabledb.Create(&ComplexRecord{Name: "test", Record: ComplexSubRecord{Name: "dd", Age: 1}})
db.Create(&ComplexRecord{Name: "test2", Record: ComplexSubRecord{Name: "dd2", Age: 444}})
// Select records from tableerr:=db.Where("age", 444).First(&result).Error// Generated SQL: SELECT * FROM `complex_sub_records` WHERE `age` = ? LIMIT ?iferr!=nil {
log.Fatal(err) // sql: expected 0 arguments, got 2
}
}
Description
Parameterized queries are unsupported because bigQueryStatement.NumInput() always returns 0. It should return the actual number of parameters. (which should be equal to the count of unescaped question marks ?).
This would allow using where conditions, limits, etc.
The text was updated successfully, but these errors were encountered:
GORM Playground Link
Cannot provide a playground link because the playground doesn't support testing the bigquery driver
Here is instead a very simple way to reproduce:
Description
Parameterized queries are unsupported because
bigQueryStatement.NumInput()
always returns 0. It should return the actual number of parameters. (which should be equal to the count of unescaped question marks?
).This would allow using where conditions, limits, etc.
The text was updated successfully, but these errors were encountered: