Skip to main content

Module core

Module core 

Source
Expand description

Core types for rustango.

This crate is dependency-light on purpose: no async, no DB drivers, no proc-macros. Anything that needs to be referenced by both the macro output and the runtime lives here.

Structs§

AdminConfig
Django ModelAdmin-shape per-model admin customization. Populated by the Model derive when the struct carries #[rustango(admin(...))].
AggregateQuery
A SELECT … GROUP BY … HAVING … query. Returned rows are untyped (HashMap<String, SqlValue>) because the projection is dynamic.
Assignment
One column = value pair in an UPDATE ... SET ... clause.
BulkInsertQuery
Compiled multi-row INSERT — one round-trip for N rows.
BulkUpdateQuery
Bulk per-row UPDATE using UPDATE t SET … FROM (VALUES …). One row in the VALUES clause per input item; the PK identifies which table row to update.
CheckConstraint
Descriptor for one table-level CHECK constraint.
CompositeFkRelation
Multi-column (“composite”) foreign key relation, declared at the model level rather than the field level — single-column FKs stay in FieldSchema::relation, composite FKs live here so each participating column keeps its plain Rust type.
CountQuery
Compiled SELECT COUNT(*) — same shape as a DeleteQuery (model + where clause); the writer emits COUNT(*) projection and no LIMIT/OFFSET.
DeleteQuery
Compiled DELETE.
FieldSchema
Static description of a single column on a model.
Fieldset
One group of fields on a create/edit form (slice 10.5).
Filter
One predicate in a WHERE clause: column <op> value. Always the leaf of a WhereExpr tree.
GenericRelation
Generic (“any model”) foreign key declared at the model level — pairs a content_type_id column with an object_pk column whose values together identify a row in any registered model. The pointed-at model varies per row.
IndexSchema
Descriptor for one CREATE INDEX emitted by the migration writer.
InsertQuery
returning names columns the writer should append after RETURNING — used for Auto<T> PKs, where the row is inserted with the column omitted so Postgres’ sequence DEFAULT fires, and the assigned value is then read back into the model.
Join
A LEFT JOIN against a target model.
M2MRelation
Descriptor for one many-to-many relation declared via #[rustango(m2m(name = "tags", to = "app_tags", through = "post_tags", src = "post_id", dst = "tag_id"))].
ModelSchema
Static description of a model.
OrderClause
Single column in an ORDER BY clause. Slice 9.0b.
SearchClause
(col1 ILIKE %q% OR col2 ILIKE %q% …) — single-parameter case-insensitive substring match across multiple columns. Used by the admin’s ?q=… box.
SelectQuery
Compiled SELECT over a single model with an optional WHERE clause expressed as a WhereExpr tree.
TypedAssignment
An Assignment tagged with the model it applies to.
TypedExpr
Typed boolean expression — a TypedFilter tree composed with .and() / .or(). Constructed implicitly from any TypedFilter via Into, so callers usually never name this type:
TypedFilter
A Filter tagged with the model it applies to.
UpdateQuery
Compiled UPDATE.

Enums§

AggregateExpr
One aggregate expression in an AggregateQuery.
ConflictClause
Compiled INSERT of a single row.
FieldType
Kind of value stored in a column.
ModelScope
Where a model’s table lives in a tenancy deployment. Mirrors crate::migrate::MigrationScope but on the model side, so the migration generator can route changes to the right scoped file without touching the runtime schema-discovery path.
Op
Comparison operator on a single column.
QueryError
Error raised while building or compiling a QuerySet.
Relation
Static description of a relation to another model.
SqlValue
A typed value that can be bound to a query parameter.
WhereExpr
Boolean expression in a WHERE clause — leaf Filters composed with AND / OR to arbitrary depth.

Traits§

Column
A typed reference to a single scalar column on Self::Model.
Model
Trait every #[derive(Model)] struct implements.

Functions§

infer_app_label_from_module_path
Parse the Rust module path produced by module_path!() and return the first segment after the crate root, or None when the model lives at the project root. Public so callers (admin, makemigrations CLI, the diagnostic manage list-apps verb) can apply the same inference rules to module-path strings they already have.
validate_value
Validate a single bound value against its field’s declared bounds.
version
Returns the crate version. Used by the workspace smoke test.