Improve pymysql instrumentation examples (#3472)
This commit is contained in:
parent
e6869cdc75
commit
02dc87ef73
|
|
@ -31,12 +31,12 @@ Usage
|
|||
|
||||
cnx = pymysql.connect(database="MySQL_Database")
|
||||
cursor = cnx.cursor()
|
||||
cursor.execute("INSERT INTO test (testField) VALUES (123)"
|
||||
cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
|
||||
cursor.execute("INSERT INTO test (testField) VALUES (123)")
|
||||
cnx.commit()
|
||||
cursor.close()
|
||||
cnx.close()
|
||||
|
||||
|
||||
.. code:: python
|
||||
|
||||
import pymysql
|
||||
|
|
@ -53,7 +53,8 @@ Usage
|
|||
}
|
||||
)
|
||||
cursor = instrumented_cnx.cursor()
|
||||
cursor.execute("INSERT INTO test (testField) VALUES (123)"
|
||||
cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
|
||||
cursor.execute("INSERT INTO test (testField) VALUES (123)")
|
||||
instrumented_cnx.commit()
|
||||
cursor.close()
|
||||
instrumented_cnx.close()
|
||||
|
|
@ -75,12 +76,12 @@ Usage
|
|||
|
||||
cnx = pymysql.connect(database="MySQL_Database")
|
||||
cursor = cnx.cursor()
|
||||
cursor.execute("INSERT INTO test (testField) VALUES (123)"
|
||||
cursor.execute("CREATE TABLE IF NOT EXISTS test (testField INTEGER)")
|
||||
cursor.execute("INSERT INTO test (testField) VALUES (123)")
|
||||
cnx.commit()
|
||||
cursor.close()
|
||||
cnx.close()
|
||||
|
||||
|
||||
For example,
|
||||
::
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue