基于serf的数据库同步模块库
2047ae9b11d66b33010c76bc2bd1db5a5458b921..5254b8f9e86010f517432f94fa81c6c3c33e5a47
2019-09-05 liuxiaolong
Merge branch 'master' of http://192.168.1.14:10010/r/syncdb
5254b8 对比 | 目录
2019-09-05 liuxiaolong
fix dbTables to dbtables
d9d407 对比 | 目录
1个文件已修改
6 ■■■■■ 已修改文件
dbself.go 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dbself.go
@@ -13,6 +13,8 @@
const (
    PersonSqliteDBPath = "~/workspace/gitblit/dbserver/config/testdb.db"
    DbT_TableName = "dbtables"
    DBP_TableName = "dbtablepersons"
)
var syncMut sync.Mutex
@@ -164,12 +166,12 @@
            for _,col :=range tDescArr {
                columnNames = append(columnNames, fmt.Sprintf(`'||quote("%s")||'`, col.Name))
            }
            if table == "dbTables" {
            if table == DbT_TableName {
                tSql = fmt.Sprintf(`SELECT 'INSERT INTO "%s" VALUES(%s)' as sql FROM "%s" where (analyServerId='' or analyServerId is NULL);`,
                    table,
                    strings.Join(columnNames, ","),
                    table)
            } else if table == "dbtablepersons" {
            } else if table == DBP_TableName {
                tSql = fmt.Sprintf(`SELECT 'INSERT INTO "%s" VALUES(%s)' as sql FROM "%s" where tableId in (select id from dbTables where (analyServerId='' or analyServerId is NULL));`,
                    table,
                    strings.Join(columnNames, ","),