dolph

A lightweight wrapper around pymysql


License
MIT-feh
Install
pip install dolph==0.5.0

Documentation

Dolph

Description

Dolph is a fork of torndb.

Dolph is a simple wrapper around PyMySQL.

Installation

pip install dolph

Usage

Connection

When using dolph, you should pass a valid DSN to Connection:

mysql = dolph.Connection("mysql://root:mysql@127.0.0.1:3306/mysql")
users = mysql.query("select * from user limit 2")
for user in users:
	print(user)

Data Source Name

Format (inspired by go-sql-driver/mysql):

mysql://[username[:password]@][host[:port]]/db[?param1=value1&...&paramN=valueN]

Fullest example:

mysql://root:mysql@127.0.0.1:3306/mysql?charset=utf-8&connect_timeout=10

The following list is parameters that can be add to the dsn string:

  • charset
  • sql_mode
  • connect_timeout
  • max_idle_time