File: __init__.py

package info (click to toggle)
python-asyncmy 0.2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 676 kB
  • sloc: python: 3,528; makefile: 40
file content (25 lines) | stat: -rw-r--r-- 574 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import MySQLdb
import pymysql
import uvloop

uvloop.install()

connection_kwargs = dict(
    host="127.0.0.1", port=3306, user="root", password="123456", autocommit=True
)
conn_mysqlclient = MySQLdb.connect(**connection_kwargs)
conn_pymysql = pymysql.connect(**connection_kwargs)
COUNT = 50000

data = [
    (
        1,
        "2021-01-01",
        "2020-07-16 22:49:54",
        1,
        "asyncmy",
        1,
    )
    for _ in range(COUNT)
]
sql = """INSERT INTO test.asyncmy(`decimal`, `date`, `datetime`, `float`, `string`, `tinyint`) VALUES (%s,%s,%s,%s,%s,%s)"""