[Sqlalchemy-tickets] Issue #3981: When using with_variant() using custom type containing bind_expre
Brought to you by:
zzzeek
From: Martin W. <iss...@bi...> - 2017-05-09 11:34:59
|
New issue 3981: When using with_variant() using custom type containing bind_expression and col_expression, bind_expression and col_expression are never called https://bitbucket.org/zzzeek/sqlalchemy/issues/3981/when-using-with_variant-using-custom-type Martin Webb: When using `with_variant()` to specify a custom column (decorated type) for the dialect variant, implementations of `bind_expression` and `col_expression` are never called. Attached file `test.py` contains a minimal example showing this in action. Expected behaviour is that the INSERT query fails as it uses functions unavailable in SQLite, however `bind_expression` and `col_expression` are never called to make the SQL-level changes to apply these functions. Obviously I'm not expecting the INSERT queries to actually work in SQLite because those functions don't exist, but I've written the example this way to demonstrate that the SQL-level overrides are never getting called. The real world use case for this is that I'm trying to have a variant type apply for MySQL that uses `COMPRESS()` and `UNCOMPRESS()` while for local testing with SQLite the data is stored unchanged. SQLAlchemy version: 1.1.9 Reproduced in: - Python 2.7.10 on Mac OS X 10.11.6 - Python 2.7.3 on Debian Wheezy |