Scan your whole stack
From OX Research Newsroom
Are you using sqlphilosophy?
Find out what’s in your code.
Scan your apps free in minutes (opens in a new tab)Latest version: v0.4.0
sqlphilosophy was last scanned on 24 Nov 2026 at version 0.4.0. Risk score 0 of 100. No malicious behavior was detected.
| Version | Published | Status |
|---|---|---|
| 0.4.0 LATEST | 24 Nov 2026 | No rules fired |
| 0.3.6 | 21 Nov 2026 | No rules fired |
| 0.3.4 | 21 Oct 2026 | No rules fired |
| 0.3.3 | 21 Oct 2026 | Not shown |
Findings for v0.4.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.
The score describes 0.4.0; other versions have their own rules, not their own score.
The publisher’s own README, as collected from the registry.
Current source and planned customer-subdomain impact: current-state summary.
Portable SQLAlchemy repository kit: sync and async CRUD, fluent statement builders, sort/pagination, Core SQL helpers, and optional audit listeners.
| PyPI | sqlphilosophy |
| GitHub | SignalSafeSoftware/sqlphilosophy |
| Import | sqlphilosophy (__version__ only) — use explicit submodules for APIs |
| Python | 3.12+ |
| License | MIT — see LICENSE |
| Resource | Description |
|---|---|
| Repository guide | Entry point: overview, transaction model, links to usage pages |
| Usage examples | Focused sync/async code examples by feature area |
| Strongly typed repositories | Typed subclasses, factories, protocols, and service patterns |
| Service factory composition | Compose sqlPhilosophy SQL repos with servicePhilosophy business services |
| Before/after SQLAlchemy | Migration examples: direct SQLAlchemy vs repository-centered code |
| Feature matrix | Full sync/async capability map |
| Typed repository (sync) | Runnable factory + domain repo example |
| Typed repository (async) | Async counterpart |
BaseRepository, AsyncBaseRepository).StatementQueryBuilder, ListQuery, SortConfig).sqlphilosophy.trusted_sql.sqlphilosophy.strict for non-coercing
scalars, timestamps, enums, collections, UUIDs, and recursive JSON.pip install sqlphilosophy
Async ORM (AsyncSession) also needs greenlet:
pip install sqlphilosophy[async]
Requires Python 3.12+ and SQLAlchemy 2.x.
from sqlalchemy import String, create_engine
from sqlalchemy.orm import DeclarativeBase, Mapped, Session, mapped_column, sessionmaker
from sqlphilosophy.sorting import ListQuery
from sqlphilosophy.sync.repository import BaseRepository
class Base(DeclarativeBase):
pass
class Widget(Base):
__tablename__ = "widget"
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[str] = mapped_column(String(64))
engine = create_engine("sqlite:///:memory:", future=True)
Base.metadata.create_all(engine)
SessionLocal = sessionmaker(bind=engine, expire_on_commit=False)
with SessionLocal() as session:
repo = BaseRepository(Widget, session)
repo.create(name="alpha") # stages + flush; does not commit
session.commit()
rows, total = repo.statement().fetch_page(ListQuery.from_page(page=1, size=20))
assert total >= 1
Async: use AsyncSession, AsyncBaseRepository from sqlphilosophy.aio.repository, and await on repository/builder terminals. See the repository guide.
| Module | Contents |
|---|---|
sqlphilosophy |
__version__ only |
sqlphilosophy.types |
Portable typing aliases |
sqlphilosophy.sql |
Row mapping, partial updates, Core helpers (re-exports trusted_sql) |
sqlphilosophy.strict |
Opt-in non-coercing row decoders and strict JSON validation |
sqlphilosophy.trusted_sql |
Developer-trusted SQL fragments — see SECURITY.md |
sqlphilosophy.sorting |
ListQuery, SortConfig, SortSpec |
sqlphilosophy.sync / sqlphilosophy.aio |
Repositories, query builders, factory protocols |
sqlphilosophy.audit |
Optional listeners and timestamp mixins |
create / add / update_partial / remove / `delete_/update_where` — flush or execute DML; caller commits**.delete_all() — bulk delete; does not commit.batched_purge_ids(..., batch_size=...) — deletes in batches and commits after each batch; requires batch_size >= 1. Authorize in application code first.Identifiers and SQL fragments (table/column names, ORDER BY text, sort allowlists) must be developer-defined, never built from end-user input. User values use bind parameters.
Import trusted helpers from sqlphilosophy.trusted_sql (sql_table, col_eq, col_icontains, col_range, literal_order_expr, …). The same names are re-exported from sqlphilosophy.sql. Details: SECURITY.md and the repository guide.
uv sync --extra dev
uv run pytest
uv run ruff check src tests docs/examples
uv run ruff format src tests docs/examples
# Optional: validate runnable docs examples (SQLite in-memory; CI runs these in smoke-package)
uv run --extra dev python docs/examples/typed_repository_sync.py
uv run --extra dev python docs/examples/typed_repository_async.py
uv run python -m build
See SECURITY.md for vulnerability reporting and SQL trust boundaries.
See RELEASING.md for GitHub + PyPI trusted publishing. See CHANGELOG.md.
MIT — see LICENSE.
Both repository bases provide find_entity(criteria=..., lock=False), find_row(criteria=..., columns=..., lock=False) and count_scoped(criteria=...). Criteria must not be empty; projected lookups also require columns. Entity lookups return a mapped object, projected lookups return RowMapping, and absence returns None. These methods never commit.
Override apply_scope(statement) for additional predicates on these helpers. It runs after projection initialization, because select_columns/select_entity reset the builder's SELECT. This hook does not implicitly scope existing CRUD helpers or arbitrary builder calls: keep ownership checks in named application repository methods. Existing first, get_by_id, count and statement APIs remain available and unchanged.
The verified 0.3.5 release includes these lookup APIs, strict decoders, explicit
composite identities, repository registration and UNION/subquery composition. Use a named application
repository method to own each model-specific projection, ordering and policy;
compose its query with statement() or these lookup helpers instead of
scattering select() calls through controllers/services. Core SQL helpers remain
available for explicit SQL boundaries; a repository does not supply authorization.
The supported dependency range remains SQLAlchemy 2.x. DeliveryPlus native's 2.0.49 constraint and RuleAtlas's separate 2.1.5 minimum are host decisions; upgrading this package does not silently change either host lock. Coordinated candidate verification exercises both SQLAlchemy versions before release.
sqlphilosophy.sync.composite.CompositeRepository is an opt-in repository for mapped composite primary keys. It validates complete ordered identities and preserves caller-owned transactions, scoped reads, locks and writable allowlists. Existing BaseRepository and asynchronous scalar APIs are unchanged. ApiPhilosophy resource adapters select this repository only through an explicit host composite_repository(model) resolver.
Repository-owned projections may compose same-session selections with
first.union_all(second).as_subquery("combined") and use the returned .c columns
in another repository statement. The UNION builder snapshots both scoped arms; it
does not add scopes or change either arm. Apply each repository's visibility scope
before composition. Column counts must agree and conflicting explicit bound
parameters are rejected. as_subquery() preserves bound values. Sync and async
builders support the same API; execute the outer projection through its builder.
Version 0.4.0 requires SQLAlchemy >=2.1.9,<2.2. SQLAlchemy now types a single selected model as Select[Model] instead of Select[tuple[Model]]. Public composed statements use variadic row annotations; callers should use repository scalars()/find_entity() for model results and explicit row decoders for projections. Query execution, repository scopes, locks and caller-owned transactions are unchanged. Keep the 0.3.x release for SQLAlchemy 2.0 applications.
Find threats in your stack.
OX Radar can check high-priority threats, like critical package CVEs, against your context.
Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.
The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).
The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.