Thank you for your interest in contributing to SQLNotify. This document provides guidelines and instructions for contributions.
- Python 3.10 or higher
- uv package manager
- Docker and Docker Compose (for running tests with the supported databases)
- Fork and clone the repository:
git clone https://github.com/Daniel-Brai/SQLNotify.git sqlnotify
cd sqlnotify- Install dependencies
# Using make
make install-dev
# Use uv
uv sync --all-groups --extra all- Activate the virtual environment
source .venv/bin/activate- Set up pre-commit hooks
I know you might be asking why. Just because it will save me time and effort and no I don't want to argue about it or run it in CI :)
uv run pre-commit install# Using make (recommended - runs in Docker with all the supported databases)
make test
# Or directly with pytest
uv run pytest# Using make
make test_cov
# Or directly with pytest
uv run pytest --cov=sqlnotify --cov-report=htmlSQLNotify follows Python best practices and uses automated tools to maintain code quality:
- Ruff for linting and formatting
- Isort for import sorting
- Black for code formatting
- Mypy for type checking
- Bandit for security checks
Note when commit your changes pre-commit hooks run automatically.
sqlnotify/
├── src/sqlnotify/ # Main package
│ ├── notifiers/ # Notifier implementations
│ │ └── dialects/ # Database dialect implementations
│ │ ├── base.py # Abstract base dialect
│ │ ├── postgresql.py # PostgreSQL dialect
│ │ └── sqlite.py # SQLite dialect
│ ├── adapters/ # Framework adapters (ASGI, etc.)
│ ├── types.py # Type definitions
│ └── watcher.py # Watcher configuration
├── tests/ # Test suite
│ ├── e2e/ # End-to-end integration tests
│ └── test_*.py # Unit tests
└── docs/ # Documentation for specific features
When contributing, please update documentation as needed. This includes:
- README.md - For user-facing feature changes
- docs/*.md - For detailed documentation if necessary
- Docstrings - For all APIs it makes it easier for me to hover and just see what the function does without having to navigate to the function definition. This is especially important for public APIs and complex internal functions or methods.
- Type hints - For all function signatures
- Make sure your use clear and concise language
- Include code examples if applicable
- Also, document the parameters, return values, and exceptions of functions, methods or classes if applicable in your docstrings
- Ensure all tests pass:
make test - Update documentation if necessary
- Add entries to relevant docs if needed
- Write clear commit messages
- Create a feature branch:
git checkout -b feature/my-new-feature- Make your changes and commit:
git add .
git commit -m "Add feature: description of feature"- Push to your fork:
git push origin feature/my-new-feature-
Open a Pull Request on GitHub
-
Address review feedback if requested
Use clear, descriptive titles:
feat: Add support for MySQL dialectfix: Resolve memory leak in polling loopdocs: Update SQLite installation instructionstest: Add integration tests for overflow tablesrefactor: Simplify trigger SQL generation
Follow the PR template and include:
- What changes were made and why
- How to test the changes
- Any breaking changes or migration notes
- Screenshots or examples if applicable
- Check if the issue already exists
- Verify it's not a configuration problem
- Test with the latest version
- Python version
- SQLNotify version
- Database and version (PostgreSQL 14, SQLite 3.40, etc.)
- Minimal code example reproducing the issue
- Expected vs actual behavior
- Full error traceback if applicable
We welcome feature requests
- Please check if the feature has already been requested
- Clearly describe the use case and problem it solves
- Provide example(s) of how the feature would be used
- Explain why existing functionality doesn't meet the need if necessary
- Be respectful and considerate
- Communicate clearly and professionally
- Focus on constructive feedback
- Check existing issues and documentation
By contributing to SQLNotify, you agree that your contributions will be licensed under the MIT License.