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
I tried to use the example in the readme to create a gorm database:
minimal example:
package main
import (
"database/sql""log"
_ "github.com/proullon/ramsql/driver""gorm.io/driver/postgres""gorm.io/gorm"
)
typeProductstruct {
gorm.Model
}
// From the example in the readmefuncmain() {
ramdb, err:=sql.Open("ramsql", "TestGormQuickStart")
iferr!=nil {
log.Fatal(err)
}
db, err:=gorm.Open(postgres.New(postgres.Config{Conn: ramdb}), &gorm.Config{})
iferr!=nil {
log.Fatal(err)
}
// Migrate the schemaerr=db.AutoMigrate(&Product{})
iferr!=nil {
log.Fatal(err)
}
}
When I try to run this I get the following error:
schema 'information_schema' does not exist
[0.160ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = CURRENT_SCHEMA() AND table_name = 'products' AND table_type = 'BASE TABLE'
The text was updated successfully, but these errors were encountered:
I tried to use the example in the readme to create a gorm database:
minimal example:
When I try to run this I get the following error:
schema 'information_schema' does not exist
[0.160ms] [rows:-] SELECT count(*) FROM information_schema.tables WHERE table_schema = CURRENT_SCHEMA() AND table_name = 'products' AND table_type = 'BASE TABLE'
The text was updated successfully, but these errors were encountered: