Explicit Joins in SQLAlchemy

Explicit joins in SQLAlchemy! What this means is that we are showing what the join conditions are within the ORM query itself, rather than built into your model classes.

Here’s the ORM query with explicit joins:

    join_results = (
        db.session.query(TableA).filter_by(table_a_col=some_var)
            .join(TableB, TableB.table_a_id == TableA.id)
            .all()
    )

原文链接:Explicit Joins in SQLAlchemy

© 版权声明
THE END
喜欢就支持一下吧
点赞6 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容