Browse Source

调整接口

master
zhenghaorong 5 days ago
parent
commit
91b18d16f0
1 changed files with 9 additions and 4 deletions
  1. +9
    -4
      chain.go

+ 9
- 4
chain.go View File

@ -241,7 +241,7 @@ func (this *Query) GetTableInfo(table string) (map[string]interface{}, error) {
"IS_NULLABLE", //是否为空
}
sql := "select `" + strings.Join(field, "`,`") + "` from information_schema.COLUMNS where table_name = ? and table_schema = ?"
valuelist := []interface{}{table}
if DB_PROVIDER == "PgsqlDb" {
//pgsql中,未加引号的标识符会被自动转换为小写
sql = `SELECT
@ -277,6 +277,8 @@ func (this *Query) GetTableInfo(table string) (map[string]interface{}, error) {
ALL_TAB_COLUMNS
WHERE
TABLE_NAME = ?`
} else {
valuelist = append(valuelist, this.dbname)
}
if this.conn == nil {
@ -287,9 +289,12 @@ func (this *Query) GetTableInfo(table string) (map[string]interface{}, error) {
if err != nil {
return nil, err
}
valuelist := []interface{}{table}
if DB_PROVIDER == "" {
valuelist = []interface{}{table, this.dbname}
//if DB_PROVIDER == "" {
// valuelist = []interface{}{table, this.dbname}
//}
if this.debug {
log.Println("GetTableInfo sql:", sql, valuelist)
}
list, err := StmtForQueryList(stmtSql, valuelist)
if err != nil {


Loading…
Cancel
Save