OxL Reference

kw by

Contextual keyword — actor declaration (§12.5), topic declaration (§10.5)

The list of words: §1.4

Syntax

ebnf
Actor       = "actor" Ident [ "sharded" "by" Ident ":" Type ] "{" { ActorMember } "}" ;
ebnf
Topic       = "topic" Ident ":" Type [ "sharded" "by" FieldPath ] ;
ebnf
ClusterClause = "seeds" Expr | "port" IntLit | "trace_sample" FloatLit | "auth" Block | "defaults" "{" { Ident Expr } "}"
            | "role" Ident "{" RoleClause { ( ";" | NL ) RoleClause } "}"
            | "assign" "by" Expr { "else" Expr } ;
ebnf
Query       = "from" Pattern "in" Expr { "where" Expr } [ "order" "by" Ord { "," Ord } ]
              [ "group" "by" Expr "into" Ident ] [ "skip" Expr ] [ "take" Expr ]
              [ "load" "(" IdentList ")" ] [ "select" Expr ] ;

Grammar: App. A

Defined in

Examples

oxl
let top = from o in db.Order
  where o.userId == uid && o.total > MIN_TOTAL
  order by o.createdAt desc
  skip page * PAGE_SIZE
  take PAGE_SIZE
  load(items)

let names = from u in users where u.active select u.name   // in-memory List
let byRole = from u in users group by u.role into g select (g.key, g.count())

— 5.9 Query expressions

oxl
@retain(ORDER_EVENTS_RETENTION)
topic OrderEvents: OrderEvent sharded by .userId

emit OrderEvents(e)                                       // publication
for await e in OrderEvents.subscribe(key: uid, from: .Latest) { … }
for await e in OrderEvents.subscribe(group: "indexer") { index(e) }

— 10.5 Topics — cluster-wide fan-out

Related diagnostics

query-not-sql, topic-without-journal, actor-not-hosted, cluster-auth, cluster-decl, cluster-needs, cluster-seeds, placement-conflict, saga-without-role, service-not-served, unknown-role, shard-count-clamped, table-schema, ab-test-decl

See also