rent
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, or extension.
RSL004The parser expected another token or expression.Check delimiters, attribute arguments, and the preceding line.

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.
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.Correct the property name or remove it.
RSL220A configuration property is duplicated.Keep one value for that property.
RSL221A required configuration property is missing.Add provider to datasource and generator blocks, or name to an extension block.
RSL222A relationship cannot infer a compound identity safely.Declare explicit fields and references; use an explicit join model for compound many-to-many data.
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.

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

On this page