mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
use sqlx for testing connection
This commit is contained in:
parent
e7ef1d3b73
commit
b2bcd3528c
|
@ -1,6 +0,0 @@
|
|||
package bbgo
|
||||
|
||||
import (
|
||||
// register the go migrations
|
||||
_ "github.com/c9s/bbgo/pkg/migrations"
|
||||
)
|
|
@ -2,13 +2,13 @@ package server
|
|||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"net/http"
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jmoiron/sqlx"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
"github.com/c9s/bbgo/pkg/bbgo"
|
||||
|
@ -35,7 +35,7 @@ func (s *Server) setupTestDB(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
db, err := sql.Open(payload.Driver, payload.DSN)
|
||||
db, err := sqlx.Connect(payload.Driver, payload.DSN)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue
Block a user