Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

sqlphilosophy

Latest version: v0.4.0

Overview

Last scanned
24 Nov 2026
Published
24 Nov 2026
PyPI package Publisher: denverprogrammer
1 Stars
0 Forks
4 Versions
1.9K Downloads
Python Repo language

Scan summary

sqlphilosophy was last scanned on 24 Nov 2026 at version 0.4.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 4 versions; the latest 2 were published within 4 days (21–24 Nov 2026).
  • Findings: No rules fired in version 0.4.0.
  • Downloads: 1,934 downloads.

Versions

4 versions published
Versions and the rules that fired in each
VersionPublishedStatus
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

No rules fired in 0.4.0

Findings

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.

README

The publisher’s own README, as collected from the registry.

sqlphilosophy

Build PyPI version License: MIT

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

Documentation

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

What this package does

  • Repository pattern for a single mapped model (BaseRepository, AsyncBaseRepository).
  • Fluent query builders with pagination/sort (StatementQueryBuilder, ListQuery, SortConfig).
  • SQL helpers for row mapping, partial updates, and developer-defined fragments via sqlphilosophy.trusted_sql.
  • Opt-in strict row decoders via sqlphilosophy.strict for non-coercing scalars, timestamps, enums, collections, UUIDs, and recursive JSON.
  • Optional audit listeners and timestamp mixins.

What this package does not do

  • Migrations, schema design, or connection pooling configuration.
  • Authorization, multi-tenant isolation, or query sandboxing.
  • Automatic commits for normal CRUD — see Transaction ownership.

Install

pip install sqlphilosophy

Async ORM (AsyncSession) also needs greenlet:

pip install sqlphilosophy[async]

Requires Python 3.12+ and SQLAlchemy 2.x.

Quick start (sync)

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.

Package layout

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

Transaction ownership

  • *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.

Raw SQL trust boundaries

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.

Development

This repo uses uv and Ruff:

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

Security

See SECURITY.md for vulnerability reporting and SQL trust boundaries.

Releasing

See RELEASING.md for GitHub + PyPI trusted publishing. See CHANGELOG.md.

License

MIT — see LICENSE.

Expression lookups and scope overrides (0.3+)

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.

Explicit composite-key resources

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.

SQLAlchemy 2.1 migration

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.

OX Radar and Response Center

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.

Where it’s listed

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

  • pypi-releases sqlphilosophy

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Frame 2085668439 (1)
Group 1261154229