Browse Source

修改查询

master v0.4.1
guzeng 3 years ago
parent
commit
c1a82cf1b0
1 changed files with 16 additions and 2 deletions
  1. +16
    -2
      chain.go

+ 16
- 2
chain.go View File

@ -29,9 +29,23 @@ type Query struct {
conn *sql.DB conn *sql.DB
} }
func NewQuery() *Query {
func NewQuery(t ...string) *Query {
var conn_type *sql.DB = DB
if len(t) > 0 {
switch t[0] {
case "mysql":
conn_type = DB
case "mssql": //sql server
conn_type = MSDB_CONNDB
}
}
return &Query{ return &Query{
conn: DB,
conn: conn_type,
} }
} }


Loading…
Cancel
Save