jiOnederfull / onederfull-python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

onederfull-python

class

pymysql 구조

conn = pymysql.connect()
cur = conn.cursor()
cur.execute()
cur.fetchall() # only for select
conn.commit()
conn.close()

example

import pymysql
conn = pymysql.connect(host = config.host,
                             port = config.port,
                             user = config.user,
                             password = config.password,
                             db = config.db,
                             charset = config.charset
                             )
try:
    with conn.cursor() as cursor:
        sql = 'select * from table'
        cursor.execute(sql)
        result = cursor.fetchall()
    conn.commit()
finally:
    conn.close()

data model

Datetime

About


Languages

Language:Python 100.0%