summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/hstore.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-11-22 10:59:06 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-11-22 11:26:33 -0500
commitd3a4e96196cd47858de072ae589c6554088edc24 (patch)
tree7ef233ee6f106e1e70a1aed5166f09f4d5960196 /lib/sqlalchemy/dialects/postgresql/hstore.py
parent0b95f0055be252b13e99b0a944466f60b5e367ff (diff)
downloadsqlalchemy-d3a4e96196cd47858de072ae589c6554088edc24.tar.gz
Support lightweight compiler column elements w/ slots
the _CompileLabel class included ``__slots__`` but these weren't used as the superclasses included slots. Create a ``__slots__`` superclass for ``ClauseElement``, creating a new class of compilable SQL elements that don't include heavier features like caching, annotations and cloning, which are meant to be used only in an ad-hoc compiler fashion. Create new ``CompilerColumnElement`` from that which serves in column-oriented contexts, but similarly does not include any expression operator support as it is intended to be used only to generate a string. Apply this to both ``_CompileLabel`` as well as PostgreSQL ``_ColonCast``, which does not actually subclass ``ColumnElement`` as this class has memoized attributes that aren't worth changing, and does not include SQL operator capabilities as these are not needed for these compiler-only objects. this allows us to more inexpensively add new ad-hoc labels / casts etc. at compile time, as we will be seeking to expand out the typecasts that are needed for PostgreSQL dialects in a subsequent patch. Change-Id: I52973ae3295cb6e2eb0d7adc816c678a626643ed
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/hstore.py')
0 files changed, 0 insertions, 0 deletions