Skip to main content

schema-first-query

PyPI version Python versions License: MIT Coverage Checked with mypy

Introspect a live database and get typed, autocomplete-friendly query helpers — no ORM, no model classes, no boilerplate.


Motivation

Python developers working with relational databases face an uncomfortable tradeoff. Raw SQL with dict rows is fast and flexible, but offers no type safety, no IDE autocomplete, and fragile string-key access that breaks silently when columns are renamed. Full ORMs like SQLAlchemy or Django ORM are typed and ergonomic, but they require maintaining Python model classes that duplicate the database schema — a form of drift-prone redundancy that grows more painful as the schema evolves.

The middle ground — lightweight query builders like SQLAlchemy Core or PyPika — reduces boilerplate but still returns untyped rows, or requires you to write TypedDict definitions by hand. Either way, the schema lives in two places: the database and your Python code.

schema-first-query eliminates that duplication. It connects to your database (or reads your SQL migration files), introspects the schema once, and generates TypedDict or dataclass types on the fly. Your IDE sees fully typed results with autocomplete. Your code stays DRY. The database schema remains the single source of truth — exactly as it should be in a database-first workflow.


Installation

Metadata

Release files for schema-first-query 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for schema-first-query 0.1.0
File Size Uploaded Provenance Actions
schema_first_query-0.1.0.tar.gz 15.0 kB Without provenance Details for schema_first_query-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for schema-first-query 0.1.0
File Interpreter ABI Platform Actions
schema_first_query-0.1.0-py3-none-any.whl Python 3 none any Details for schema_first_query-0.1.0-py3-none-any.whl

Total release size: 34.7 kB

Release files / schema_first_query-0.1.0.tar.gz

Download URL schema_first_query-0.1.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b6fb1f9d27dcb026c2657b97331e726e26cbc89e46e2ff511471c40be2e5a4c9
BLAKE2b-256 checksum
How to use checksums
dc6614f9381dc38e6cb70b83d8ee67d20927bd829752c0e91d8ef46e72d596cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.13.12 Darwin/24.6.0

Release files / schema_first_query-0.1.0-py3-none-any.whl

Download URL schema_first_query-0.1.0-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
842a3fdd57e89a8905e4614fbf5d3c5c0e79ecf2683cfcd2a2be8f1aa8f61f64
BLAKE2b-256 checksum
How to use checksums
6bf12846266d9770af2be2d7fecc31e0b359b02ea92cb4641c72e0cfa691ed3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.2.1 CPython/3.13.12 Darwin/24.6.0

Security for schema-first-query 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page