Changing the database default values to the python None
This commit is contained in:
parent
80611e553c
commit
0d8caf8dd9
|
@ -537,21 +537,21 @@ class TDCom:
|
||||||
tdLog.info("cfgPath: %s" % cfgPath)
|
tdLog.info("cfgPath: %s" % cfgPath)
|
||||||
return cfgPath
|
return cfgPath
|
||||||
|
|
||||||
def newcon(self,host='localhost',port=6030,user='root',password='taosdata', database='None'):
|
def newcon(self,host='localhost',port=6030,user='root',password='taosdata', database=None):
|
||||||
con=taos.connect(host=host, user=user, password=password, port=port, database=database)
|
con=taos.connect(host=host, user=user, password=password, port=port, database=database)
|
||||||
# print(con)
|
# print(con)
|
||||||
return con
|
return con
|
||||||
|
|
||||||
def newcur(self,host='localhost',port=6030,user='root',password='taosdata',databse='None'):
|
def newcur(self,host='localhost',port=6030,user='root',password='taosdata',database=None):
|
||||||
cfgPath = self.getClientCfgPath()
|
cfgPath = self.getClientCfgPath()
|
||||||
con=taos.connect(host=host, user=user, password=password, config=cfgPath, port=port,database='None')
|
con=taos.connect(host=host, user=user, password=password, config=cfgPath, port=port,database=database)
|
||||||
cur=con.cursor()
|
cur=con.cursor()
|
||||||
# print(cur)
|
# print(cur)
|
||||||
return cur
|
return cur
|
||||||
|
|
||||||
def newTdSql(self, host='localhost',port=6030,user='root',password='taosdata'):
|
def newTdSql(self, host='localhost',port=6030,user='root',password='taosdata', database = None):
|
||||||
newTdSql = TDSql()
|
newTdSql = TDSql()
|
||||||
cur = self.newcur(host=host,port=port,user=user,password=password)
|
cur = self.newcur(host=host,port=port,user=user,password=password, database=database)
|
||||||
newTdSql.init(cur, False)
|
newTdSql.init(cur, False)
|
||||||
return newTdSql
|
return newTdSql
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue