how to create mock xorm.NewEngine("mysql", connStr) #1470
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#1470
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
please help .. i have to create unit test
i need to make mock for this function ( connection mysql mock )
xorm.NewEngine("mysql", connStr)
can somebody help me ?
You can implement a mock
core.Dialect
,sql.driver
implementations.can you give me some sample code ?
here is my code
// CONNECTION DB ENT APP
conn_db_mysql, err := xorm.NewEngine("mysql", connStr)
nc := 3 // Increase if needed. - number connection pooling
conn_db_mysql.SetMaxOpenConns(nc)
conn_db_mysql.SetMaxIdleConns(nc)
conn_db_mysql.SetConnMaxLifetime(time.Second * 3)
conn_db_mysql.SetMapper(core.GonicMapper{})
// db_ent_app.ShowSQL() // if want to show query to console