1.1 regression:
from sqlalchemy import MetaData
from sqlalchemy import Column, Table
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy import String
from sqlalchemy.ext.compiler import compiles
@compiles(ARRAY, "sqlite")
def compile_binary_sqlite(type_, compiler, **kw):
return "STRING"
metadata = MetaData()
t = Table('test', metadata, Column('x', ARRAY(String)))
from sqlalchemy.dialects import postgresql
from sqlalchemy.schema import CreateTable
print CreateTable(t).compile(dialect=postgresql.dialect())
succeeds in 1.0. 1.1:
#!
sqlalchemy.exc.CompileError: (in table 'test', column 'x'): <class 'sqlalchemy.dialects.postgresql.array.ARRAY'> construct has no default compilation handler.
OK this is not really a new thing in the abstract, only because PG ARRAY now subclasses sqltypes.ARRAY. It doesn't have
__visit_name__
in__class__.__dict__
, so the compiles extension assumes it's a subclassed construct that doesn't have a user-defined compilation scheme. How to differentiate between an end-user subclass of an object that has a visitation scheme? I think just fall back to the base approach...