ibmdb / python-ibmdbsa

Automatically exported from code.google.com/p/ibm-db.ibm-db-sa
Apache License 2.0
40 stars 59 forks source link

Support `with_hint` for tables #150

Open c-thiel opened 1 month ago

c-thiel commented 1 month ago

with_hint currently seems to be not supported. The following snippet raises an assertion error:

from sqlalchemy import table, column, select
import ibm_db_sa

users = table("users", column("a"))
dialect = ibm_db_sa.dialect()

q = (
    select(users)
    .select_from(users)
    .where(users.c.a == 1)
    .with_hint(
        users,
        "FOR SYSTEM_TIME BETWEEN '0001-01-01-00.00.00.000000' AND '9999-12-31-00.00.00.000000'",
    )
)
q_hist = q.compile(dialect=dialect)
print(q_hist)
assert "FOR SYSTEM_TIME BETWEEN" in str(q_hist)

Is there any known workaround or plan to implement it?