Implement precreate functionality in session management#2
Conversation
Co-authored-by: faizanazim11 <20454506+faizanazim11@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR implements precreate functionality in session management to allow custom logic execution before database/table/meta creation, mirroring the existing postcreate pattern. It also adds comprehensive package documentation to the README.
- Added precreate hooks with both automatic and manual execution modes
- Implemented identical functionality for both sync and async session managers
- Updated README with complete package documentation including detailed hook usage examples
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sql_db_utils/session_management.py | Added precreate storage attributes, decorator methods, and execution logic to sync session manager |
| sql_db_utils/asyncio/session_management.py | Added identical precreate functionality with proper async/await patterns to async session manager |
| README.md | Added comprehensive documentation for session management hooks with usage examples and execution order |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@copilot - Fix linting issues by running pre-commit and add copilot instructions markdown for the repo. Take inspiration from py-auth-serverside & mem-db-utils. |
Co-authored-by: faizanazim11 <20454506+faizanazim11@users.noreply.github.com>
Fixed linting issues by running |
✅ Fixed linting issues and added copilot instructions
Addressed the feedback from @faizanazim11 to fix linting issues and add copilot instructions.
✅ Completed:
🔧 New Changes in This Commit:
Linting Fixes:
__slots__declarations by reformatting them as multi-line tuplesruff formatto ensure consistent code formattingruff check .returns clean)Copilot Instructions:
.github/copilot-instructions.mdfollowing the pattern frompy-auth-serversideandmem-db-utils📋 Repository Status:
The implementation maintains perfect API consistency between sync and async versions while providing comprehensive developer guidance.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.