module

Spacetime

This file is automatically maintained by Carbon.

Constants

COMMIT_VERSION = {{ (((VERSION.split("."))[2].split("-"))[0].split("+"))[0].to_i }}
MAJOR_VERSION = {{ (VERSION.split("."))[0].to_i }}
MINOR_VERSION = {{ (VERSION.split("."))[1].to_i }}
VERSION = "0.1.2"

Class methods

connect(host : String, database : String, token : String | Nil = nil, &block : Options -> ) : Client

Opens a WebSocket client connection to a SpacetimeDB database with optional builder configuration.

Source
connect(host : String, database : String, token : String | Nil = nil) : Client

Opens a WebSocket client connection to a SpacetimeDB database.

Source
doctor

Runs a comprehensive self-test of BSATN codecs, SATS-JSON, Gzip framing, and optional SpacetimeDB CLI presence.

Source
http(host : String = "http://localhost:3000", token : String | Nil = nil, timeout : Time::Span = 15.seconds) : HTTPClient

Creates an HTTPClient for /v1/identity and /v1/database REST operations.

Source
version

Returns the current semantic version string of spacetime-cr.

Source

Macros

table(struct_name, name = nil, public = true, &block)

Declarative macro to define a SpacetimeDB table struct with Spacetime::Serializable.

Example:

Spacetime.table User, name: "users", public: true do
  primary_key id : UInt64, auto_inc: true
  unique username : String
  field online : Bool = false
end
Source
type(struct_name, &block)

Declarative macro to define a SpacetimeDB custom product type struct with Spacetime::Serializable.

Source

Nested types