How kykim88/sqlalchemy-filters works
Main Components
a. Core Components:
• Filters Module
• Sorting Module
• Pagination Module
• Loads Module
• Models Integration Layer
• Exceptions Handler
b. External Dependencies:
• SQLAlchemy ORM
• Supported Databases (SQLite, MySQL, PostgreSQL)
┌─────────────────────────────────────────────────────────┐
• Client Application │
• ┬─────────────────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────────┐
• SQLAlchemy Filters │
• ┌───────────┐ ┌──────────┐ ┌───────────┐ ┌─────────┐ │
• Filters │ │ Sorting │ │Pagination │ │ Loads │ │
• ┘ └──────────┘ └───────────┘ └─────────┘ │
• ┌─────────────────────────┐ │
• Models Integration │ │
• ┘ │
• ┬─────────────────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────────┐
• SQLAlchemy ORM │
• ┬─────────────────────────────────────┘
• ↓
┌─────────────────────────────────────────────────────────┐
• Database Engines │
• ┌─────────┐ ┌─────────┐ ┌──────────────┐ │
• SQLite │ │ MySQL │ │ PostgreSQL │ │
• ┘ └─────────┘ └──────────────┘ │
• ┘
Component Interactions
• Client applications making requests to SQLAlchemy Filters
• Filters/Sorting/Pagination/Loads components interacting with Models Integration
• Models Integration interfacing with SQLAlchemy ORM
• SQLAlchemy ORM connecting to database engines
Additional Elements
• Operation types (filtering, sorting, pagination, loads)
• Supported operators (is_null, is_not_null, ==, !=, etc.)
• Database support indicators
• SQLAlchemy version compatibility (1.0 - 1.4)
Implementation Details
Filters:
• Boolean operations (and, or, not)
• Field filtering
• Hybrid attribute support
Sorting:
• Multi-field sorting
• Direction control
• Nulls handling
Pagination:
• Page size
• Page number
• Total results
• Number of pages
Loads:
• Field selection
• Deferred loading
• Join handling
Notes
• Use consistent styling
• Version compatibility information
• Clear data flow directions
• Automatic join capability
• Where error handling occurs
Remember to include a note about the project's primary purpose: "Designed to expose SQLAlchemy query filtering, sorting, and pagination operations over REST APIs."