Skip to content

Better document expanding=True on a bind parameter #7517

Description

@CaselIT

From empirical testing, the new caching added in 1.4 does not seem to make use of the expanding argument on bind parameter.

This should be verified and the documentation updated and/or the parameter marked as legacy in the docs (I don't think we would need to deprecate it now, at least for the moment)

Example test script:

import sqlalchemy as sa

e = sa.create_engine("postgresql://scott:tiger@localhost/test", echo=True)
t = sa.table("user", sa.column("id"), sa.column("name"))

s = sa.select(t.c.id, t.c.name).where(t.c.id.in_(sa.bindparam("ids")))

with e.connect() as c:
    print(c.execute(s, {"ids": [1]}).all())
    print(c.execute(s, {"ids": [2, 3]}).all())
    print(c.execute(s, {"ids": [2, 3, 5]}).all())

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions