godzie44/d3
61.4
Adequate · 21 September 2026
4.7k
lines of production code
Go
primary language
4
measurements over time
What this system is
Features
Add schema generation for ORM entities
The ORM now includes a schema builder that automatically generates SQL CREATE TABLE and CREATE INDEX statements from entity metadata. This new capability supports mapping Go types to database column types (including UUID, time, and nullable variants), handles one-to-one, one-to-many, and many-to-many relationships, and processes index annotations. The implementation is located in orm/schema/builder.go, with corresponding tests in orm/schema/builder\_test.go.
orm/schema · high confidence
Added SQLite database adapter
Users can now use SQLite as a database backend. The new adapter implements the persistence layer, supporting query execution, transaction management, and data push operations (insert, update, delete) with SQLite. A corresponding test suite validates these capabilities.
adapter/sqlite · high confidence
Initial project scaffolding and core persistence abstractions
The repository is initialized with essential project files: a MIT license, a .gitignore, and a README.md describing the D3 ORM's features and usage. The codebase introduces the foundational persistence layer, including an EntityManager (em.go) that manages entity states and an UnitOfWork (uow.go) that tracks new, dirty, and deleted entities for batched database operations. A test file (uow\_test.go) validates the UnitOfWork's commit behavior using mocks. Additionally, a .env-test-example file is added to configure the PostgreSQL test database connection.
(repo-wide) · high confidence
Introduce code generation bootstrap for ORM entities
A new bootstrap generator has been added to the ORM code generation pipeline. This tool creates temporary Go files that use reflection to extract entity metadata (including table names and index annotations) and produce the final generated code. The implementation includes support for index annotations and field setters, and the generator now correctly handles entities that lack index annotations.
orm/gen/bootstrap · high confidence
Introduce d3 code generation tool and parser
The d3 tool, previously located in the cmd directory, has been moved to a new d3 directory. This change includes the main entry point for the tool, a Go parser for analyzing source files, and a helper for extracting module paths from go.mod files. The parser now supports index annotations (d3\_index: and d3\_index\_unique:) in addition to existing entity and table annotations, enabling the generation of ORM mappings for indexed fields.
d3 · high confidence
Introduce pgx database driver with connection pool support
The pgx adapter has been refactored into a dedicated driver package, providing both single-connection and connection-pool initialization methods. The driver now supports UUID and index annotations, and includes a Close method for proper resource cleanup. Tests have been added to verify query execution, transactional insert, update, delete, and rollback operations.
adapter/pgx · high confidence
Behavioural changes
Introduce new persistence layer with graph-based execution
The persistence module has been refactored to use a graph-based execution model for database operations. A new \PersistGraph\ constructs a directed acyclic graph of \CompositeAction\ nodes (inserts, updates, removes) from entity relationships, ensuring correct execution order and handling dependencies. The \executor\ traverses this graph, respecting subscription dependencies between actions. This replaces the previous linear or reflection-based persistence logic with a structured approach that supports complex entity graphs, including one-to-one, one-to-many, and many-to-many relationships, while also introducing a \Pusher\ interface to abstract database interactions.
orm/persistence · high confidence
Refactor ORM to use explicit Session and Context-based API
The ORM API has been refactored to require an explicit Session, which is now passed via context rather than being held directly in the Repository. Repository methods like FindOne, FindAll, and Persists now accept a context and return a typed Collection instead of raw slices. The Unit of Work is now internal to the session, and the Orm struct exposes MakeSession and MakeRepository to support this new flow. Additionally, the storage interface has been renamed to Driver, and the hydrator and extractor logic has been updated to work with the new collection and session structures.
orm · high confidence
Refactored SQL query builder and removed legacy database adapters
The SQL query builder has been refactored to support nested WHERE conditions and simplified query construction, while the legacy Go-PostgreSQL and Go-PostgreSQL-X adapters have been removed from the codebase.
adapter · high confidence
Refactored entity and collection handling with new Cell and Collection types
The ORM entity package was restructured to replace the previous reflection-based \WrappedEntity\ interface with a new \Cell\ struct that wraps entity instances, supporting both eager and lazy initialization patterns. Similarly, the \Collection\ type now encapsulates entity slices with explicit \Add\, \Get\, \Count\, and \Empty\ methods, replacing the previous slice-based approach. The \MetaInfo\ structure was updated to include \EntityName\, \Indexes\, and \Tools\ for field extraction and comparison, while relation handling now uses explicit \OneToOne\, \OneToMany\, and \ManyToOne\ structs with \DeleteStrategy\ support. The \CreateMeta\ function was renamed to \NewMeta\ and now requires entities to implement the \D3Entity\ interface, shifting metadata extraction to code generation. Tests were updated to reflect these new APIs, including iterator support for collections.
orm/entity · high confidence
Refactored query builder API and structure
The query builder has been refactored to use a more explicit, field-based API. The previous \Where\ method, which accepted raw SQL expressions, has been replaced by \Where\, \AndWhere\, and \OrWhere\ methods that take a field name, operator, and parameters. Nested conditions are now handled via \AndNestedWhere\ and \OrNestedWhere\. The \Query\ struct was moved to \builder.go\ and simplified, while the old \q.go\ file was removed. The \FetchPlan\ was also updated to expose \PKs\ instead of \EntityIds\ and added \NoNestedWhere\ and \WhereExprCount\ methods.
orm/query · high confidence
Removed generic collection abstraction
The generic collection abstraction in the mapper package has been removed. This included the \Collection\ interface and its implementations (\baseCollection\, \EagerCollection\, and \lazyCollection\), which previously provided a unified way to manage and access collections of interfaces.
mapper · high confidence
Removed reflection-based entity helper functions
The 'reflect' package's 'funcs.go' and 'funcs\_test.go' files have been deleted. This removes runtime reflection utilities such as 'GetFirstElementFromSlice', 'CreateEmptyEntity', 'CreateSliceOfEntities', 'BreakUpSlice', 'IntoStructType', and 'FullName'. These functions previously used Go's 'reflect' package to manipulate entity types and slices, and their removal indicates a shift away from reflection-based entity handling in this module.
reflect · high confidence
Replace reflection-based entity operations with generated code
The ORM code generator in the \orm/gen\ package now produces specialized Go code for entity field extraction, setting, comparison, copying, and instantiation, replacing the previous reflection-based implementations. This change introduces new generated functions (e.g., \\_\_d3\makeFieldExtractor\, \\\_d3\makeFieldSetter\, \\\_d3\makeComparator\, \\\_d3\makeCopier\, \\\_d3\_makeInstantiator\) that provide type-safe, high-performance alternatives to reflection for common ORM operations.
orm/gen · high confidence
Test coverage
Add integration tests for the query builder; Added benchmark suite for ORM performance testing; Added integration tests for schema generation and type handling; Added integration tests for the identity map cache; Added test helpers for database integration testing; Integration tests for ORM relations; Integration tests for the persistence layer; Removal of legacy integration test suites; Removed obsolete database adapter helper.
Dependencies
Updated Go dependencies and module path
The project's Go module path was changed to github.com/godzie44/d3. Several dependencies were added or updated: gofrs/uuid v3.2.0, jackc/pgconn v1.2.1, jackc/pgtype v1.1.0, and golang.org/x/sync. The lib/pq driver was removed and replaced with jackc/pgx/v4 v4.2.1.
(dependencies) · medium confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 64 → 61 (-2.2)
- Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 90 → 93 (+3.8)
- Architecture 100 → 77 (-23.0)
- Maturity 50 → 50 (+0.0)
- Readiness 64 → 64 (-0.3)
- Security 83 → 77 (-6.1)
Resolved (20)
- Coverage not included — suite not readable by the collector
- Dependency hygiene not measured — dependency manifest found but not parsed for hygiene
- Duplicated block (10 lines × 2) (orm/persistence/graph.go)
- Duplicated block (11 lines × 2) (adapter/pgx/gopgx.go)
- Duplicated block (11 lines × 2) (orm/gen/comparator.go)
- Duplicated block (12 lines × 2) (adapter/pgx/gopgx.go)
- Duplicated block (12 lines × 2) (orm/persistence/graph.go)
- Duplicated block (14 lines × 2) (orm/persistence/graph.go)
- Duplicated block (15 lines × 2) (orm/entity/relation.go)
- Duplicated block (16 lines × 2) (adapter/pgx/gopgx.go)
- Duplicated block (9 lines × 2) (adapter/pgx/gopgx.go)
- Duplicated block (9 lines × 3) (orm/entity/relation.go)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- High: security finding (details withheld)
- No exposed public API
- OSV Dependency Vulnerabilities not included (check did not complete)
- Test reliability not included
- single-maintainer — knowledge-concentration (bus factor) risk
New (56)
- Critical CVE: [GHSA redacted] (go.mod)
- Dependency pinned to a stale untagged commit: golang.org/x/sync
- Documentation: no installation or build instructions (README.md)
- Documentation: no usage examples (README.md)
- Duplicated block (10 lines × 2) (adapter/pgx/gopgx.go)
- Duplicated block (12 lines × 2) (orm/persistence/graph.go)
- Duplicated block (13 lines × 2) (adapter/pgx/gopgx.go)
- Duplicated block (13 lines × 2) (orm/entity/tag.go)
- Duplicated block (13 lines × 2) (orm/entity/tag.go)
- Duplicated block (13 lines × 2) (orm/gen/comparator.go)
- Duplicated block (15 lines × 2) (adapter/pgx/gopgx.go)
- Duplicated block (16 lines × 2) (adapter/pgx/gopgx.go)
- Duplicated block (16 lines × 2) (orm/persistence/graph.go)
- Duplicated block (20 lines × 2) (orm/entity/relation.go)
- Duplicated block (21 lines × 2) (orm/persistence/graph.go)
- Duplicated block (8 lines × 2) (adapter/pgx/gopgx.go)
- Duplicated block (8–9 lines × 3) (orm/entity/relation.go)
- Duplicated block (9 lines × 2) (adapter/pgx/gopgx.go)
- High CVE: [GHSA redacted] (go.sum)
- High CVE: [GHSA redacted] (go.sum)
- …and 36 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
godzie44/d3 was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 0bb840383815b129cc0c61c9a58ca5ffbb6b3ffe — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.