TypeQL text #
typeql!"…" builds a Query from TypeQL text. Each {e} is rendered by ToTypeQL, which
turns a Lean value into a TypeQL value literal: strings are quoted and escaped, so user data can
never change a query's structure. Raw is the only way to splice text verbatim.
The query's transaction mode is inferred from the literal parts: define, undefine or
redefine need a schema transaction, insert, delete, update or put a write transaction,
anything else a read transaction. TypeQL braces must be escaped as \{ and \} because Lean
uses {…} for interpolation.
Equations
- TypeDB.instReprTxMode.repr TypeDB.TxMode.read prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TypeDB.TxMode.read")).group prec✝
- TypeDB.instReprTxMode.repr TypeDB.TxMode.write prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TypeDB.TxMode.write")).group prec✝
- TypeDB.instReprTxMode.repr TypeDB.TxMode.schema prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "TypeDB.TxMode.schema")).group prec✝
Instances For
Equations
- TypeDB.instReprTxMode = { reprPrec := TypeDB.instReprTxMode.repr }
Equations
Equations
- TypeDB.instOrdTxMode.ord x✝ y✝ = compare x✝.ctorIdx y✝.ctorIdx
Instances For
Equations
- TypeDB.instOrdTxMode = { compare := TypeDB.instOrdTxMode.ord }
Equations
Instances For
Equations
- TypeDB.TxMode.instLE = { le := fun (a b : TypeDB.TxMode) => a.rank ≤ b.rank }
The driver's TransactionType.
Equations
Instances For
Equations
Equations
- TypeDB.instToStringQuery = { toString := TypeDB.Query.text }
A query from text the caller vouches for, with an explicit mode.
Equations
- TypeDB.Query.raw need text = { text := text }
Instances For
Text spliced into a query verbatim, such as a type label or a query fragment.
- text : String
Instances For
Equations
- TypeDB.instInhabitedRaw = { default := TypeDB.instInhabitedRaw.default }
Equations
- TypeDB.instReprRaw = { reprPrec := TypeDB.instReprRaw.repr }
Equations
- TypeDB.instReprRaw.repr x✝ prec✝ = Std.Format.bracket "{ " (Std.Format.nil ++ Std.Format.text "text" ++ Std.Format.text " := " ++ (Std.Format.nest 8 (repr x✝.text)).group) " }"
Instances For
Quotes and escapes a string as a TypeQL string literal.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
YYYY-MM-DDTHH:MM:SS[.fffffffff] for UTC seconds and nanoseconds since the epoch.
Equations
- One or more equations did not get rendered due to their size.
Instances For
±HH:MM for an offset in seconds.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The exact decimal expansion of a finite double, or none for NaN and infinities. Every
double is m · 2^e, whose decimal expansion is finite, so the literal parses back to exactly the
same double.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- TypeDB.instToTypeQLString = { render := TypeDB.TypeQL.quote }
Equations
- TypeDB.instToTypeQLRaw = { render := TypeDB.Raw.text }
Equations
- TypeDB.instToTypeQLInt = { render := toString }
Equations
- TypeDB.instToTypeQLNat = { render := toString }
Doubles render exactly. NaN and infinities have no TypeQL literal and render as NaN or
inf, which the server rejects.
Equations
- TypeDB.instToTypeQLDecimal = { render := fun (d : TypeDB.Decimal) => d.toString ++ "dec" }
Equations
- TypeDB.instToTypeQLDuration = { render := TypeDB.Duration.toISO }
Equations
- TypeDB.instToTypeQLIID = { render := TypeDB.IID.hex }
Equations
- TypeDB.instToTypeQLPlainDate = { render := fun (d : Std.Time.PlainDate) => TypeDB.TypeQL.dateText d.toEpochDay.val }
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
Equations
- TypeDB.instToTypeQLDateTime = { render := fun (dt : Std.Time.DateTime) => TypeDB.render (TypeDB.DatetimeTZ.ofDateTime dt) }
The weakest mode that can run TypeQL text, from its keywords outside string literals.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
TypeQL text with {e} holes rendered by ToTypeQL. Its transaction mode is inferred from
the literal text; see the module docs.
Equations
- One or more equations did not get rendered due to their size.