feat(v2): rewrite completo — Fase 0–4 con ORM y multi-dialecto#10
Merged
Conversation
0435fd1 to
3a0e864
Compare
Consolida en un solo commit el trabajo de los PRs #5–#9 (cuyas ramas quedaron divergentes tras varios force-pushes para fix de CI). El detalle por fase vive en los PRs cerrados. Fase 0 — Seguridad y estructura - Paquete `shiba/` modular con core/ agnóstico y dialects/. - SQL injection cerrada: valores parametrizados, identificadores validados y citados por dialecto. - Catálogo `SHIBA-XYZW` de error codes con mapper desde drivers. - Excepciones tipadas, transacciones explícitas, context manager. - `shibamysql/` shim deprecated. - Tooling: pyproject.toml, ruff, mypy --strict, pytest, CI. Fase 1 — Query builder rico - `or_where`, `where_in/not_in/null/not_null/like/between`, `where_group(callback)`, `where_json(col, path, value)`. - `group_by`, `having`, `find`, `exists`, `pluck`, agregados. - `paginate`, `chunk`, `iterate`. - `upsert(data, on=[...])`, `truncate`, `raw` escape hatch. Fase 1.5 — ORM híbrido tipado - `Model` con metaclass que lee anotaciones por MRO con `inspect.get_annotations(eval_str=True)`. - 12 subclases de `Field` (PrimaryKey, String, Json, DateTime, DecimalField, Enum, ForeignKey, ...) e inferencia automática. - `ModelQuery[T]` hidrata filas a instancias. - Conexión global (`set_default_connection`) o por clase (`__db__`). Fase 2 — PostgreSQL - Dialect con doble comilla, `JSONB`, `BYTEA`, `TIMESTAMP`, `GENERATED ALWAYS AS IDENTITY`, `ON CONFLICT DO UPDATE`. - Driver psycopg3 con import perezoso (dep opcional). - `shiba.connect("mysql://...")`/`postgres://...` factory. Fase 4 — Tests de integración - 7 tests sobre MySQL 8 y Postgres 16 con Testcontainers, marker `integration`, job CI separado. Stats - 114 unit tests + 7 integration verdes (39s end-to-end). - ruff y mypy --strict limpios sobre 25 archivos. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumen
Consolida en un commit el trabajo de los PRs #5–#9. Sus ramas quedaron divergentes tras varios force-pushes para arreglar la nueva versión de ruff; las cerré con "merged to base" para preservar historia.
Esta PR trae el árbol completo verde a `main`.
Por fase
shiba/modular, SQL injection cerrada, catálogoSHIBA-XYZWde errors codes, excepciones tipadas, transacciones, context manager, tooling (ruff/mypy/pytest/CI).or_where,where_in/null/between/like,where_group(cb),where_json,group_by/having,find/exists/pluck, agregados,paginate/chunk/iterate,upsert(..., on=[...]),truncate,raw.Modelcon metaclass +fields.*con 12 subclases +ModelQuery[T]hidratado +set_default_connection.JSONB,BYTEA,TIMESTAMP,GENERATED ALWAYS AS IDENTITY,ON CONFLICT DO UPDATE.shiba.connect(dsn)factory.integration, job CI separado.Test plan
Histórico
Los PRs #5–#9 quedan cerrados como referencia del paso a paso:
🤖 Generated with Claude Code