Skip to content
ReferenceRust API

RSL diagnostics

Every schema error includes its file, line, column, and a stable RSL code. Run rent validate for semantic validation or rent validate --syntax-only while repairing incomplete syntax.

Syntax

CodeMeaningFix
RSL000Source text could not be mapped to a valid UTF-8 span.Save the schema as UTF-8 and retry.
RSL001The lexer reached an unexpected character.Remove the character or place the value in a quoted string.
RSL002A string, escape, or block comment is incomplete.Close it and check escapes near the reported location.
RSL003The top-level declaration is unknown.Use datasource, generator, model, view, enum, type, extension, tenancy, access, or permissions.
RSL004The parser expected another token or expression.Check delimiters, attribute arguments, and the preceding line.
RSL005List and nullable modifiers were combined.Use a non-null list, or Json? @rent.rustType("Vec<String>") for a nullable stored collection.

Schema meaning

CodeMeaningFix
RSL200The normalized schema violates a cross-model invariant.Read the attached invariant message. It names the entity, field, relationship, or index.
RSL201A view has no SQL definition.Add @@rent.sql("...").
RSL202@rent.version uses an incompatible field type.Use required UInt or BigInt.
RSL203A field type is unknown.Use a built-in, enum, composite type, or an explicitly mapped unsupported database type.
RSL204A default value, function argument, or automatic timestamp declaration is invalid.Match the field type. Use uuid()/uuid(4)/uuid(7), now(), autoincrement(), or dbgenerated("SQL"). Use @updatedAt on a mutable timestamp field.
RSL205Relationship fields and references have different lengths.Supply one referenced field for every local foreign-key field.
RSL206An inverse relationship has no matching forward relationship.Add the matching relationship on the target model and use the same relationship name when needed.
RSL207An index declaration is malformed.Provide a valid field list and valid field options.
RSL208An attribute argument that must list field names is not an array of field names.Write the argument as [field, other_field].
RSL209A required attribute argument is missing.Add the argument named in the diagnostic, such as name on @@rent.check, @@rent.trigger, @@rent.policy, or @rent.through, field on @rent.order, or table on @rent.join.
RSL210Primary-key metadata is invalid.Use one required field-level @id, or one @@id([...]) containing required fields.
RSL211Join-table storage metadata is invalid.Supply the required table, two columns, and at most two constraint names.
RSL212A declaration name is duplicated.Rename or remove one model, view, enum, or composite type.
RSL213A field or enum value is duplicated.Keep each name unique inside its declaration.
RSL214A singleton or named configuration block is duplicated.Keep one datasource and unique generator and extension names.
RSL215An attribute is unknown for that declaration.Correct the spelling or move the attribute to a supported owner. For @@check, use @@rent.check(name:, expression:).
RSL216A non-repeatable attribute appears more than once.Keep one copy. Indexes, unique constraints, policies, checks, and triggers remain repeatable where appropriate.
RSL217An attribute argument is unknown.Correct the argument name or remove it.
RSL218A named attribute argument is duplicated.Keep one value for that argument.
RSL219A configuration property is unknown, including a datasource property Rent reads from elsewhere (url, directUrl, shadowDatabaseUrl, relationMode, schemas, extensions).Correct the property name or remove it. The message names where that setting lives in Rent.
RSL220A configuration property is duplicated.Keep one value for that property.
RSL221A required configuration property is missing.Add provider to the datasource block, or name to an extension block.
RSL222A relationship cannot infer its identity or join endpoints safely.Declare explicit fields and references. Use an explicit join model for compound many-to-many data. When a modeled join references either endpoint model more than once, provide both source and target, naming distinct forward relations to the correct models.
RSL223An enum default uses an unknown variant or the wrong value shape.Use an unquoted declared variant, or an array of variants for a list. Do not use the mapped database strings.
RSL224An enum has no variants or ambiguous stored values.Declare at least one variant and give each variant a distinct, nonempty database value.
RSL225A storage mapping has an invalid argument.Give @map or @@map exactly one nonempty quoted string.
RSL226A JSON default contains invalid JSON.Put a valid JSON document inside the quoted default string.
RSL227A typed list default has the wrong shape, element type, or numeric range.Use an array of values matching the declared type. Timestamps need an offset, UUIDs must parse, and bytes must be between 0 and 255.
RSL228A native extension field is declared outside a PostgreSQL datasource, as a list, or as a primary key.Use a PostgreSQL datasource and declare the field as a scalar that is not the primary key.
RSL229@@rent.native has arguments, or an enum uses @@map or @@schema without @@rent.native.Declare @@rent.native with no arguments and name the SQL type with @@map and @@schema.
RSL230An attribute cannot apply to a JSON value object.Use literal defaults and mapped names on JSON members. Put database constraints and callbacks on model fields.
RSL231A @db.* native type is used with no datasource provider to key it to.Add datasource db { provider = "postgresql" } (or your provider), or name the dialect with @rent.type(postgres: ...).
RSL232@@fulltext is used off PostgreSQL, has no sources, references an unknown or unsupported path, ends at a non-String or generated source, has an invalid configuration name, or its search_vector column is already declared.Declare a PostgreSQL datasource, select stored String fields or String members of typed value objects, use a lowercase configuration such as english, and remove any hand-declared search_vector.
RSL233Two members of one model become the same snake_case identifier.Rename one member. Generated Rust and SQL names are snake_case.
RSL234@@rent.derive or @@rent.attribute has a missing, empty, or non-string argument.Quote Rust source: derive paths such as "utoipa::ToSchema", one attribute body such as "ts(export)".
RSL235A tenancy block has a scope other than "required" or "none", a required scope names no field, or a none scope names one.Write tenancy { scope = "required" field = "tenant_id" }, or tenancy { scope = "none" } with no field.
RSL236A model has a tenant_id field but the schema declares no tenancy block.Add tenancy { scope = "required" field = "tenant_id" } to scope every model, or tenancy { scope = "none" } if tenant_id is ordinary data.
RSL237A tenant-scoped model has no tenant field.Add the field, or mark the model @@rent.system if its rows belong to no tenant.
RSL238A tenant field is optional or is not a BigInt or String.Declare it as a required BigInt or String, or mark the model @@rent.system.
RSL239Tenant-scoped models disagree on the tenant key type.Use one type, BigInt or String, for every model's tenant field.
RSL240A unique constraint on a tenant-scoped model omits the tenant field.Include the tenant field to make it unique per tenant, or add global: true if one value must be unique across every tenant.
RSL241A where: partial index is declared for MySQL or MariaDB, which have no partial indexes.Use PostgreSQL or SQLite for the model, or drop the condition.
RSL242An enum whose variants carry data has a block attribute other than @@rent.derive or @@rent.attribute, or a variant field has an attribute other than @map.Such an enum is stored as JSON, so @@rent.native, @@map and @@schema do not apply. Give the variant field no default.
RSL243The schema declares a generator block, which Rent does not read.Remove it. Configure generated code in rent.toml under [generate].
RSL244A relation declared foreignKey: false is required, sits on the side without fields, takes onDelete, onUpdate or map, or passes a value other than false.Make the relation field optional, move it to the side that declares fields, and drop the referential actions and constraint name.
RSL245A foreign-key delete subset has invalid fields, arguments, action, or backend.Use onDelete: SetNull(fields: [nullable_local_field]) or SetDefault(fields: [local_field]) with a nonempty, unique local FK subset on PostgreSQL 15+.
RSL246A unique's mode is neither insensitive nor default, or a mode: insensitive unique names no text field.Use mode: insensitive on a unique over at least one String field, or drop the mode.

Example

rent/schema.rsl:8:16 [RSL217] unknown `reference` argument for `@relation`

The location points at the invalid argument. In this case, rename reference to references, then run:

rent validate
rent format --check
rent generate

Permissions

These diagnostics apply to the optional permissions language.

CodeMeaningFix
RSL247More than one access block.Keep one schema-wide access block.
RSL248Missing or invalid subjects.Name at least one ordinary model, such as subjects = [User].
RSL249Unknown permissions model.Use a declared model name.
RSL250Permission declarations without access.Add an access block, or remove the permission declarations.
RSL251Unknown relationship or named permission.Use a declared relationship or named rule on the current model.
RSL252Invalid permission condition.Use an existing field and compatible scalar values. Timestamps must include an offset.
RSL253A path ends at a non-subject.Name its subject relationship or a named permission.
RSL254A path has ambiguous subject relationships.Name the intended subject hop explicitly.
RSL255A rule cycle does not cross a relationship.Break the local alias cycle.
RSL256An ordinary model has no permissions block.Declare its operations, or mark a genuinely system-only model @@rent.system.
RSL257A required CRUD operation is missing.Declare it explicitly, using nobody to deny it.
RSL271A permission profile definition or use is duplicated.Keep one definition and use each profile once per block.
RSL272A referenced permission profile does not exist.Define it in the same schema file or directory and check its name.
RSL273Permission profiles form a composition cycle.Remove the cyclic use. Recursive data relationships are separate.
RSL274Profile expansion exceeds 64 levels or 4,096 rule assignments.Flatten composition or split policies into smaller model-specific definitions.
RSL258A permission name is duplicate, reserved, or ambiguous.Use a unique snake_case name distinct from fields and relationships.
RSL259Create depends on evidence belonging to a nonexistent row.Start from an owned to-one parent or the creating subject.
RSL260Invalid expiry annotation.Use at most one DateTime field per model.
RSL261Invalid creator annotation or key.Use a required owned subject relationship referencing the complete primary key.
RSL262Repeated exclusion at the same level.Use one but not per level, with parentheses for nesting.
RSL263Invalid configured depth.Use an integer between 1 and 64.
RSL264A permission declaration crosses a system-model boundary.Keep system models outside ordinary permission graphs.
RSL265Invalid direct grants or missing grant authority.Declare grants on named rules, use valid subjects/usersets, and declare manage_grants.
RSL266A negative dependency cycle.Remove recursive exclusion. Recursive dependencies must be positive.
RSL267Unsupported permission identity.Use non-null integer, String, or UUID primary-key components.
RSL268Expression nesting or operator limit exceeded.Split long expressions into named rules. Nesting is limited to 64.
RSL269Duplicate permissions blocks for one model.Combine the rules in one block.
RSL270Invalid permission expression or configuration.Follow the attached detail for grouping, delegation, or references.

Model mixins

CodeMeaningFix
RSL280Duplicate mixin name or name shared with a model/type.Keep one unique name across the schema directory.
RSL281Unknown mixin in use.Declare the mixin and check its name.
RSL282Cyclic mixin composition.Remove the cyclic use.
RSL283Expansion exceeds 64 levels or 4,096 fields.Flatten or split the declarations.
RSL284A field or singleton model attribute is declared twice.Remove the duplicate. Mixins do not silently override fields or attributes.
RSL285A mixin is applied outside a model or mixin.Keep use out of views and composite value types.

Other field, relation, tenant and permission diagnostics still apply after expansion. An invalid inherited declaration points to its original mixin file.