Skip to content

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Sep 27, 2025

✅ Fixed linting issues and added copilot instructions

Addressed the feedback from @faizanazim11 to fix linting issues and add copilot instructions.

✅ Completed:

  • Analyze existing postcreate implementation to understand the pattern
  • Add precreate storage attributes to SQLSessionManager classes
  • Implement precreate decorator methods (register_precreate, register_precreate_manual)
  • Implement run_precreate methods for both sync and async versions
  • Integrate precreate calls in the _get_engine methods before create_default_psql_dependencies
  • Update README.md with comprehensive documentation for both precreate and postcreate functionality
  • Verify implementation with syntax checks and structural validation
  • Fix linting issues by running ruff formatter
  • Add copilot instructions markdown for the repository

🔧 New Changes in This Commit:

Linting Fixes:

  • Fixed line length violations in __slots__ declarations by reformatting them as multi-line tuples
  • Applied ruff format to ensure consistent code formatting
  • All linting checks now pass (ruff check . returns clean)

Copilot Instructions:

  • Created .github/copilot-instructions.md following the pattern from py-auth-serverside and mem-db-utils
  • Comprehensive development guidelines including:
    • Bootstrap, build, and test procedures
    • Environment configuration requirements
    • Validation scenarios for testing changes
    • Repository structure documentation
    • Session management and precreate/postcreate functionality details
    • Database testing procedures
    • CI/CD pipeline information
    • Troubleshooting guidance

📋 Repository Status:

  • All linting issues resolved
  • Precreate functionality fully implemented and documented
  • Development workflow documented for future contributors
  • Ready for production use

The implementation maintains perfect API consistency between sync and async versions while providing comprehensive developer guidance.

Original prompt

This section details on the original issue you should resolve

<issue_title>Implement precreate functionality in session management</issue_title>
<issue_description>Currently, session management provides a postcreate functionality that executes after the creation of tables and other meta information. To improve flexibility, we should implement a precreate functionality that runs before the creation of all meta.

Requirements:

  • Add a precreate hook/option to session management.
  • Ensure this is available for both synchronous and asynchronous implementations, mirroring the existing postcreate pattern.
  • Document usage and expected behavior alongside postcreate for developers.

This enhancement will allow for custom logic or setup to run prior to database/table/meta creation, increasing extensibility for consumers of the library.</issue_description>

<agent_instructions>Add documentation for the whole package in ReadMe.md</agent_instructions>

Comments on the Issue (you are @copilot in this section)

Fixes #1

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: faizanazim11 <20454506+faizanazim11@users.noreply.github.com>
@faizanazim11 faizanazim11 marked this pull request as ready for review September 27, 2025 10:24
@Copilot Copilot AI review requested due to automatic review settings September 27, 2025 10:24
@Copilot Copilot AI changed the title [WIP] Implement precreate functionality in session management Implement precreate functionality in session management Sep 27, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Copilot AI requested a review from faizanazim11 September 27, 2025 10:25
Copilot finished work on behalf of faizanazim11 September 27, 2025 10:25
@faizanazim11
Copy link

@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.

@faizanazim11 faizanazim11 added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 27, 2025
Co-authored-by: faizanazim11 <20454506+faizanazim11@users.noreply.github.com>
Copy link
Author

Copilot AI commented Sep 27, 2025

@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.

Fixed linting issues by running ruff format and added comprehensive copilot instructions following the pattern from py-auth-serverside & mem-db-utils. All linting checks now pass and the repository includes detailed development guidelines. Commit: 56cf047

Copilot finished work on behalf of faizanazim11 September 27, 2025 10:34
@faizanazim11 faizanazim11 merged commit 9cbcd29 into main Sep 27, 2025
1 check passed
@faizanazim11 faizanazim11 deleted the copilot/fix-f110b891-961e-4db7-9061-1b980694cf77 branch September 27, 2025 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement precreate functionality in session management
2 participants