summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/provision.py
diff options
context:
space:
mode:
authorTony Locke <tlocke@tlocke.org.uk>2020-08-02 15:19:26 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-08-18 11:12:16 -0400
commit06f1929b866abc2af0ff5c838e472a8b1c98d6e6 (patch)
tree9f71fcea759c2c7a5012486d053355488782bcb8 /lib/sqlalchemy/dialects/mysql/provision.py
parentbd61d19a1c2f5d70131ed09eee69198f75d3ac44 (diff)
downloadsqlalchemy-06f1929b866abc2af0ff5c838e472a8b1c98d6e6.tar.gz
Update dialect for pg8000 version 1.16.0
The pg8000 dialect has been revised and modernized for the most recent version of the pg8000 driver for PostgreSQL. Changes to the dialect include: * All data types are now sent as text rather than binary. * Using adapters, custom types can be plugged in to pg8000. * Previously, named prepared statements were used for all statements. Now unnamed prepared statements are used by default, and named prepared statements can be used explicitly by calling the Connection.prepare() method, which returns a PreparedStatement object. Pull request courtesy Tony Locke. Notes by Mike: to get this all working it was needed to break up JSONIndexType into "str" and "int" subtypes; this will be needed for any dialect that is dependent on setinputsizes(). also includes @caselit's idea to include query params in the dbdriver parameter. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Closes: #5451 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5451 Pull-request-sha: 639751ca9c7544801b9ede02e6cbe15a16c59c82 Change-Id: I2869bc52c330916773a41d11d12c297aecc8fcd8
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/provision.py')
-rw-r--r--lib/sqlalchemy/dialects/mysql/provision.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/provision.py b/lib/sqlalchemy/dialects/mysql/provision.py
index b86056da6..bbe752d78 100644
--- a/lib/sqlalchemy/dialects/mysql/provision.py
+++ b/lib/sqlalchemy/dialects/mysql/provision.py
@@ -9,7 +9,7 @@ from ...testing.provision import temp_table_keyword_args
@generate_driver_url.for_db("mysql", "mariadb")
-def generate_driver_url(url, driver):
+def generate_driver_url(url, driver, query):
backend = url.get_backend_name()
if backend == "mysql":
@@ -18,7 +18,10 @@ def generate_driver_url(url, driver):
backend = "mariadb"
new_url = copy.copy(url)
+ new_url.query = dict(new_url.query)
new_url.drivername = "%s+%s" % (backend, driver)
+ new_url.query.update(query)
+
try:
new_url.get_dialect()
except exc.NoSuchModuleError: