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 didn't work on this issue for a while, it requires to emulate Postgres's information_schema table, which is doable I guess but it feels like a rabbit hole, I don't want to rewrite Postgres.
That said, if it's blocking for a lot of use case, maybe it's worth it. I'll take a look again
ramsql would be extremely useful for many projects in my company, if it would work with postgres. Without this, it's unusable for us, unfortunately.
Postgres is also maybe the most popular sql dialect right now, so I think it's a good investment for you.
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: