{"modulePath":"github.com/codefit-cli/codefit","version":"v0.2.9","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package query\n\nPackage query is codefit's neutral, format-agnostic model of a database query filter issued from application code — the CODE side of the code↔schema cross (index-vs-query), mirroring how internal/core/db models the SCHEMA side.\n\nA provider's QueryExtractor FILLS this model from source (a Prisma where clause today, another ORM/dialect later); a core cross-rule (internal/core/crossrules) CONSUMES it together with a db.Schema. The one-way dependency arrow of ADR 0014 holds: query depends on core/db (for the shared db.Pos anchor) and on nothing else; providers depend on query, never the reverse.\n\nIt speaks LOGICAL naming — the model and field names db.Table.Name and db.Column.Name carry — never the physical DB name (@@map/@map), which no query written in code ever names (ADR 0029).\n\n## Types\n\n```go\ntype QueryFilter struct {\n\t// Model is the model/table the query targets, already normalized by the provider\n\t// to the schema's naming (e.g. the Prisma Client accessor \"user\" is emitted as\n\t// \"User\").\n\tModel string\n\t// Columns are the columns the WHERE constrains, as schema field names\n\t// ([\"email\"]), in source order, deduplicated. Empty is never produced — a query\n\t// that filters no column yields no QueryFilter, there is nothing to cross.\n\tColumns []string\n\t// Composite is true when the WHERE constrains more than one column together (an\n\t// implicit or explicit AND) — the DB-013 (missing composite index) signal. A\n\t// single-column WHERE is not composite.\n\tComposite bool\n\t// Pos is the call-site anchor (file:line), reusing the schema-world anchor type\n\t// so a cross finding anchors exactly like a schema finding.\n\tPos db.Pos\n}\n```\nQueryFilter is one WHERE clause of a code-issued database query, in NEUTRAL terms — the code side of the code↔schema cross, mirroring how db.Schema is the schema side. A provider's QueryExtractor produces it; a core cross-rule (internal/core/crossrules) consumes it together with db.Schema.\n\nIt carries LOGICAL names (model / field), the same names db.Table.Name and db.Column.Name carry — never the physical DB name (@@map/@map), which no query in code ever references. The core matches Model EXACTLY against db.Table.Name and never re-normalises (all naming-convention knowledge lives in the provider that produced this — ADR 0029).\n\n","path":"github.com/codefit-cli/codefit/internal/core/query","name":"query","synopsis":"Package query is codefit's neutral, format-agnostic model of a database query filter issued from application code — the CODE side of the code↔schema cross (index-vs-query), mirroring how internal/core/db models the SCHEMA side.","isRedistributable":true}
