Skip to content

xupeng/cozydb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cozydb is a cozy mysqlclient wrapper.

Features:

  1. Automatically reconnect to MySQL server after disconnectted.
  2. Fetch results as dictionary without using DictCursor
  3. Support execute retry

Example:

from cozydb import CozyStore
store = CozyStore(host='server', port=3306, user='test', passwd='test',
                  db='test')
cursor = store.get_cursor()
cursor.execute('select name from person where id=%s', (100,))
cursor.fetchall(as_dict=True)

cozydb.CozyStore has the same params as MySQLdb.connect and cozydb.CozyCursor has the same interfaces as MySQLdb.cursors.Cursor, so it's easy to replace your cursors with CozyCursor and have the cozy features.

About

cozydb is a cozy MySQL-python wrapper

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages