示例#1
0
 def __init__(self, free_max, begin_conn, user, passwd, db, host="localhost", port=0):
     self.pool = MYSQL_C.mysql_init(free_max, begin_conn, host, user, passwd, db, port)
示例#2
0
 def connect(self):
     con = MYSQL_C.get_connection(self.pool)
     connection = Connection(con, self.pool)
     return connection
示例#3
0
 def fetch_all(self):
     return MYSQL_C.fetch_all(self.cur)
示例#4
0
 def close(self):
     MYSQL_C.cursor_close(self.cur)
示例#5
0
 def fetch_one(self):
     return MYSQL_C.fetch_one(self.cur)
示例#6
0
 def ping(self):
     return MYSQL_C.ping(self.con)
示例#7
0
 def fast_execute(self, sql):
     ret = Cursor(MYSQL_C.fast_execute(sql, len(sql), self.con))
     return ret
示例#8
0
 def query(self, sql):
     ret = MYSQL_C.query(sql, len(sql), self.con)
     return ret
示例#9
0
 def close(self):
     MYSQL_C.connect_close(self.con, self.pool)