Exemplo n.º 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)
Exemplo n.º 2
0
 def connect(self):
     con = MYSQL_C.get_connection(self.pool)
     connection = Connection(con, self.pool)
     return connection
Exemplo n.º 3
0
 def fetch_all(self):
     return MYSQL_C.fetch_all(self.cur)
Exemplo n.º 4
0
 def close(self):
     MYSQL_C.cursor_close(self.cur)
Exemplo n.º 5
0
 def fetch_one(self):
     return MYSQL_C.fetch_one(self.cur)
Exemplo n.º 6
0
 def ping(self):
     return MYSQL_C.ping(self.con)
Exemplo n.º 7
0
 def fast_execute(self, sql):
     ret = Cursor(MYSQL_C.fast_execute(sql, len(sql), self.con))
     return ret
Exemplo n.º 8
0
 def query(self, sql):
     ret = MYSQL_C.query(sql, len(sql), self.con)
     return ret
Exemplo n.º 9
0
 def close(self):
     MYSQL_C.connect_close(self.con, self.pool)