{"id":18753768,"url":"https://github.com/jvllmr/sqlalchemy-sessionload","last_synced_at":"2025-10-27T19:14:37.868Z","repository":{"id":215340334,"uuid":"732134813","full_name":"jvllmr/sqlalchemy-sessionload","owner":"jvllmr","description":"SQLAlchemy load option that loads from persisted session instances.","archived":false,"fork":false,"pushed_at":"2025-06-02T19:24:06.000Z","size":428,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-06-03T09:45:36.390Z","etag":null,"topics":["loader","plugin","sqlalchemy","sqlalchemy-orm-queries"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jvllmr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-12-15T18:22:38.000Z","updated_at":"2025-04-21T06:13:40.000Z","dependencies_parsed_at":"2024-02-02T19:28:50.057Z","dependency_job_id":"cd51789a-be13-4445-9945-c0af32215416","html_url":"https://github.com/jvllmr/sqlalchemy-sessionload","commit_stats":null,"previous_names":["jvllmr/sqlalchemy-sessionload"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvllmr%2Fsqlalchemy-sessionload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvllmr%2Fsqlalchemy-sessionload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvllmr%2Fsqlalchemy-sessionload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvllmr%2Fsqlalchemy-sessionload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jvllmr","download_url":"https://codeload.github.com/jvllmr/sqlalchemy-sessionload/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jvllmr%2Fsqlalchemy-sessionload/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259043765,"owners_count":22797160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["loader","plugin","sqlalchemy","sqlalchemy-orm-queries"],"created_at":"2024-11-07T17:27:00.468Z","updated_at":"2025-10-27T19:14:37.864Z","avatar_url":"https://github.com/jvllmr.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sqlalchemy-sessionload\n\n![PyPI - Downloads](https://img.shields.io/pypi/dd/sqlalchemy-sessionload)\n[![GitHub license](https://img.shields.io/github/license/jvllmr/sqlalchemy-sessionload)](https://github.com/jvllmr/sqlalchemy-sessionload/blob/dev/LICENSE)\n[![Codecov](https://img.shields.io/codecov/c/github/jvllmr/sqlalchemy-sessionload/dev?style=plastic)](https://app.codecov.io/gh/jvllmr/sqlalchemy-sessionload/tree/dev)\n[![Routine Checks](https://github.com/jvllmr/sqlalchemy-sessionload/actions/workflows/test.yaml/badge.svg)](https://github.com/jvllmr/sqlalchemy-sessionload/actions/workflows/test.yaml)\n\nSQLAlchemy load option that loads from persisted session instances.\n\nThe goal of this load option is to achieve performance gains in specific use-cases by not querying the database or serializing new objects and reading from cache instead. This means that you as a user need to make sure before that all of the objects you expect to find within a query are already present the session store. Use with care!\n\n## Basic usage\n\nSessionLoad is available for basic queries and relationship loading\n\nFilters and Order By constructs are also supported.\nIf you miss something you are invited to contribute.\n\nFor installation the plugin has to be registered:\n\n```python\nfrom sqlalchemy_sessionload import SQLAlchemySessionLoad\n\nSession = sessionmaker(...)\nSQLAlchemySessionLoad(Session)\n```\n\n### Simple Query\n\n```python\nfrom sqlalchemy_sessionload import SessionLoad\nfrom project.model import Message\n\n# assignment is needed\n# otherwise instances are not saved in session\nall_messages = session.query(Message).all()\n\nsession_messages = session.query(Message).options(SessionLoad(Message)).all()\n```\n\n### Load relationship\n\nJoined loading is currently only available with subqueryload.\n\n```python\nfrom sqlalchemy_sessionload import SessionRelationshipLoad\nfrom project.model import Message, User\nimport sqlalchemy.orm as sa_orm\n\n# assignment is needed\n# otherwise instances are not saved in session\nall_users = session.query(User).all()\n\n\n# users connected to messages are now loaded from session\nsession_messages = (\n    session.query(Message)\n    .options(sa_orm.subqueryload(Message.user), SessionRelationshipLoad(Message.user))\n    .all()\n)\n```\n\n## Benchmark\n\nA benchmark is available [here](https://jvllmr.github.io/sqlalchemy-sessionload/dev/bench)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvllmr%2Fsqlalchemy-sessionload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjvllmr%2Fsqlalchemy-sessionload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjvllmr%2Fsqlalchemy-sessionload/lists"}