基于serf的数据库同步模块库
liuxiaolong
2019-09-05 5254b8f9e86010f517432f94fa81c6c3c33e5a47
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, ","),