feat: define xorm.FromDialectAndDB #1812
No reviewers
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1812
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "jumpeiMano/xorm:add-from-db"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi! I use your greate library,
xorm
.I'd like to use xorm.Engine with my own *sql.DB instances. Because I also want to use SessionResetter interface, so I want to call sql.OpenDB to create my own *sql.DB instance before creating *xorm.Engine instance.
So I define
FromDialectAndDB
function in packagexorm
.Thanks!
@ -104,0 +109,4 @@
// If you do not want to use your own dialect or db, please use NewEngine.
// For creating dialect, you can call dialects.OpenDialect. And, for creating db,
// you can call core.Open or core.FromDB.
func FromDialectAndDB(driverName, dataSourceName string, dialect dialects.Dialect, db *core.DB) (*Engine, error) {
How about rename it
NewEngineWith....
to keep consistent withNewEngineWithParams
.@lunny Thanks for your reviewng. I fixed it!
fa7f45555f