Changing the database default values to the python None

This commit is contained in:
zhipz 2024-07-16 09:11:24 +08:00
parent 80611e553c
commit 0d8caf8dd9
1 changed files with 5 additions and 5 deletions

View File

@ -537,21 +537,21 @@ class TDCom:
tdLog.info("cfgPath: %s" % 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)
# print(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()
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()
# print(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()
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)
return newTdSql