Module: Restate::Sys

Defined in:
lib/restate/introspection.rb

Overview

Arel table references for Restate’s SQL introspection tables.

Restate exposes a DataFusion-powered SQL endpoint at /query on the admin API. These tables let you build queries using Arel’s composable, type-safe predicate API — the same one ActiveRecord uses under the hood.

Examples:

Query running invocations for a service

i = Restate::Sys::Invocation
query = i.project(i[:id], i[:status], i[:created_at])
         .where(i[:target_service_name].eq("MyService"))
         .where(i[:status].eq("running"))
         .order(i[:created_at].desc)
         .take(50)
Restate.query(query)

Join invocations with their journal input

i = Restate::Sys::Invocation
j = Restate::Sys::Journal
query = i.project(i[:id], i[:target], i[:status], j[:entry_json])
         .join(j, Arel::Nodes::OuterJoin)
         .on(j[:id].eq(i[:id]).and(j[:index].eq(0)))
         .where(i[:target_service_name].eq("CrawlPipeline"))
         .order(i[:created_at].desc)
         .take(20)
Restate.query(query)

Query virtual object state

s = Restate::Sys::State
query = s.project(s[:service_name], s[:service_key], s[:key], s[:value_utf8])
         .where(s[:service_name].eq("Counter"))
Restate.query(query)

Constant Summary collapse

Invocation =
Arel::Table.new(:sys_invocation)
Journal =
Arel::Table.new(:sys_journal)
JournalEvents =
Arel::Table.new(:sys_journal_events)
Inbox =
Arel::Table.new(:sys_inbox)
KeyedStatus =
Arel::Table.new(:sys_keyed_service_status)
Service =
Arel::Table.new(:sys_service)
Deployment =
Arel::Table.new(:sys_deployment)
Idempotency =
Arel::Table.new(:sys_idempotency)
Promise =
Arel::Table.new(:sys_promise)
State =
Arel::Table.new(:state)