Skip to content

re-implement all in_() using expanding IN #4645

Closed
@zzzeek

Description

@zzzeek
Member

as mentioned at https://gist.github.com/zzzeek/dd590d0a3485b7f19cab0322c48ece36. as expanding IN works in all cases now it should be the only IN implementation.

Activity

added
big joba major change that requires a lot of knowledge and work
alchemy 2goes along with the 2.0 milestone to aid in searching
on Apr 27, 2019
added this to the 2.0 milestone on Apr 27, 2019
zzzeek

zzzeek commented on May 12, 2019

@zzzeek
MemberAuthor

this might be doable for 1.4 but need to evaluate:

# 1. expanding bound parameters in all cases
# 2. don't need "expanding", compiler knows it's the right side
#    of an in op
# 3. if the parameter *has* a value, compiler renders the
#    bound params inline anyway (makes more sense with str() of
#    queries)
# 4. if statement is to be cached, then never render params
# return BindParameter(None, args, expanding=True, type_=expr.type)
modified the milestones: 2.0, 1.4 on May 18, 2019
zzzeek

zzzeek commented on May 18, 2019

@zzzeek
MemberAuthor

compiler has a flag, "expanding_in=[auto|True|False]". StrSQLCompiler sets it to false. "auto" means if the bindparam inside of in_() has a value, we render as individual params. True is when we invoke for caching.

sqla-tester

sqla-tester commented on Dec 9, 2019

@sqla-tester
Collaborator

Mike Bayer has proposed a fix for this issue in the master branch:

Use expanding IN for all literal value IN expressions https://gerrit.sqlalchemy.org/1607

1 remaining item

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    alchemy 2goes along with the 2.0 milestone to aid in searchingbig joba major change that requires a lot of knowledge and worksql

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @zzzeek@sqla-tester

        Issue actions

          re-implement all in_() using expanding IN · Issue #4645 · sqlalchemy/sqlalchemy