We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
To be able to use an already opened SQLite DB by Gorm
The Gorm for MySQL and Postgres support existing database connections to be reused.
However none of the other databases support the same.
It should be unified accross the board.
Even probably add a special method that accepts a database/sql instance
gorm.FromDB(db *sql.DB)
The text was updated successfully, but these errors were encountered:
@jinzhu any updates on this issue?
Sorry, something went wrong.
@lesichkovm did you manage to do it?
I managed to have something working like this:
"gorm.io/driver/sqlite" "gorm.io/gorm" gormDB, err := gorm.Open(sqlite.New(sqlite.Config{Conn: db}), &gorm.Config{})
@manuelarte thank you for chipping in. Looks like a nice way of accomplishing it.
@jinzhu can this be made part of the standard functions, to not require workarounds.
jinzhu
No branches or pull requests
Describe the feature
To be able to use an already opened SQLite DB by Gorm
Motivation
The Gorm for MySQL and Postgres support existing database connections to be reused.
However none of the other databases support the same.
It should be unified accross the board.
Even probably add a special method that accepts a database/sql instance
Related Issues
The text was updated successfully, but these errors were encountered: