From 7f99c4ab55a80ee428b3466e9fa476d6ea03bfaf Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 19 Aug 2022 09:49:25 -0400 Subject: [PATCH] fix some inaccuracies in with_variant doc * the table wont create on mysql/mariadb b.c. user_name had no length * "utf-8" is not recognized by mysql/mariadb, use "utf8" * mysql or mariadb name match is determined by the URL, not the actual DB that is detected (I know I made it work that way but I forgot) * for the 1.4 backport only, will remove the "mariadb" part as we dont support that API, #8408 Fixes: #8408 Change-Id: I5b0a58a3f94a3450631e2405bd07d0a77599ae26 --- doc/build/core/type_basics.rst | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/build/core/type_basics.rst b/doc/build/core/type_basics.rst index 2f69cc649f..e6925c4029 100644 --- a/doc/build/core/type_basics.rst +++ b/doc/build/core/type_basics.rst @@ -151,16 +151,17 @@ to make use of the :paramref:`_mysql.VARCHAR.charset` parameter of user = Table( "user", metadata_obj, - Column("user_name", String, primary_key=True), + Column("user_name", String(100), primary_key=True), Column( "bio", - String(255).with_variant(VARCHAR(255, charset="utf-8"), "mysql", "mariadb"), + String(255).with_variant(VARCHAR(255, charset="utf8"), "mysql", "mariadb"), ), ) In the above table definition, the ``"bio"`` column will have string-behaviors -on all backends. On most backends it will render in DDL as ``VARCHAR``. -However on MySQL and MariaDB, it will render as ``VARCHAR(255) CHARACTER SET utf-8``. +on all backends. On most backends it will render in DDL as ``VARCHAR``. However +on MySQL and MariaDB (indicated by database URLs that start with ``mysql`` or +``mariadb``), it will render as ``VARCHAR(255) CHARACTER SET utf8``. .. seealso:: -- 2.47.2