<!-- Provide a general summary of your proposed changes in the Title field above -->
### Description
<!-- Describe your changes in detail -->
Added the `"uuid"` key to `ischema_names` to enable lookup of `UUID` columns in reflection. There's also a new short test (MariaDB 10.7+ only) in the mysql reflection tests to verify if this feature works correctly.
Fixes #10028
### Checklist
<!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once)
-->
This pull request is:
- [ ] A documentation / typographical error fix
- Good to go, no issue or tests are needed
- [x] A short code fix
- please include the issue number, and create an issue if none exists, which
must include a complete example of the issue. one line code fixes without an
issue and demonstration will not be accepted.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests. one line code fixes without tests will not be accepted.
- [ ] A new feature implementation
- please include the issue number, and create an issue if none exists, which must
include a complete example of how the feature would look.
- Please include: `Fixes: #<issue number>` in the commit message
- please include tests.
**Have a nice day!**
Closes: #10029
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/10029
Pull-request-sha:
7c2838b1dd5a34166158f5e241af72a6d3d8be85
Change-Id: Ifa1f51f472809b35374a7e2c6b85412046133452
--- /dev/null
+.. change::
+ :tags: usecase, mariadb, reflection
+ :tickets: 10028
+
+ Allowed reflecting :class:`_types.UUID` columns from MariaDB. This allows
+ Alembic to properly detect the type of such columns in existing MariaDB
+ databases.
from ...types import BLOB
from ...types import BOOLEAN
from ...types import DATE
+from ...types import UUID
from ...types import VARBINARY
from ...util import topological
"tinyblob": TINYBLOB,
"tinyint": TINYINT,
"tinytext": TINYTEXT,
+ "uuid": UUID,
"varbinary": VARBINARY,
"varchar": VARCHAR,
"year": YEAR,
self._run_test(metadata, connection, specs, ["enums"])
+ @testing.only_on("mariadb>=10.7")
+ def test_uuid(self, metadata, connection):
+ specs = [
+ (mysql.UUID(), mysql.UUID()),
+ ]
+ self._run_test(metadata, connection, specs, [])
+
class ReflectionTest(fixtures.TestBase, AssertsCompiledSQL):
__only_on__ = "mysql", "mariadb"