sqlStr="create database "+dbName+" keep "+strconv.Itoa(configPara.keep)+" days "+strconv.Itoa(configPara.days)
_,err=db.Exec(sqlStr)
checkErr(err,sqlStr)
// use database
//sqlStr = "use " + dbName
//_, err = db.Exec(sqlStr)
//checkErr(err, sqlStr)
sqlStr="create table if not exists "+dbName+"."+supTblName+" (ts timestamp, current float, voltage int, phase float) tags(location binary(64), groupId int);"
//fmt.Printf("subThread[%d]: create table from %d to %d \n", unix.Gettid(), startTblId, endTblId)
// windows.GetCurrentThreadId()
db,err:=sql.Open(taosDriverName,url)
iferr!=nil{
fmt.Println("Open database error: %s\n",err)
os.Exit(1)
}
deferdb.Close()
fori:=startTblId;i<=endTblId;i++{
sqlStr:="create table if not exists "+dbName+"."+childTblPrefix+strconv.Itoa(i)+" using "+dbName+".meters tags('"+locations[i%maxLocationSize]+"', "+strconv.Itoa(i)+");"