Merge branch 'master' of http://82.157.175.59:3000/GenarrativeAI/Genarrative
Some checks failed
CI / verify (push) Has been cancelled

This commit is contained in:
2026-05-05 14:58:07 +08:00
238 changed files with 29234 additions and 144 deletions

View File

@@ -51,6 +51,15 @@ pub use mapper::{
PuzzleSelectCoverImageRecordInput, PuzzleWorkLikeReportRecordInput,
PuzzleWorkPointIncentiveClaimRecordInput, PuzzleWorkProfileRecord, PuzzleWorkRemixRecordInput,
PuzzleWorkUpsertRecordInput, ResolveCombatActionRecord, ResolveNpcBattleInteractionInput,
SquareHoleAgentMessageFinalizeRecordInput, SquareHoleAgentMessageRecord,
SquareHoleAgentMessageSubmitRecordInput, SquareHoleAgentSessionCreateRecordInput,
SquareHoleAgentSessionRecord, SquareHoleAnchorItemRecord, SquareHoleAnchorPackRecord,
SquareHoleCompileDraftRecordInput, SquareHoleCreatorConfigRecord,
SquareHoleDropConfirmationRecord, SquareHoleDropFeedbackRecord, SquareHoleHoleSnapshotRecord,
SquareHoleResultDraftRecord, SquareHoleRunDropRecordInput, SquareHoleRunRecord,
SquareHoleRunRestartRecordInput, SquareHoleRunStartRecordInput, SquareHoleRunStopRecordInput,
SquareHoleRunTimeUpRecordInput, SquareHoleShapeSnapshotRecord, SquareHoleWorkProfileRecord,
SquareHoleWorkUpdateRecordInput,
};
pub mod ai;
@@ -64,6 +73,7 @@ pub mod match3d;
pub mod npc;
pub mod puzzle;
pub mod runtime;
pub mod square_hole;
pub mod story;
pub mod story_runtime;
@@ -136,6 +146,7 @@ use module_puzzle::{
use module_runtime::{
RuntimeBrowseHistoryRecord, RuntimePlatformTheme as DomainRuntimePlatformTheme,
RuntimeProfileDashboardRecord, RuntimeProfileInviteCodeRecord, RuntimeProfilePlayStatsRecord,
AnalyticsMetricQueryResponse as DomainAnalyticsMetricQueryResponse,
RuntimeProfileRechargeCenterRecord, RuntimeProfileRechargeOrderRecord,
RuntimeProfileRedeemCodeMode as DomainRuntimeProfileRedeemCodeMode,
RuntimeProfileRedeemCodeRecord, RuntimeProfileRewardCodeRedeemRecord,
@@ -167,6 +178,7 @@ use module_runtime::{
build_runtime_profile_wallet_adjustment_input,
build_runtime_profile_wallet_ledger_entry_record,
build_runtime_profile_wallet_ledger_list_input, build_runtime_referral_invite_center_get_input,
build_analytics_metric_query_input,
build_runtime_referral_invite_center_record, build_runtime_referral_redeem_input,
build_runtime_referral_redeem_record, build_runtime_setting_get_input,
build_runtime_setting_record, build_runtime_setting_upsert_input,

View File

@@ -181,6 +181,17 @@ impl From<module_runtime::RuntimeProfileTaskCenterGetInput> for RuntimeProfileTa
}
}
impl From<module_runtime::AnalyticsMetricQueryInput> for AnalyticsMetricQueryInput {
fn from(input: module_runtime::AnalyticsMetricQueryInput) -> Self {
Self {
event_key: input.event_key,
scope_kind: map_runtime_tracking_scope_kind(input.scope_kind),
scope_id: input.scope_id,
granularity: map_analytics_granularity(input.granularity),
}
}
}
impl From<module_runtime::RuntimeProfileTaskClaimInput> for RuntimeProfileTaskClaimInput {
fn from(input: module_runtime::RuntimeProfileTaskClaimInput) -> Self {
Self {
@@ -281,6 +292,8 @@ impl From<module_runtime::RuntimeProfileInviteCodeAdminUpsertInput>
admin_user_id: input.admin_user_id,
invite_code: input.invite_code,
metadata_json: input.metadata_json,
starts_at_micros: input.starts_at_micros,
expires_at_micros: input.expires_at_micros,
updated_at_micros: input.updated_at_micros,
}
}
@@ -897,6 +910,22 @@ pub(crate) fn map_runtime_profile_task_center_procedure_result(
))
}
pub(crate) fn map_analytics_metric_query_procedure_result(
result: AnalyticsMetricQueryProcedureResult,
) -> Result<DomainAnalyticsMetricQueryResponse, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
Ok(DomainAnalyticsMetricQueryResponse {
buckets: result
.buckets
.into_iter()
.map(map_analytics_bucket_metric)
.collect(),
})
}
pub(crate) fn map_runtime_profile_task_claim_procedure_result(
result: RuntimeProfileTaskClaimProcedureResult,
) -> Result<RuntimeProfileTaskClaimRecord, SpacetimeClientError> {
@@ -1546,6 +1575,110 @@ pub(crate) fn map_match3d_click_item_procedure_result(
})
}
pub(crate) fn map_square_hole_agent_session_procedure_result(
result: SquareHoleAgentSessionProcedureResult,
) -> Result<SquareHoleAgentSessionRecord, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let session_json = result
.session_json
.ok_or_else(|| SpacetimeClientError::missing_snapshot("square hole agent session 快照"))?;
let session =
serde_json::from_str::<SquareHoleAgentSessionJsonRecord>(&session_json).map_err(
|error| {
SpacetimeClientError::Runtime(format!(
"square hole session_json 非法: {error}"
))
},
)?;
Ok(map_square_hole_agent_session_snapshot(session))
}
pub(crate) fn map_square_hole_work_procedure_result(
result: SquareHoleWorkProcedureResult,
) -> Result<SquareHoleWorkProfileRecord, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let work_json = result
.work_json
.ok_or_else(|| SpacetimeClientError::missing_snapshot("square hole work 快照"))?;
let work = serde_json::from_str::<SquareHoleWorkJsonRecord>(&work_json).map_err(|error| {
SpacetimeClientError::Runtime(format!("square hole work_json 非法: {error}"))
})?;
Ok(map_square_hole_work_snapshot(work))
}
pub(crate) fn map_square_hole_works_procedure_result(
result: SquareHoleWorksProcedureResult,
) -> Result<Vec<SquareHoleWorkProfileRecord>, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let items_json = result
.items_json
.ok_or_else(|| SpacetimeClientError::missing_snapshot("square hole works 快照"))?;
let items = serde_json::from_str::<Vec<SquareHoleWorkJsonRecord>>(&items_json).map_err(
|error| {
SpacetimeClientError::Runtime(format!("square hole works items_json 非法: {error}"))
},
)?;
Ok(items.into_iter().map(map_square_hole_work_snapshot).collect())
}
pub(crate) fn map_square_hole_run_procedure_result(
result: SquareHoleRunProcedureResult,
) -> Result<SquareHoleRunRecord, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let run_json = result
.run_json
.ok_or_else(|| SpacetimeClientError::missing_snapshot("square hole run 快照"))?;
map_square_hole_run_json(run_json)
}
pub(crate) fn map_square_hole_drop_shape_procedure_result(
result: SquareHoleDropShapeProcedureResult,
) -> Result<SquareHoleDropConfirmationRecord, SpacetimeClientError> {
if !result.ok {
return Err(SpacetimeClientError::procedure_failed(result.error_message));
}
let run_json = result
.run_json
.ok_or_else(|| SpacetimeClientError::missing_snapshot("square hole drop run 快照"))?;
let feedback_json = result.feedback_json.ok_or_else(|| {
SpacetimeClientError::missing_snapshot("square hole drop feedback 快照")
})?;
let run = map_square_hole_run_json(run_json)?;
let feedback =
serde_json::from_str::<SquareHoleDropFeedbackJsonRecord>(&feedback_json).map_err(
|error| {
SpacetimeClientError::Runtime(format!(
"square hole feedback_json 非法: {error}"
))
},
)?;
Ok(SquareHoleDropConfirmationRecord {
status: result.status,
accepted: feedback.accepted,
reject_reason: feedback.reject_reason.clone(),
failure_reason: result.failure_reason,
feedback: map_square_hole_feedback_snapshot(feedback),
run,
})
}
pub(crate) fn map_story_session_procedure_result(
result: StorySessionProcedureResult,
) -> Result<StorySessionResultRecord, SpacetimeClientError> {
@@ -1749,6 +1882,17 @@ pub(crate) fn map_runtime_profile_dashboard_snapshot(
}
}
pub(crate) fn map_analytics_bucket_metric(
bucket: AnalyticsBucketMetric,
) -> module_runtime::AnalyticsBucketMetric {
module_runtime::AnalyticsBucketMetric {
bucket_key: bucket.bucket_key,
bucket_start_date_key: bucket.bucket_start_date_key,
bucket_end_date_key: bucket.bucket_end_date_key,
value: bucket.value,
}
}
pub(crate) fn map_runtime_profile_wallet_ledger_entry_snapshot(
snapshot: RuntimeProfileWalletLedgerEntrySnapshot,
) -> module_runtime::RuntimeProfileWalletLedgerEntrySnapshot {
@@ -1997,6 +2141,8 @@ pub(crate) fn map_runtime_profile_invite_code_snapshot(
user_id: snapshot.user_id,
invite_code: snapshot.invite_code,
metadata_json: snapshot.metadata_json,
starts_at_micros: snapshot.starts_at_micros,
expires_at_micros: snapshot.expires_at_micros,
created_at_micros: snapshot.created_at_micros,
updated_at_micros: snapshot.updated_at_micros,
}
@@ -2773,6 +2919,198 @@ fn build_match3d_anchor_item(key: &str, label: &str, value: &str) -> Match3DAnch
}
}
fn map_square_hole_agent_session_snapshot(
snapshot: SquareHoleAgentSessionJsonRecord,
) -> SquareHoleAgentSessionRecord {
let config = map_square_hole_creator_config(snapshot.config);
SquareHoleAgentSessionRecord {
session_id: snapshot.session_id,
current_turn: snapshot.current_turn,
progress_percent: snapshot.progress_percent,
stage: normalize_square_hole_stage(&snapshot.stage).to_string(),
anchor_pack: build_square_hole_anchor_pack(&config),
config,
draft: snapshot.draft.map(map_square_hole_result_draft),
messages: snapshot
.messages
.into_iter()
.map(map_square_hole_agent_message_snapshot)
.collect(),
last_assistant_reply: empty_string_to_none(snapshot.last_assistant_reply),
published_profile_id: snapshot.published_profile_id,
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
}
}
fn map_square_hole_creator_config(
snapshot: SquareHoleCreatorConfigJsonRecord,
) -> SquareHoleCreatorConfigRecord {
SquareHoleCreatorConfigRecord {
theme_text: snapshot.theme_text,
twist_rule: snapshot.twist_rule,
shape_count: snapshot.shape_count,
difficulty: snapshot.difficulty,
}
}
fn map_square_hole_result_draft(
snapshot: SquareHoleDraftJsonRecord,
) -> SquareHoleResultDraftRecord {
SquareHoleResultDraftRecord {
profile_id: snapshot.profile_id,
game_name: snapshot.game_name,
theme_text: snapshot.theme_text,
twist_rule: snapshot.twist_rule,
summary: snapshot.summary_text,
tags: snapshot.tags,
shape_count: snapshot.shape_count,
difficulty: snapshot.difficulty,
publish_ready: false,
blockers: Vec::new(),
}
}
fn map_square_hole_agent_message_snapshot(
snapshot: SquareHoleAgentMessageJsonRecord,
) -> SquareHoleAgentMessageRecord {
SquareHoleAgentMessageRecord {
id: snapshot.message_id,
role: snapshot.role,
kind: normalize_square_hole_message_kind(&snapshot.kind).to_string(),
text: snapshot.text,
created_at: format_timestamp_micros(snapshot.created_at_micros),
}
}
fn map_square_hole_work_snapshot(
snapshot: SquareHoleWorkJsonRecord,
) -> SquareHoleWorkProfileRecord {
SquareHoleWorkProfileRecord {
work_id: snapshot.work_id,
profile_id: snapshot.profile_id,
owner_user_id: snapshot.owner_user_id,
source_session_id: empty_string_to_none(snapshot.source_session_id),
author_display_name: snapshot.author_display_name,
game_name: snapshot.game_name,
theme_text: snapshot.theme_text,
twist_rule: snapshot.twist_rule,
summary: snapshot.summary_text,
tags: snapshot.tags,
cover_image_src: empty_string_to_none(snapshot.cover_image_src),
shape_count: snapshot.shape_count,
difficulty: snapshot.difficulty,
publication_status: normalize_square_hole_publication_status(&snapshot.publication_status)
.to_string(),
play_count: snapshot.play_count,
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
published_at: snapshot.published_at_micros.map(format_timestamp_micros),
publish_ready: snapshot.publish_ready,
}
}
fn map_square_hole_run_json(run_json: String) -> Result<SquareHoleRunRecord, SpacetimeClientError> {
let run = serde_json::from_str::<SquareHoleRunJsonRecord>(&run_json).map_err(|error| {
SpacetimeClientError::Runtime(format!("square hole run_json 非法: {error}"))
})?;
Ok(map_square_hole_run_snapshot(run))
}
fn map_square_hole_run_snapshot(snapshot: SquareHoleRunJsonRecord) -> SquareHoleRunRecord {
SquareHoleRunRecord {
run_id: snapshot.run_id,
profile_id: snapshot.profile_id,
owner_user_id: snapshot.owner_user_id,
status: normalize_square_hole_run_status(&snapshot.status).to_string(),
snapshot_version: snapshot.snapshot_version,
started_at_ms: i64_to_u64_ms(snapshot.started_at_ms),
duration_limit_ms: i64_to_u64_ms(snapshot.duration_limit_ms),
server_now_ms: Some(i64_to_u64_ms(snapshot.server_now_ms)),
remaining_ms: i64_to_u64_ms(snapshot.remaining_ms),
total_shape_count: snapshot.total_shape_count,
completed_shape_count: snapshot.completed_shape_count,
combo: snapshot.combo,
best_combo: snapshot.best_combo,
score: snapshot.score,
rule_label: snapshot.rule_label,
current_shape: snapshot.current_shape.map(map_square_hole_shape_snapshot),
holes: snapshot
.holes
.into_iter()
.map(map_square_hole_hole_snapshot)
.collect(),
last_feedback: snapshot
.last_feedback
.map(map_square_hole_feedback_snapshot),
last_confirmed_action_id: None,
}
}
fn map_square_hole_shape_snapshot(
snapshot: SquareHoleShapeJsonRecord,
) -> SquareHoleShapeSnapshotRecord {
SquareHoleShapeSnapshotRecord {
shape_id: snapshot.shape_id,
shape_kind: snapshot.shape_kind,
label: snapshot.label,
color: snapshot.color,
}
}
fn map_square_hole_hole_snapshot(
snapshot: SquareHoleHoleJsonRecord,
) -> SquareHoleHoleSnapshotRecord {
SquareHoleHoleSnapshotRecord {
hole_id: snapshot.hole_id,
hole_kind: snapshot.hole_kind,
label: snapshot.label,
x: snapshot.x,
y: snapshot.y,
}
}
fn map_square_hole_feedback_snapshot(
snapshot: SquareHoleDropFeedbackJsonRecord,
) -> SquareHoleDropFeedbackRecord {
SquareHoleDropFeedbackRecord {
accepted: snapshot.accepted,
reject_reason: snapshot
.reject_reason
.map(|value| normalize_square_hole_reject_reason(&value).to_string()),
message: snapshot.message,
}
}
fn build_square_hole_anchor_pack(
config: &SquareHoleCreatorConfigRecord,
) -> SquareHoleAnchorPackRecord {
let shape_count = config.shape_count.to_string();
let difficulty = config.difficulty.to_string();
SquareHoleAnchorPackRecord {
theme: build_square_hole_anchor_item("theme", "题材主题", config.theme_text.as_str()),
twist_rule: build_square_hole_anchor_item("twistRule", "反差规则", config.twist_rule.as_str()),
shape_count: build_square_hole_anchor_item("shapeCount", "形状数量", shape_count.as_str()),
difficulty: build_square_hole_anchor_item("difficulty", "难度", difficulty.as_str()),
}
}
fn build_square_hole_anchor_item(
key: &str,
label: &str,
value: &str,
) -> SquareHoleAnchorItemRecord {
SquareHoleAnchorItemRecord {
key: key.to_string(),
label: label.to_string(),
value: value.to_string(),
status: if value.trim().is_empty() {
"missing"
} else {
"confirmed"
}
.to_string(),
}
}
fn normalize_match3d_stage(value: &str) -> &str {
match value {
"Collecting" | "collecting" | "collecting_config" => "collecting_config",
@@ -2798,6 +3136,54 @@ fn normalize_match3d_message_kind(value: &str) -> &str {
}
}
fn normalize_square_hole_stage(value: &str) -> &str {
match value {
"Collecting" | "CollectingConfig" | "collecting" | "collecting_config" => {
"collecting_config"
}
"ReadyToCompile" | "ready_to_compile" => "ready_to_compile",
"DraftCompiled" | "DraftReady" | "draft_compiled" | "draft_ready" => "draft_ready",
"Published" | "published" => "published",
_ => value,
}
}
fn normalize_square_hole_publication_status(value: &str) -> &str {
match value {
"Draft" | "draft" => "draft",
"Published" | "published" => "published",
_ => value,
}
}
fn normalize_square_hole_run_status(value: &str) -> &str {
match value {
"Running" | "running" => "running",
"Won" | "won" => "won",
"Failed" | "failed" => "failed",
"Stopped" | "stopped" => "stopped",
_ => value,
}
}
fn normalize_square_hole_message_kind(value: &str) -> &str {
match value {
"text" => "chat",
_ => value,
}
}
fn normalize_square_hole_reject_reason(value: &str) -> &str {
match value {
"RunNotActive" | "run_not_active" => "run_not_active",
"SnapshotVersionMismatch" | "snapshot_version_mismatch" => "snapshot_version_mismatch",
"HoleNotFound" | "hole_not_found" => "hole_not_found",
"Incompatible" | "incompatible" => "incompatible",
"TimeUp" | "time_up" => "time_up",
_ => value,
}
}
fn empty_string_to_none(value: String) -> Option<String> {
let trimmed = value.trim();
if trimmed.is_empty() {
@@ -4008,6 +4394,18 @@ pub(crate) fn map_runtime_profile_wallet_ledger_source_type_back(
}
}
pub(crate) fn map_analytics_granularity(
granularity: module_runtime::AnalyticsGranularity,
) -> AnalyticsGranularity {
match granularity {
module_runtime::AnalyticsGranularity::Day => AnalyticsGranularity::Day,
module_runtime::AnalyticsGranularity::Week => AnalyticsGranularity::Week,
module_runtime::AnalyticsGranularity::Month => AnalyticsGranularity::Month,
module_runtime::AnalyticsGranularity::Quarter => AnalyticsGranularity::Quarter,
module_runtime::AnalyticsGranularity::Year => AnalyticsGranularity::Year,
}
}
pub(crate) fn map_runtime_tracking_scope_kind(
value: DomainRuntimeTrackingScopeKind,
) -> crate::module_bindings::RuntimeTrackingScopeKind {
@@ -5538,6 +5936,378 @@ struct Match3DRunJsonRecord {
failure_reason: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleAgentSessionCreateRecordInput {
pub session_id: String,
pub owner_user_id: String,
pub seed_text: String,
pub welcome_message_id: String,
pub welcome_message_text: String,
pub config_json: Option<String>,
pub created_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleAgentMessageSubmitRecordInput {
pub session_id: String,
pub owner_user_id: String,
pub user_message_id: String,
pub user_message_text: String,
pub submitted_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleAgentMessageFinalizeRecordInput {
pub session_id: String,
pub owner_user_id: String,
pub assistant_message_id: Option<String>,
pub assistant_reply_text: Option<String>,
pub config_json: Option<String>,
pub progress_percent: u32,
pub stage: String,
pub updated_at_micros: i64,
pub error_message: Option<String>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleCompileDraftRecordInput {
pub session_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub author_display_name: String,
pub game_name: Option<String>,
pub summary_text: Option<String>,
pub tags_json: Option<String>,
pub cover_image_src: Option<String>,
pub compiled_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleWorkUpdateRecordInput {
pub profile_id: String,
pub owner_user_id: String,
pub game_name: String,
pub theme_text: String,
pub twist_rule: String,
pub summary_text: String,
pub tags_json: String,
pub cover_image_src: String,
pub shape_count: u32,
pub difficulty: u32,
pub updated_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleRunStartRecordInput {
pub run_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub started_at_ms: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleRunDropRecordInput {
pub run_id: String,
pub owner_user_id: String,
pub hole_id: String,
pub client_snapshot_version: u64,
pub client_event_id: String,
pub dropped_at_ms: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleRunStopRecordInput {
pub run_id: String,
pub owner_user_id: String,
pub stopped_at_ms: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleRunRestartRecordInput {
pub source_run_id: String,
pub next_run_id: String,
pub owner_user_id: String,
pub restarted_at_ms: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleRunTimeUpRecordInput {
pub run_id: String,
pub owner_user_id: String,
pub finished_at_ms: i64,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleAnchorItemRecord {
pub key: String,
pub label: String,
pub value: String,
pub status: String,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleAnchorPackRecord {
pub theme: SquareHoleAnchorItemRecord,
pub twist_rule: SquareHoleAnchorItemRecord,
pub shape_count: SquareHoleAnchorItemRecord,
pub difficulty: SquareHoleAnchorItemRecord,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleCreatorConfigRecord {
pub theme_text: String,
pub twist_rule: String,
pub shape_count: u32,
pub difficulty: u32,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleResultDraftRecord {
pub profile_id: String,
pub game_name: String,
pub theme_text: String,
pub twist_rule: String,
pub summary: String,
pub tags: Vec<String>,
pub shape_count: u32,
pub difficulty: u32,
pub publish_ready: bool,
pub blockers: Vec<String>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleAgentMessageRecord {
pub id: String,
pub role: String,
pub kind: String,
pub text: String,
pub created_at: String,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleAgentSessionRecord {
pub session_id: String,
pub current_turn: u32,
pub progress_percent: u32,
pub stage: String,
pub anchor_pack: SquareHoleAnchorPackRecord,
pub config: SquareHoleCreatorConfigRecord,
pub draft: Option<SquareHoleResultDraftRecord>,
pub messages: Vec<SquareHoleAgentMessageRecord>,
pub last_assistant_reply: Option<String>,
pub published_profile_id: Option<String>,
pub updated_at: String,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleWorkProfileRecord {
pub work_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub source_session_id: Option<String>,
pub author_display_name: String,
pub game_name: String,
pub theme_text: String,
pub twist_rule: String,
pub summary: String,
pub tags: Vec<String>,
pub cover_image_src: Option<String>,
pub shape_count: u32,
pub difficulty: u32,
pub publication_status: String,
pub play_count: u32,
pub updated_at: String,
pub published_at: Option<String>,
pub publish_ready: bool,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleShapeSnapshotRecord {
pub shape_id: String,
pub shape_kind: String,
pub label: String,
pub color: String,
}
#[derive(Clone, Debug, PartialEq)]
pub struct SquareHoleHoleSnapshotRecord {
pub hole_id: String,
pub hole_kind: String,
pub label: String,
pub x: f32,
pub y: f32,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct SquareHoleDropFeedbackRecord {
pub accepted: bool,
pub reject_reason: Option<String>,
pub message: String,
}
#[derive(Clone, Debug, PartialEq)]
pub struct SquareHoleRunRecord {
pub run_id: String,
pub profile_id: String,
pub owner_user_id: String,
pub status: String,
pub snapshot_version: u64,
pub started_at_ms: u64,
pub duration_limit_ms: u64,
pub server_now_ms: Option<u64>,
pub remaining_ms: u64,
pub total_shape_count: u32,
pub completed_shape_count: u32,
pub combo: u32,
pub best_combo: u32,
pub score: u32,
pub rule_label: String,
pub current_shape: Option<SquareHoleShapeSnapshotRecord>,
pub holes: Vec<SquareHoleHoleSnapshotRecord>,
pub last_feedback: Option<SquareHoleDropFeedbackRecord>,
pub last_confirmed_action_id: Option<String>,
}
#[derive(Clone, Debug, PartialEq)]
pub struct SquareHoleDropConfirmationRecord {
pub status: String,
pub accepted: bool,
pub reject_reason: Option<String>,
pub failure_reason: Option<String>,
pub feedback: SquareHoleDropFeedbackRecord,
pub run: SquareHoleRunRecord,
}
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
struct SquareHoleCreatorConfigJsonRecord {
theme_text: String,
twist_rule: String,
shape_count: u32,
difficulty: u32,
}
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
struct SquareHoleAgentMessageJsonRecord {
message_id: String,
#[allow(dead_code)]
session_id: String,
role: String,
kind: String,
text: String,
created_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
struct SquareHoleDraftJsonRecord {
profile_id: String,
game_name: String,
theme_text: String,
twist_rule: String,
summary_text: String,
tags: Vec<String>,
shape_count: u32,
difficulty: u32,
}
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
struct SquareHoleAgentSessionJsonRecord {
session_id: String,
#[allow(dead_code)]
owner_user_id: String,
#[allow(dead_code)]
seed_text: String,
current_turn: u32,
progress_percent: u32,
stage: String,
config: SquareHoleCreatorConfigJsonRecord,
draft: Option<SquareHoleDraftJsonRecord>,
messages: Vec<SquareHoleAgentMessageJsonRecord>,
last_assistant_reply: String,
published_profile_id: Option<String>,
#[allow(dead_code)]
created_at_micros: i64,
updated_at_micros: i64,
}
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
struct SquareHoleWorkJsonRecord {
work_id: String,
profile_id: String,
owner_user_id: String,
source_session_id: String,
author_display_name: String,
game_name: String,
theme_text: String,
twist_rule: String,
summary_text: String,
tags: Vec<String>,
cover_image_src: String,
shape_count: u32,
difficulty: u32,
#[allow(dead_code)]
config: SquareHoleCreatorConfigJsonRecord,
publication_status: String,
publish_ready: bool,
play_count: u32,
updated_at_micros: i64,
published_at_micros: Option<i64>,
}
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
struct SquareHoleShapeJsonRecord {
shape_id: String,
shape_kind: String,
label: String,
color: String,
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
struct SquareHoleHoleJsonRecord {
hole_id: String,
hole_kind: String,
label: String,
x: f32,
y: f32,
}
#[derive(Clone, Debug, PartialEq, Eq, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
struct SquareHoleDropFeedbackJsonRecord {
accepted: bool,
reject_reason: Option<String>,
message: String,
}
#[derive(Clone, Debug, PartialEq, serde::Deserialize)]
#[serde(rename_all = "camelCase")]
struct SquareHoleRunJsonRecord {
run_id: String,
profile_id: String,
owner_user_id: String,
status: String,
snapshot_version: u64,
started_at_ms: i64,
duration_limit_ms: i64,
server_now_ms: i64,
remaining_ms: i64,
total_shape_count: u32,
completed_shape_count: u32,
combo: u32,
best_combo: u32,
score: u32,
rule_label: String,
current_shape: Option<SquareHoleShapeJsonRecord>,
holes: Vec<SquareHoleHoleJsonRecord>,
last_feedback: Option<SquareHoleDropFeedbackJsonRecord>,
}
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct PuzzleAnchorItemRecord {
pub key: String,

View File

@@ -0,0 +1,166 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::ai_result_reference_kind_type::AiResultReferenceKind;
use super::ai_result_reference_type::AiResultReference;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `ai_result_reference`.
///
/// Obtain a handle from the [`AiResultReferenceTableAccess::ai_result_reference`] method on [`super::RemoteTables`],
/// like `ctx.db.ai_result_reference()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.ai_result_reference().on_insert(...)`.
pub struct AiResultReferenceTableHandle<'ctx> {
imp: __sdk::TableHandle<AiResultReference>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `ai_result_reference`.
///
/// Implemented for [`super::RemoteTables`].
pub trait AiResultReferenceTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`AiResultReferenceTableHandle`], which mediates access to the table `ai_result_reference`.
fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_>;
}
impl AiResultReferenceTableAccess for super::RemoteTables {
fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_> {
AiResultReferenceTableHandle {
imp: self
.imp
.get_table::<AiResultReference>("ai_result_reference"),
ctx: std::marker::PhantomData,
}
}
}
pub struct AiResultReferenceInsertCallbackId(__sdk::CallbackId);
pub struct AiResultReferenceDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for AiResultReferenceTableHandle<'ctx> {
type Row = AiResultReference;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AiResultReference> + '_ {
self.imp.iter()
}
type InsertCallbackId = AiResultReferenceInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AiResultReferenceInsertCallbackId {
AiResultReferenceInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: AiResultReferenceInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = AiResultReferenceDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AiResultReferenceDeleteCallbackId {
AiResultReferenceDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: AiResultReferenceDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct AiResultReferenceUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for AiResultReferenceTableHandle<'ctx> {
type UpdateCallbackId = AiResultReferenceUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> AiResultReferenceUpdateCallbackId {
AiResultReferenceUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: AiResultReferenceUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `result_reference_row_id` unique index on the table `ai_result_reference`,
/// which allows point queries on the field of the same name
/// via the [`AiResultReferenceResultReferenceRowIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.ai_result_reference().result_reference_row_id().find(...)`.
pub struct AiResultReferenceResultReferenceRowIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AiResultReference, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> AiResultReferenceTableHandle<'ctx> {
/// Get a handle on the `result_reference_row_id` unique index on the table `ai_result_reference`.
pub fn result_reference_row_id(&self) -> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
AiResultReferenceResultReferenceRowIdUnique {
imp: self
.imp
.get_unique_constraint::<String>("result_reference_row_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
/// Find the subscribed row whose `result_reference_row_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AiResultReference> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AiResultReference>("ai_result_reference");
_table.add_unique_constraint::<String>("result_reference_row_id", |row| {
&row.result_reference_row_id
});
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AiResultReference>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<AiResultReference>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AiResultReference`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait ai_result_referenceQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `AiResultReference`.
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference>;
}
impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference> {
__sdk::__query_builder::Table::new("ai_result_reference")
}
}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::ai_task_stage_kind_type::AiTaskStageKind;
use super::ai_task_stage_status_type::AiTaskStageStatus;
use super::ai_task_stage_type::AiTaskStage;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `ai_task_stage`.
///
/// Obtain a handle from the [`AiTaskStageTableAccess::ai_task_stage`] method on [`super::RemoteTables`],
/// like `ctx.db.ai_task_stage()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.ai_task_stage().on_insert(...)`.
pub struct AiTaskStageTableHandle<'ctx> {
imp: __sdk::TableHandle<AiTaskStage>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `ai_task_stage`.
///
/// Implemented for [`super::RemoteTables`].
pub trait AiTaskStageTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`AiTaskStageTableHandle`], which mediates access to the table `ai_task_stage`.
fn ai_task_stage(&self) -> AiTaskStageTableHandle<'_>;
}
impl AiTaskStageTableAccess for super::RemoteTables {
fn ai_task_stage(&self) -> AiTaskStageTableHandle<'_> {
AiTaskStageTableHandle {
imp: self.imp.get_table::<AiTaskStage>("ai_task_stage"),
ctx: std::marker::PhantomData,
}
}
}
pub struct AiTaskStageInsertCallbackId(__sdk::CallbackId);
pub struct AiTaskStageDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for AiTaskStageTableHandle<'ctx> {
type Row = AiTaskStage;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AiTaskStage> + '_ {
self.imp.iter()
}
type InsertCallbackId = AiTaskStageInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AiTaskStageInsertCallbackId {
AiTaskStageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: AiTaskStageInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = AiTaskStageDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AiTaskStageDeleteCallbackId {
AiTaskStageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: AiTaskStageDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct AiTaskStageUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskStageTableHandle<'ctx> {
type UpdateCallbackId = AiTaskStageUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> AiTaskStageUpdateCallbackId {
AiTaskStageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: AiTaskStageUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `task_stage_id` unique index on the table `ai_task_stage`,
/// which allows point queries on the field of the same name
/// via the [`AiTaskStageTaskStageIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.ai_task_stage().task_stage_id().find(...)`.
pub struct AiTaskStageTaskStageIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AiTaskStage, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> AiTaskStageTableHandle<'ctx> {
/// Get a handle on the `task_stage_id` unique index on the table `ai_task_stage`.
pub fn task_stage_id(&self) -> AiTaskStageTaskStageIdUnique<'ctx> {
AiTaskStageTaskStageIdUnique {
imp: self.imp.get_unique_constraint::<String>("task_stage_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> AiTaskStageTaskStageIdUnique<'ctx> {
/// Find the subscribed row whose `task_stage_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AiTaskStage> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AiTaskStage>("ai_task_stage");
_table.add_unique_constraint::<String>("task_stage_id", |row| &row.task_stage_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AiTaskStage>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<AiTaskStage>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AiTaskStage`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait ai_task_stageQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `AiTaskStage`.
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage>;
}
impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage> {
__sdk::__query_builder::Table::new("ai_task_stage")
}
}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::ai_task_kind_type::AiTaskKind;
use super::ai_task_status_type::AiTaskStatus;
use super::ai_task_type::AiTask;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `ai_task`.
///
/// Obtain a handle from the [`AiTaskTableAccess::ai_task`] method on [`super::RemoteTables`],
/// like `ctx.db.ai_task()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.ai_task().on_insert(...)`.
pub struct AiTaskTableHandle<'ctx> {
imp: __sdk::TableHandle<AiTask>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `ai_task`.
///
/// Implemented for [`super::RemoteTables`].
pub trait AiTaskTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`AiTaskTableHandle`], which mediates access to the table `ai_task`.
fn ai_task(&self) -> AiTaskTableHandle<'_>;
}
impl AiTaskTableAccess for super::RemoteTables {
fn ai_task(&self) -> AiTaskTableHandle<'_> {
AiTaskTableHandle {
imp: self.imp.get_table::<AiTask>("ai_task"),
ctx: std::marker::PhantomData,
}
}
}
pub struct AiTaskInsertCallbackId(__sdk::CallbackId);
pub struct AiTaskDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for AiTaskTableHandle<'ctx> {
type Row = AiTask;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AiTask> + '_ {
self.imp.iter()
}
type InsertCallbackId = AiTaskInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AiTaskInsertCallbackId {
AiTaskInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: AiTaskInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = AiTaskDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AiTaskDeleteCallbackId {
AiTaskDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: AiTaskDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct AiTaskUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskTableHandle<'ctx> {
type UpdateCallbackId = AiTaskUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> AiTaskUpdateCallbackId {
AiTaskUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: AiTaskUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `task_id` unique index on the table `ai_task`,
/// which allows point queries on the field of the same name
/// via the [`AiTaskTaskIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.ai_task().task_id().find(...)`.
pub struct AiTaskTaskIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AiTask, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> AiTaskTableHandle<'ctx> {
/// Get a handle on the `task_id` unique index on the table `ai_task`.
pub fn task_id(&self) -> AiTaskTaskIdUnique<'ctx> {
AiTaskTaskIdUnique {
imp: self.imp.get_unique_constraint::<String>("task_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> AiTaskTaskIdUnique<'ctx> {
/// Find the subscribed row whose `task_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AiTask> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AiTask>("ai_task");
_table.add_unique_constraint::<String>("task_id", |row| &row.task_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AiTask>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<AiTask>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AiTask`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait ai_taskQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `AiTask`.
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask>;
}
impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask> {
__sdk::__query_builder::Table::new("ai_task")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::ai_task_stage_kind_type::AiTaskStageKind;
use super::ai_text_chunk_type::AiTextChunk;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `ai_text_chunk`.
///
/// Obtain a handle from the [`AiTextChunkTableAccess::ai_text_chunk`] method on [`super::RemoteTables`],
/// like `ctx.db.ai_text_chunk()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.ai_text_chunk().on_insert(...)`.
pub struct AiTextChunkTableHandle<'ctx> {
imp: __sdk::TableHandle<AiTextChunk>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `ai_text_chunk`.
///
/// Implemented for [`super::RemoteTables`].
pub trait AiTextChunkTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`AiTextChunkTableHandle`], which mediates access to the table `ai_text_chunk`.
fn ai_text_chunk(&self) -> AiTextChunkTableHandle<'_>;
}
impl AiTextChunkTableAccess for super::RemoteTables {
fn ai_text_chunk(&self) -> AiTextChunkTableHandle<'_> {
AiTextChunkTableHandle {
imp: self.imp.get_table::<AiTextChunk>("ai_text_chunk"),
ctx: std::marker::PhantomData,
}
}
}
pub struct AiTextChunkInsertCallbackId(__sdk::CallbackId);
pub struct AiTextChunkDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for AiTextChunkTableHandle<'ctx> {
type Row = AiTextChunk;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AiTextChunk> + '_ {
self.imp.iter()
}
type InsertCallbackId = AiTextChunkInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AiTextChunkInsertCallbackId {
AiTextChunkInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: AiTextChunkInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = AiTextChunkDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AiTextChunkDeleteCallbackId {
AiTextChunkDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: AiTextChunkDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct AiTextChunkUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for AiTextChunkTableHandle<'ctx> {
type UpdateCallbackId = AiTextChunkUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> AiTextChunkUpdateCallbackId {
AiTextChunkUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: AiTextChunkUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `text_chunk_row_id` unique index on the table `ai_text_chunk`,
/// which allows point queries on the field of the same name
/// via the [`AiTextChunkTextChunkRowIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.ai_text_chunk().text_chunk_row_id().find(...)`.
pub struct AiTextChunkTextChunkRowIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AiTextChunk, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> AiTextChunkTableHandle<'ctx> {
/// Get a handle on the `text_chunk_row_id` unique index on the table `ai_text_chunk`.
pub fn text_chunk_row_id(&self) -> AiTextChunkTextChunkRowIdUnique<'ctx> {
AiTextChunkTextChunkRowIdUnique {
imp: self
.imp
.get_unique_constraint::<String>("text_chunk_row_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> AiTextChunkTextChunkRowIdUnique<'ctx> {
/// Find the subscribed row whose `text_chunk_row_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AiTextChunk> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AiTextChunk>("ai_text_chunk");
_table.add_unique_constraint::<String>("text_chunk_row_id", |row| &row.text_chunk_row_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AiTextChunk>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<AiTextChunk>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AiTextChunk`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait ai_text_chunkQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `AiTextChunk`.
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk>;
}
impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor {
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk> {
__sdk::__query_builder::Table::new("ai_text_chunk")
}
}

View File

@@ -0,0 +1,18 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct AnalyticsBucketMetric {
pub bucket_key: String,
pub bucket_start_date_key: i64,
pub bucket_end_date_key: i64,
pub value: u64,
}
impl __sdk::InModule for AnalyticsBucketMetric {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,15 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct AnalyticsDateDimensionEnsureInput {
pub date_key: i64,
}
impl __sdk::InModule for AnalyticsDateDimensionEnsureInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,16 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct AnalyticsDateDimensionSeedInput {
pub start_date: String,
pub end_date: String,
}
impl __sdk::InModule for AnalyticsDateDimensionSeedInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::analytics_date_dimension_type::AnalyticsDateDimension;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `analytics_date_dimension`.
///
/// Obtain a handle from the [`AnalyticsDateDimensionTableAccess::analytics_date_dimension`] method on [`super::RemoteTables`],
/// like `ctx.db.analytics_date_dimension()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.analytics_date_dimension().on_insert(...)`.
pub struct AnalyticsDateDimensionTableHandle<'ctx> {
imp: __sdk::TableHandle<AnalyticsDateDimension>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `analytics_date_dimension`.
///
/// Implemented for [`super::RemoteTables`].
pub trait AnalyticsDateDimensionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`AnalyticsDateDimensionTableHandle`], which mediates access to the table `analytics_date_dimension`.
fn analytics_date_dimension(&self) -> AnalyticsDateDimensionTableHandle<'_>;
}
impl AnalyticsDateDimensionTableAccess for super::RemoteTables {
fn analytics_date_dimension(&self) -> AnalyticsDateDimensionTableHandle<'_> {
AnalyticsDateDimensionTableHandle {
imp: self
.imp
.get_table::<AnalyticsDateDimension>("analytics_date_dimension"),
ctx: std::marker::PhantomData,
}
}
}
pub struct AnalyticsDateDimensionInsertCallbackId(__sdk::CallbackId);
pub struct AnalyticsDateDimensionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for AnalyticsDateDimensionTableHandle<'ctx> {
type Row = AnalyticsDateDimension;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AnalyticsDateDimension> + '_ {
self.imp.iter()
}
type InsertCallbackId = AnalyticsDateDimensionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AnalyticsDateDimensionInsertCallbackId {
AnalyticsDateDimensionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: AnalyticsDateDimensionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = AnalyticsDateDimensionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AnalyticsDateDimensionDeleteCallbackId {
AnalyticsDateDimensionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: AnalyticsDateDimensionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct AnalyticsDateDimensionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for AnalyticsDateDimensionTableHandle<'ctx> {
type UpdateCallbackId = AnalyticsDateDimensionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> AnalyticsDateDimensionUpdateCallbackId {
AnalyticsDateDimensionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: AnalyticsDateDimensionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `date_key` unique index on the table `analytics_date_dimension`,
/// which allows point queries on the field of the same name
/// via the [`AnalyticsDateDimensionDateKeyUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.analytics_date_dimension().date_key().find(...)`.
pub struct AnalyticsDateDimensionDateKeyUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AnalyticsDateDimension, i64>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> AnalyticsDateDimensionTableHandle<'ctx> {
/// Get a handle on the `date_key` unique index on the table `analytics_date_dimension`.
pub fn date_key(&self) -> AnalyticsDateDimensionDateKeyUnique<'ctx> {
AnalyticsDateDimensionDateKeyUnique {
imp: self.imp.get_unique_constraint::<i64>("date_key"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> AnalyticsDateDimensionDateKeyUnique<'ctx> {
/// Find the subscribed row whose `date_key` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &i64) -> Option<AnalyticsDateDimension> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<AnalyticsDateDimension>("analytics_date_dimension");
_table.add_unique_constraint::<i64>("date_key", |row| &row.date_key);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AnalyticsDateDimension>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<AnalyticsDateDimension>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AnalyticsDateDimension`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait analytics_date_dimensionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `AnalyticsDateDimension`.
fn analytics_date_dimension(&self) -> __sdk::__query_builder::Table<AnalyticsDateDimension>;
}
impl analytics_date_dimensionQueryTableAccess for __sdk::QueryTableAccessor {
fn analytics_date_dimension(&self) -> __sdk::__query_builder::Table<AnalyticsDateDimension> {
__sdk::__query_builder::Table::new("analytics_date_dimension")
}
}

View File

@@ -0,0 +1,120 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct AnalyticsDateDimension {
pub date_key: i64,
pub calendar_date: String,
pub weekday: u8,
pub iso_week_key: i32,
pub week_start_date_key: i64,
pub week_end_date_key: i64,
pub month_key: i32,
pub month_start_date_key: i64,
pub month_end_date_key: i64,
pub quarter_key: i32,
pub quarter_start_date_key: i64,
pub quarter_end_date_key: i64,
pub year_key: i32,
pub year_start_date_key: i64,
pub year_end_date_key: i64,
pub created_at: __sdk::Timestamp,
pub updated_at: __sdk::Timestamp,
}
impl __sdk::InModule for AnalyticsDateDimension {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `AnalyticsDateDimension`.
///
/// Provides typed access to columns for query building.
pub struct AnalyticsDateDimensionCols {
pub date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
pub calendar_date: __sdk::__query_builder::Col<AnalyticsDateDimension, String>,
pub weekday: __sdk::__query_builder::Col<AnalyticsDateDimension, u8>,
pub iso_week_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i32>,
pub week_start_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
pub week_end_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
pub month_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i32>,
pub month_start_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
pub month_end_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
pub quarter_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i32>,
pub quarter_start_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
pub quarter_end_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
pub year_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i32>,
pub year_start_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
pub year_end_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
pub created_at: __sdk::__query_builder::Col<AnalyticsDateDimension, __sdk::Timestamp>,
pub updated_at: __sdk::__query_builder::Col<AnalyticsDateDimension, __sdk::Timestamp>,
}
impl __sdk::__query_builder::HasCols for AnalyticsDateDimension {
type Cols = AnalyticsDateDimensionCols;
fn cols(table_name: &'static str) -> Self::Cols {
AnalyticsDateDimensionCols {
date_key: __sdk::__query_builder::Col::new(table_name, "date_key"),
calendar_date: __sdk::__query_builder::Col::new(table_name, "calendar_date"),
weekday: __sdk::__query_builder::Col::new(table_name, "weekday"),
iso_week_key: __sdk::__query_builder::Col::new(table_name, "iso_week_key"),
week_start_date_key: __sdk::__query_builder::Col::new(
table_name,
"week_start_date_key",
),
week_end_date_key: __sdk::__query_builder::Col::new(table_name, "week_end_date_key"),
month_key: __sdk::__query_builder::Col::new(table_name, "month_key"),
month_start_date_key: __sdk::__query_builder::Col::new(
table_name,
"month_start_date_key",
),
month_end_date_key: __sdk::__query_builder::Col::new(table_name, "month_end_date_key"),
quarter_key: __sdk::__query_builder::Col::new(table_name, "quarter_key"),
quarter_start_date_key: __sdk::__query_builder::Col::new(
table_name,
"quarter_start_date_key",
),
quarter_end_date_key: __sdk::__query_builder::Col::new(
table_name,
"quarter_end_date_key",
),
year_key: __sdk::__query_builder::Col::new(table_name, "year_key"),
year_start_date_key: __sdk::__query_builder::Col::new(
table_name,
"year_start_date_key",
),
year_end_date_key: __sdk::__query_builder::Col::new(table_name, "year_end_date_key"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
}
}
}
/// Indexed column accessor struct for the table `AnalyticsDateDimension`.
///
/// Provides typed access to indexed columns for query building.
pub struct AnalyticsDateDimensionIxCols {
pub date_key: __sdk::__query_builder::IxCol<AnalyticsDateDimension, i64>,
pub iso_week_key: __sdk::__query_builder::IxCol<AnalyticsDateDimension, i32>,
pub month_key: __sdk::__query_builder::IxCol<AnalyticsDateDimension, i32>,
pub quarter_key: __sdk::__query_builder::IxCol<AnalyticsDateDimension, i32>,
pub year_key: __sdk::__query_builder::IxCol<AnalyticsDateDimension, i32>,
}
impl __sdk::__query_builder::HasIxCols for AnalyticsDateDimension {
type IxCols = AnalyticsDateDimensionIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
AnalyticsDateDimensionIxCols {
date_key: __sdk::__query_builder::IxCol::new(table_name, "date_key"),
iso_week_key: __sdk::__query_builder::IxCol::new(table_name, "iso_week_key"),
month_key: __sdk::__query_builder::IxCol::new(table_name, "month_key"),
quarter_key: __sdk::__query_builder::IxCol::new(table_name, "quarter_key"),
year_key: __sdk::__query_builder::IxCol::new(table_name, "year_key"),
}
}
}
impl __sdk::__query_builder::CanBeLookupTable for AnalyticsDateDimension {}

View File

@@ -0,0 +1,24 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
#[derive(Copy, Eq, Hash)]
pub enum AnalyticsGranularity {
Day,
Week,
Month,
Quarter,
Year,
}
impl __sdk::InModule for AnalyticsGranularity {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,21 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::analytics_granularity_type::AnalyticsGranularity;
use super::runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct AnalyticsMetricQueryInput {
pub event_key: String,
pub scope_kind: RuntimeTrackingScopeKind,
pub scope_id: String,
pub granularity: AnalyticsGranularity,
}
impl __sdk::InModule for AnalyticsMetricQueryInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,19 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::analytics_bucket_metric_type::AnalyticsBucketMetric;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct AnalyticsMetricQueryProcedureResult {
pub ok: bool,
pub buckets: Vec<AnalyticsBucketMetric>,
pub error_message: Option<String>,
}
impl __sdk::InModule for AnalyticsMetricQueryProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::asset_entity_binding_type::AssetEntityBinding;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `asset_entity_binding`.
///
/// Obtain a handle from the [`AssetEntityBindingTableAccess::asset_entity_binding`] method on [`super::RemoteTables`],
/// like `ctx.db.asset_entity_binding()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.asset_entity_binding().on_insert(...)`.
pub struct AssetEntityBindingTableHandle<'ctx> {
imp: __sdk::TableHandle<AssetEntityBinding>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `asset_entity_binding`.
///
/// Implemented for [`super::RemoteTables`].
pub trait AssetEntityBindingTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`AssetEntityBindingTableHandle`], which mediates access to the table `asset_entity_binding`.
fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_>;
}
impl AssetEntityBindingTableAccess for super::RemoteTables {
fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_> {
AssetEntityBindingTableHandle {
imp: self
.imp
.get_table::<AssetEntityBinding>("asset_entity_binding"),
ctx: std::marker::PhantomData,
}
}
}
pub struct AssetEntityBindingInsertCallbackId(__sdk::CallbackId);
pub struct AssetEntityBindingDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for AssetEntityBindingTableHandle<'ctx> {
type Row = AssetEntityBinding;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AssetEntityBinding> + '_ {
self.imp.iter()
}
type InsertCallbackId = AssetEntityBindingInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AssetEntityBindingInsertCallbackId {
AssetEntityBindingInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: AssetEntityBindingInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = AssetEntityBindingDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AssetEntityBindingDeleteCallbackId {
AssetEntityBindingDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: AssetEntityBindingDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct AssetEntityBindingUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for AssetEntityBindingTableHandle<'ctx> {
type UpdateCallbackId = AssetEntityBindingUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> AssetEntityBindingUpdateCallbackId {
AssetEntityBindingUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: AssetEntityBindingUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `binding_id` unique index on the table `asset_entity_binding`,
/// which allows point queries on the field of the same name
/// via the [`AssetEntityBindingBindingIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.asset_entity_binding().binding_id().find(...)`.
pub struct AssetEntityBindingBindingIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AssetEntityBinding, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> AssetEntityBindingTableHandle<'ctx> {
/// Get a handle on the `binding_id` unique index on the table `asset_entity_binding`.
pub fn binding_id(&self) -> AssetEntityBindingBindingIdUnique<'ctx> {
AssetEntityBindingBindingIdUnique {
imp: self.imp.get_unique_constraint::<String>("binding_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> AssetEntityBindingBindingIdUnique<'ctx> {
/// Find the subscribed row whose `binding_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AssetEntityBinding> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AssetEntityBinding>("asset_entity_binding");
_table.add_unique_constraint::<String>("binding_id", |row| &row.binding_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AssetEntityBinding>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<AssetEntityBinding>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AssetEntityBinding`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait asset_entity_bindingQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `AssetEntityBinding`.
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding>;
}
impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor {
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding> {
__sdk::__query_builder::Table::new("asset_entity_binding")
}
}

View File

@@ -0,0 +1,160 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
use super::asset_object_type::AssetObject;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `asset_object`.
///
/// Obtain a handle from the [`AssetObjectTableAccess::asset_object`] method on [`super::RemoteTables`],
/// like `ctx.db.asset_object()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.asset_object().on_insert(...)`.
pub struct AssetObjectTableHandle<'ctx> {
imp: __sdk::TableHandle<AssetObject>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `asset_object`.
///
/// Implemented for [`super::RemoteTables`].
pub trait AssetObjectTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`AssetObjectTableHandle`], which mediates access to the table `asset_object`.
fn asset_object(&self) -> AssetObjectTableHandle<'_>;
}
impl AssetObjectTableAccess for super::RemoteTables {
fn asset_object(&self) -> AssetObjectTableHandle<'_> {
AssetObjectTableHandle {
imp: self.imp.get_table::<AssetObject>("asset_object"),
ctx: std::marker::PhantomData,
}
}
}
pub struct AssetObjectInsertCallbackId(__sdk::CallbackId);
pub struct AssetObjectDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for AssetObjectTableHandle<'ctx> {
type Row = AssetObject;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AssetObject> + '_ {
self.imp.iter()
}
type InsertCallbackId = AssetObjectInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AssetObjectInsertCallbackId {
AssetObjectInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: AssetObjectInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = AssetObjectDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AssetObjectDeleteCallbackId {
AssetObjectDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: AssetObjectDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct AssetObjectUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for AssetObjectTableHandle<'ctx> {
type UpdateCallbackId = AssetObjectUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> AssetObjectUpdateCallbackId {
AssetObjectUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: AssetObjectUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `asset_object_id` unique index on the table `asset_object`,
/// which allows point queries on the field of the same name
/// via the [`AssetObjectAssetObjectIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.asset_object().asset_object_id().find(...)`.
pub struct AssetObjectAssetObjectIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AssetObject, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> AssetObjectTableHandle<'ctx> {
/// Get a handle on the `asset_object_id` unique index on the table `asset_object`.
pub fn asset_object_id(&self) -> AssetObjectAssetObjectIdUnique<'ctx> {
AssetObjectAssetObjectIdUnique {
imp: self.imp.get_unique_constraint::<String>("asset_object_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> AssetObjectAssetObjectIdUnique<'ctx> {
/// Find the subscribed row whose `asset_object_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AssetObject> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AssetObject>("asset_object");
_table.add_unique_constraint::<String>("asset_object_id", |row| &row.asset_object_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AssetObject>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<AssetObject>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AssetObject`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait asset_objectQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `AssetObject`.
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject>;
}
impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor {
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject> {
__sdk::__query_builder::Table::new("asset_object")
}
}

View File

@@ -0,0 +1,159 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::auth_identity_type::AuthIdentity;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `auth_identity`.
///
/// Obtain a handle from the [`AuthIdentityTableAccess::auth_identity`] method on [`super::RemoteTables`],
/// like `ctx.db.auth_identity()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.auth_identity().on_insert(...)`.
pub struct AuthIdentityTableHandle<'ctx> {
imp: __sdk::TableHandle<AuthIdentity>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `auth_identity`.
///
/// Implemented for [`super::RemoteTables`].
pub trait AuthIdentityTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`AuthIdentityTableHandle`], which mediates access to the table `auth_identity`.
fn auth_identity(&self) -> AuthIdentityTableHandle<'_>;
}
impl AuthIdentityTableAccess for super::RemoteTables {
fn auth_identity(&self) -> AuthIdentityTableHandle<'_> {
AuthIdentityTableHandle {
imp: self.imp.get_table::<AuthIdentity>("auth_identity"),
ctx: std::marker::PhantomData,
}
}
}
pub struct AuthIdentityInsertCallbackId(__sdk::CallbackId);
pub struct AuthIdentityDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for AuthIdentityTableHandle<'ctx> {
type Row = AuthIdentity;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AuthIdentity> + '_ {
self.imp.iter()
}
type InsertCallbackId = AuthIdentityInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AuthIdentityInsertCallbackId {
AuthIdentityInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: AuthIdentityInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = AuthIdentityDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AuthIdentityDeleteCallbackId {
AuthIdentityDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: AuthIdentityDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct AuthIdentityUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for AuthIdentityTableHandle<'ctx> {
type UpdateCallbackId = AuthIdentityUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> AuthIdentityUpdateCallbackId {
AuthIdentityUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: AuthIdentityUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `identity_id` unique index on the table `auth_identity`,
/// which allows point queries on the field of the same name
/// via the [`AuthIdentityIdentityIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.auth_identity().identity_id().find(...)`.
pub struct AuthIdentityIdentityIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AuthIdentity, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> AuthIdentityTableHandle<'ctx> {
/// Get a handle on the `identity_id` unique index on the table `auth_identity`.
pub fn identity_id(&self) -> AuthIdentityIdentityIdUnique<'ctx> {
AuthIdentityIdentityIdUnique {
imp: self.imp.get_unique_constraint::<String>("identity_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> AuthIdentityIdentityIdUnique<'ctx> {
/// Find the subscribed row whose `identity_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AuthIdentity> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AuthIdentity>("auth_identity");
_table.add_unique_constraint::<String>("identity_id", |row| &row.identity_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AuthIdentity>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<AuthIdentity>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AuthIdentity`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait auth_identityQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `AuthIdentity`.
fn auth_identity(&self) -> __sdk::__query_builder::Table<AuthIdentity>;
}
impl auth_identityQueryTableAccess for __sdk::QueryTableAccessor {
fn auth_identity(&self) -> __sdk::__query_builder::Table<AuthIdentity> {
__sdk::__query_builder::Table::new("auth_identity")
}
}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::auth_store_snapshot_type::AuthStoreSnapshot;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `auth_store_snapshot`.
///
/// Obtain a handle from the [`AuthStoreSnapshotTableAccess::auth_store_snapshot`] method on [`super::RemoteTables`],
/// like `ctx.db.auth_store_snapshot()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.auth_store_snapshot().on_insert(...)`.
pub struct AuthStoreSnapshotTableHandle<'ctx> {
imp: __sdk::TableHandle<AuthStoreSnapshot>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `auth_store_snapshot`.
///
/// Implemented for [`super::RemoteTables`].
pub trait AuthStoreSnapshotTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`AuthStoreSnapshotTableHandle`], which mediates access to the table `auth_store_snapshot`.
fn auth_store_snapshot(&self) -> AuthStoreSnapshotTableHandle<'_>;
}
impl AuthStoreSnapshotTableAccess for super::RemoteTables {
fn auth_store_snapshot(&self) -> AuthStoreSnapshotTableHandle<'_> {
AuthStoreSnapshotTableHandle {
imp: self
.imp
.get_table::<AuthStoreSnapshot>("auth_store_snapshot"),
ctx: std::marker::PhantomData,
}
}
}
pub struct AuthStoreSnapshotInsertCallbackId(__sdk::CallbackId);
pub struct AuthStoreSnapshotDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for AuthStoreSnapshotTableHandle<'ctx> {
type Row = AuthStoreSnapshot;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = AuthStoreSnapshot> + '_ {
self.imp.iter()
}
type InsertCallbackId = AuthStoreSnapshotInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AuthStoreSnapshotInsertCallbackId {
AuthStoreSnapshotInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: AuthStoreSnapshotInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = AuthStoreSnapshotDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> AuthStoreSnapshotDeleteCallbackId {
AuthStoreSnapshotDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: AuthStoreSnapshotDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct AuthStoreSnapshotUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for AuthStoreSnapshotTableHandle<'ctx> {
type UpdateCallbackId = AuthStoreSnapshotUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> AuthStoreSnapshotUpdateCallbackId {
AuthStoreSnapshotUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: AuthStoreSnapshotUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `snapshot_id` unique index on the table `auth_store_snapshot`,
/// which allows point queries on the field of the same name
/// via the [`AuthStoreSnapshotSnapshotIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.auth_store_snapshot().snapshot_id().find(...)`.
pub struct AuthStoreSnapshotSnapshotIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<AuthStoreSnapshot, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> AuthStoreSnapshotTableHandle<'ctx> {
/// Get a handle on the `snapshot_id` unique index on the table `auth_store_snapshot`.
pub fn snapshot_id(&self) -> AuthStoreSnapshotSnapshotIdUnique<'ctx> {
AuthStoreSnapshotSnapshotIdUnique {
imp: self.imp.get_unique_constraint::<String>("snapshot_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> AuthStoreSnapshotSnapshotIdUnique<'ctx> {
/// Find the subscribed row whose `snapshot_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<AuthStoreSnapshot> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<AuthStoreSnapshot>("auth_store_snapshot");
_table.add_unique_constraint::<String>("snapshot_id", |row| &row.snapshot_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<AuthStoreSnapshot>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<AuthStoreSnapshot>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `AuthStoreSnapshot`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait auth_store_snapshotQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `AuthStoreSnapshot`.
fn auth_store_snapshot(&self) -> __sdk::__query_builder::Table<AuthStoreSnapshot>;
}
impl auth_store_snapshotQueryTableAccess for __sdk::QueryTableAccessor {
fn auth_store_snapshot(&self) -> __sdk::__query_builder::Table<AuthStoreSnapshot> {
__sdk::__query_builder::Table::new("auth_store_snapshot")
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::battle_mode_type::BattleMode;
use super::battle_state_type::BattleState;
use super::battle_status_type::BattleStatus;
use super::combat_outcome_type::CombatOutcome;
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `battle_state`.
///
/// Obtain a handle from the [`BattleStateTableAccess::battle_state`] method on [`super::RemoteTables`],
/// like `ctx.db.battle_state()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.battle_state().on_insert(...)`.
pub struct BattleStateTableHandle<'ctx> {
imp: __sdk::TableHandle<BattleState>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `battle_state`.
///
/// Implemented for [`super::RemoteTables`].
pub trait BattleStateTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`BattleStateTableHandle`], which mediates access to the table `battle_state`.
fn battle_state(&self) -> BattleStateTableHandle<'_>;
}
impl BattleStateTableAccess for super::RemoteTables {
fn battle_state(&self) -> BattleStateTableHandle<'_> {
BattleStateTableHandle {
imp: self.imp.get_table::<BattleState>("battle_state"),
ctx: std::marker::PhantomData,
}
}
}
pub struct BattleStateInsertCallbackId(__sdk::CallbackId);
pub struct BattleStateDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for BattleStateTableHandle<'ctx> {
type Row = BattleState;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = BattleState> + '_ {
self.imp.iter()
}
type InsertCallbackId = BattleStateInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> BattleStateInsertCallbackId {
BattleStateInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: BattleStateInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = BattleStateDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> BattleStateDeleteCallbackId {
BattleStateDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: BattleStateDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct BattleStateUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for BattleStateTableHandle<'ctx> {
type UpdateCallbackId = BattleStateUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> BattleStateUpdateCallbackId {
BattleStateUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: BattleStateUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `battle_state_id` unique index on the table `battle_state`,
/// which allows point queries on the field of the same name
/// via the [`BattleStateBattleStateIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.battle_state().battle_state_id().find(...)`.
pub struct BattleStateBattleStateIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<BattleState, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> BattleStateTableHandle<'ctx> {
/// Get a handle on the `battle_state_id` unique index on the table `battle_state`.
pub fn battle_state_id(&self) -> BattleStateBattleStateIdUnique<'ctx> {
BattleStateBattleStateIdUnique {
imp: self.imp.get_unique_constraint::<String>("battle_state_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> BattleStateBattleStateIdUnique<'ctx> {
/// Find the subscribed row whose `battle_state_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<BattleState> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<BattleState>("battle_state");
_table.add_unique_constraint::<String>("battle_state_id", |row| &row.battle_state_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<BattleState>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<BattleState>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `BattleState`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait battle_stateQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `BattleState`.
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState>;
}
impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor {
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState> {
__sdk::__query_builder::Table::new("battle_state")
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
use super::big_fish_agent_message_role_type::BigFishAgentMessageRole;
use super::big_fish_agent_message_type::BigFishAgentMessage;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `big_fish_agent_message`.
///
/// Obtain a handle from the [`BigFishAgentMessageTableAccess::big_fish_agent_message`] method on [`super::RemoteTables`],
/// like `ctx.db.big_fish_agent_message()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.big_fish_agent_message().on_insert(...)`.
pub struct BigFishAgentMessageTableHandle<'ctx> {
imp: __sdk::TableHandle<BigFishAgentMessage>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `big_fish_agent_message`.
///
/// Implemented for [`super::RemoteTables`].
pub trait BigFishAgentMessageTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`BigFishAgentMessageTableHandle`], which mediates access to the table `big_fish_agent_message`.
fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_>;
}
impl BigFishAgentMessageTableAccess for super::RemoteTables {
fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_> {
BigFishAgentMessageTableHandle {
imp: self
.imp
.get_table::<BigFishAgentMessage>("big_fish_agent_message"),
ctx: std::marker::PhantomData,
}
}
}
pub struct BigFishAgentMessageInsertCallbackId(__sdk::CallbackId);
pub struct BigFishAgentMessageDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for BigFishAgentMessageTableHandle<'ctx> {
type Row = BigFishAgentMessage;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = BigFishAgentMessage> + '_ {
self.imp.iter()
}
type InsertCallbackId = BigFishAgentMessageInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> BigFishAgentMessageInsertCallbackId {
BigFishAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: BigFishAgentMessageInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = BigFishAgentMessageDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> BigFishAgentMessageDeleteCallbackId {
BigFishAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: BigFishAgentMessageDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct BigFishAgentMessageUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAgentMessageTableHandle<'ctx> {
type UpdateCallbackId = BigFishAgentMessageUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> BigFishAgentMessageUpdateCallbackId {
BigFishAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: BigFishAgentMessageUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `message_id` unique index on the table `big_fish_agent_message`,
/// which allows point queries on the field of the same name
/// via the [`BigFishAgentMessageMessageIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.big_fish_agent_message().message_id().find(...)`.
pub struct BigFishAgentMessageMessageIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<BigFishAgentMessage, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> BigFishAgentMessageTableHandle<'ctx> {
/// Get a handle on the `message_id` unique index on the table `big_fish_agent_message`.
pub fn message_id(&self) -> BigFishAgentMessageMessageIdUnique<'ctx> {
BigFishAgentMessageMessageIdUnique {
imp: self.imp.get_unique_constraint::<String>("message_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> BigFishAgentMessageMessageIdUnique<'ctx> {
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<BigFishAgentMessage> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<BigFishAgentMessage>("big_fish_agent_message");
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<BigFishAgentMessage>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<BigFishAgentMessage>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `BigFishAgentMessage`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait big_fish_agent_messageQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `BigFishAgentMessage`.
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage>;
}
impl big_fish_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage> {
__sdk::__query_builder::Table::new("big_fish_agent_message")
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::big_fish_asset_kind_type::BigFishAssetKind;
use super::big_fish_asset_slot_type::BigFishAssetSlot;
use super::big_fish_asset_status_type::BigFishAssetStatus;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `big_fish_asset_slot`.
///
/// Obtain a handle from the [`BigFishAssetSlotTableAccess::big_fish_asset_slot`] method on [`super::RemoteTables`],
/// like `ctx.db.big_fish_asset_slot()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.big_fish_asset_slot().on_insert(...)`.
pub struct BigFishAssetSlotTableHandle<'ctx> {
imp: __sdk::TableHandle<BigFishAssetSlot>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `big_fish_asset_slot`.
///
/// Implemented for [`super::RemoteTables`].
pub trait BigFishAssetSlotTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`BigFishAssetSlotTableHandle`], which mediates access to the table `big_fish_asset_slot`.
fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_>;
}
impl BigFishAssetSlotTableAccess for super::RemoteTables {
fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_> {
BigFishAssetSlotTableHandle {
imp: self
.imp
.get_table::<BigFishAssetSlot>("big_fish_asset_slot"),
ctx: std::marker::PhantomData,
}
}
}
pub struct BigFishAssetSlotInsertCallbackId(__sdk::CallbackId);
pub struct BigFishAssetSlotDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for BigFishAssetSlotTableHandle<'ctx> {
type Row = BigFishAssetSlot;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = BigFishAssetSlot> + '_ {
self.imp.iter()
}
type InsertCallbackId = BigFishAssetSlotInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> BigFishAssetSlotInsertCallbackId {
BigFishAssetSlotInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: BigFishAssetSlotInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = BigFishAssetSlotDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> BigFishAssetSlotDeleteCallbackId {
BigFishAssetSlotDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: BigFishAssetSlotDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct BigFishAssetSlotUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAssetSlotTableHandle<'ctx> {
type UpdateCallbackId = BigFishAssetSlotUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> BigFishAssetSlotUpdateCallbackId {
BigFishAssetSlotUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: BigFishAssetSlotUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `slot_id` unique index on the table `big_fish_asset_slot`,
/// which allows point queries on the field of the same name
/// via the [`BigFishAssetSlotSlotIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.big_fish_asset_slot().slot_id().find(...)`.
pub struct BigFishAssetSlotSlotIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<BigFishAssetSlot, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> BigFishAssetSlotTableHandle<'ctx> {
/// Get a handle on the `slot_id` unique index on the table `big_fish_asset_slot`.
pub fn slot_id(&self) -> BigFishAssetSlotSlotIdUnique<'ctx> {
BigFishAssetSlotSlotIdUnique {
imp: self.imp.get_unique_constraint::<String>("slot_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> BigFishAssetSlotSlotIdUnique<'ctx> {
/// Find the subscribed row whose `slot_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<BigFishAssetSlot> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<BigFishAssetSlot>("big_fish_asset_slot");
_table.add_unique_constraint::<String>("slot_id", |row| &row.slot_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<BigFishAssetSlot>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<BigFishAssetSlot>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `BigFishAssetSlot`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait big_fish_asset_slotQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `BigFishAssetSlot`.
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot>;
}
impl big_fish_asset_slotQueryTableAccess for __sdk::QueryTableAccessor {
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot> {
__sdk::__query_builder::Table::new("big_fish_asset_slot")
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::big_fish_creation_session_type::BigFishCreationSession;
use super::big_fish_creation_stage_type::BigFishCreationStage;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `big_fish_creation_session`.
///
/// Obtain a handle from the [`BigFishCreationSessionTableAccess::big_fish_creation_session`] method on [`super::RemoteTables`],
/// like `ctx.db.big_fish_creation_session()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.big_fish_creation_session().on_insert(...)`.
pub struct BigFishCreationSessionTableHandle<'ctx> {
imp: __sdk::TableHandle<BigFishCreationSession>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `big_fish_creation_session`.
///
/// Implemented for [`super::RemoteTables`].
pub trait BigFishCreationSessionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`BigFishCreationSessionTableHandle`], which mediates access to the table `big_fish_creation_session`.
fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_>;
}
impl BigFishCreationSessionTableAccess for super::RemoteTables {
fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_> {
BigFishCreationSessionTableHandle {
imp: self
.imp
.get_table::<BigFishCreationSession>("big_fish_creation_session"),
ctx: std::marker::PhantomData,
}
}
}
pub struct BigFishCreationSessionInsertCallbackId(__sdk::CallbackId);
pub struct BigFishCreationSessionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for BigFishCreationSessionTableHandle<'ctx> {
type Row = BigFishCreationSession;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = BigFishCreationSession> + '_ {
self.imp.iter()
}
type InsertCallbackId = BigFishCreationSessionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> BigFishCreationSessionInsertCallbackId {
BigFishCreationSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: BigFishCreationSessionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = BigFishCreationSessionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> BigFishCreationSessionDeleteCallbackId {
BigFishCreationSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: BigFishCreationSessionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct BigFishCreationSessionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishCreationSessionTableHandle<'ctx> {
type UpdateCallbackId = BigFishCreationSessionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> BigFishCreationSessionUpdateCallbackId {
BigFishCreationSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: BigFishCreationSessionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `session_id` unique index on the table `big_fish_creation_session`,
/// which allows point queries on the field of the same name
/// via the [`BigFishCreationSessionSessionIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.big_fish_creation_session().session_id().find(...)`.
pub struct BigFishCreationSessionSessionIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<BigFishCreationSession, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> BigFishCreationSessionTableHandle<'ctx> {
/// Get a handle on the `session_id` unique index on the table `big_fish_creation_session`.
pub fn session_id(&self) -> BigFishCreationSessionSessionIdUnique<'ctx> {
BigFishCreationSessionSessionIdUnique {
imp: self.imp.get_unique_constraint::<String>("session_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> BigFishCreationSessionSessionIdUnique<'ctx> {
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<BigFishCreationSession> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<BigFishCreationSession>("big_fish_creation_session");
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<BigFishCreationSession>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<BigFishCreationSession>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `BigFishCreationSession`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait big_fish_creation_sessionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `BigFishCreationSession`.
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession>;
}
impl big_fish_creation_sessionQueryTableAccess for __sdk::QueryTableAccessor {
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession> {
__sdk::__query_builder::Table::new("big_fish_creation_session")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::big_fish_run_status_type::BigFishRunStatus;
use super::big_fish_runtime_run_type::BigFishRuntimeRun;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `big_fish_runtime_run`.
///
/// Obtain a handle from the [`BigFishRuntimeRunTableAccess::big_fish_runtime_run`] method on [`super::RemoteTables`],
/// like `ctx.db.big_fish_runtime_run()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.big_fish_runtime_run().on_insert(...)`.
pub struct BigFishRuntimeRunTableHandle<'ctx> {
imp: __sdk::TableHandle<BigFishRuntimeRun>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `big_fish_runtime_run`.
///
/// Implemented for [`super::RemoteTables`].
pub trait BigFishRuntimeRunTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`BigFishRuntimeRunTableHandle`], which mediates access to the table `big_fish_runtime_run`.
fn big_fish_runtime_run(&self) -> BigFishRuntimeRunTableHandle<'_>;
}
impl BigFishRuntimeRunTableAccess for super::RemoteTables {
fn big_fish_runtime_run(&self) -> BigFishRuntimeRunTableHandle<'_> {
BigFishRuntimeRunTableHandle {
imp: self
.imp
.get_table::<BigFishRuntimeRun>("big_fish_runtime_run"),
ctx: std::marker::PhantomData,
}
}
}
pub struct BigFishRuntimeRunInsertCallbackId(__sdk::CallbackId);
pub struct BigFishRuntimeRunDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for BigFishRuntimeRunTableHandle<'ctx> {
type Row = BigFishRuntimeRun;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = BigFishRuntimeRun> + '_ {
self.imp.iter()
}
type InsertCallbackId = BigFishRuntimeRunInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> BigFishRuntimeRunInsertCallbackId {
BigFishRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: BigFishRuntimeRunInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = BigFishRuntimeRunDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> BigFishRuntimeRunDeleteCallbackId {
BigFishRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: BigFishRuntimeRunDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct BigFishRuntimeRunUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishRuntimeRunTableHandle<'ctx> {
type UpdateCallbackId = BigFishRuntimeRunUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> BigFishRuntimeRunUpdateCallbackId {
BigFishRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: BigFishRuntimeRunUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `run_id` unique index on the table `big_fish_runtime_run`,
/// which allows point queries on the field of the same name
/// via the [`BigFishRuntimeRunRunIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.big_fish_runtime_run().run_id().find(...)`.
pub struct BigFishRuntimeRunRunIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<BigFishRuntimeRun, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> BigFishRuntimeRunTableHandle<'ctx> {
/// Get a handle on the `run_id` unique index on the table `big_fish_runtime_run`.
pub fn run_id(&self) -> BigFishRuntimeRunRunIdUnique<'ctx> {
BigFishRuntimeRunRunIdUnique {
imp: self.imp.get_unique_constraint::<String>("run_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> BigFishRuntimeRunRunIdUnique<'ctx> {
/// Find the subscribed row whose `run_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<BigFishRuntimeRun> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<BigFishRuntimeRun>("big_fish_runtime_run");
_table.add_unique_constraint::<String>("run_id", |row| &row.run_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<BigFishRuntimeRun>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<BigFishRuntimeRun>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `BigFishRuntimeRun`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait big_fish_runtime_runQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `BigFishRuntimeRun`.
fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table<BigFishRuntimeRun>;
}
impl big_fish_runtime_runQueryTableAccess for __sdk::QueryTableAccessor {
fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table<BigFishRuntimeRun> {
__sdk::__query_builder::Table::new("big_fish_runtime_run")
}
}

View File

@@ -0,0 +1,166 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::chapter_pace_band_type::ChapterPaceBand;
use super::chapter_progression_type::ChapterProgression;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `chapter_progression`.
///
/// Obtain a handle from the [`ChapterProgressionTableAccess::chapter_progression`] method on [`super::RemoteTables`],
/// like `ctx.db.chapter_progression()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.chapter_progression().on_insert(...)`.
pub struct ChapterProgressionTableHandle<'ctx> {
imp: __sdk::TableHandle<ChapterProgression>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `chapter_progression`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ChapterProgressionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ChapterProgressionTableHandle`], which mediates access to the table `chapter_progression`.
fn chapter_progression(&self) -> ChapterProgressionTableHandle<'_>;
}
impl ChapterProgressionTableAccess for super::RemoteTables {
fn chapter_progression(&self) -> ChapterProgressionTableHandle<'_> {
ChapterProgressionTableHandle {
imp: self
.imp
.get_table::<ChapterProgression>("chapter_progression"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ChapterProgressionInsertCallbackId(__sdk::CallbackId);
pub struct ChapterProgressionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ChapterProgressionTableHandle<'ctx> {
type Row = ChapterProgression;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ChapterProgression> + '_ {
self.imp.iter()
}
type InsertCallbackId = ChapterProgressionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ChapterProgressionInsertCallbackId {
ChapterProgressionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ChapterProgressionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ChapterProgressionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ChapterProgressionDeleteCallbackId {
ChapterProgressionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ChapterProgressionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ChapterProgressionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ChapterProgressionTableHandle<'ctx> {
type UpdateCallbackId = ChapterProgressionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ChapterProgressionUpdateCallbackId {
ChapterProgressionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ChapterProgressionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `chapter_progression_id` unique index on the table `chapter_progression`,
/// which allows point queries on the field of the same name
/// via the [`ChapterProgressionChapterProgressionIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.chapter_progression().chapter_progression_id().find(...)`.
pub struct ChapterProgressionChapterProgressionIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ChapterProgression, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ChapterProgressionTableHandle<'ctx> {
/// Get a handle on the `chapter_progression_id` unique index on the table `chapter_progression`.
pub fn chapter_progression_id(&self) -> ChapterProgressionChapterProgressionIdUnique<'ctx> {
ChapterProgressionChapterProgressionIdUnique {
imp: self
.imp
.get_unique_constraint::<String>("chapter_progression_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ChapterProgressionChapterProgressionIdUnique<'ctx> {
/// Find the subscribed row whose `chapter_progression_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ChapterProgression> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<ChapterProgression>("chapter_progression");
_table.add_unique_constraint::<String>("chapter_progression_id", |row| {
&row.chapter_progression_id
});
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ChapterProgression>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ChapterProgression>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ChapterProgression`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait chapter_progressionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ChapterProgression`.
fn chapter_progression(&self) -> __sdk::__query_builder::Table<ChapterProgression>;
}
impl chapter_progressionQueryTableAccess for __sdk::QueryTableAccessor {
fn chapter_progression(&self) -> __sdk::__query_builder::Table<ChapterProgression> {
__sdk::__query_builder::Table::new("chapter_progression")
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_agent_session_procedure_result_type::SquareHoleAgentSessionProcedureResult;
use super::square_hole_draft_compile_input_type::SquareHoleDraftCompileInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct CompileSquareHoleDraftArgs {
pub input: SquareHoleDraftCompileInput,
}
impl __sdk::InModule for CompileSquareHoleDraftArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `compile_square_hole_draft`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait compile_square_hole_draft {
fn compile_square_hole_draft(&self, input: SquareHoleDraftCompileInput) {
self.compile_square_hole_draft_then(input, |_, _| {});
}
fn compile_square_hole_draft_then(
&self,
input: SquareHoleDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl compile_square_hole_draft for super::RemoteProcedures {
fn compile_square_hole_draft_then(
&self,
input: SquareHoleDraftCompileInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleAgentSessionProcedureResult>(
"compile_square_hole_draft",
CompileSquareHoleDraftArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_agent_session_create_input_type::SquareHoleAgentSessionCreateInput;
use super::square_hole_agent_session_procedure_result_type::SquareHoleAgentSessionProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct CreateSquareHoleAgentSessionArgs {
pub input: SquareHoleAgentSessionCreateInput,
}
impl __sdk::InModule for CreateSquareHoleAgentSessionArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `create_square_hole_agent_session`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait create_square_hole_agent_session {
fn create_square_hole_agent_session(&self, input: SquareHoleAgentSessionCreateInput) {
self.create_square_hole_agent_session_then(input, |_, _| {});
}
fn create_square_hole_agent_session_then(
&self,
input: SquareHoleAgentSessionCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl create_square_hole_agent_session for super::RemoteProcedures {
fn create_square_hole_agent_session_then(
&self,
input: SquareHoleAgentSessionCreateInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleAgentSessionProcedureResult>(
"create_square_hole_agent_session",
CreateSquareHoleAgentSessionArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,164 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::custom_world_agent_message_type::CustomWorldAgentMessage;
use super::rpg_agent_message_kind_type::RpgAgentMessageKind;
use super::rpg_agent_message_role_type::RpgAgentMessageRole;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `custom_world_agent_message`.
///
/// Obtain a handle from the [`CustomWorldAgentMessageTableAccess::custom_world_agent_message`] method on [`super::RemoteTables`],
/// like `ctx.db.custom_world_agent_message()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_agent_message().on_insert(...)`.
pub struct CustomWorldAgentMessageTableHandle<'ctx> {
imp: __sdk::TableHandle<CustomWorldAgentMessage>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `custom_world_agent_message`.
///
/// Implemented for [`super::RemoteTables`].
pub trait CustomWorldAgentMessageTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`CustomWorldAgentMessageTableHandle`], which mediates access to the table `custom_world_agent_message`.
fn custom_world_agent_message(&self) -> CustomWorldAgentMessageTableHandle<'_>;
}
impl CustomWorldAgentMessageTableAccess for super::RemoteTables {
fn custom_world_agent_message(&self) -> CustomWorldAgentMessageTableHandle<'_> {
CustomWorldAgentMessageTableHandle {
imp: self
.imp
.get_table::<CustomWorldAgentMessage>("custom_world_agent_message"),
ctx: std::marker::PhantomData,
}
}
}
pub struct CustomWorldAgentMessageInsertCallbackId(__sdk::CallbackId);
pub struct CustomWorldAgentMessageDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for CustomWorldAgentMessageTableHandle<'ctx> {
type Row = CustomWorldAgentMessage;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = CustomWorldAgentMessage> + '_ {
self.imp.iter()
}
type InsertCallbackId = CustomWorldAgentMessageInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldAgentMessageInsertCallbackId {
CustomWorldAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: CustomWorldAgentMessageInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = CustomWorldAgentMessageDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldAgentMessageDeleteCallbackId {
CustomWorldAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: CustomWorldAgentMessageDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct CustomWorldAgentMessageUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentMessageTableHandle<'ctx> {
type UpdateCallbackId = CustomWorldAgentMessageUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> CustomWorldAgentMessageUpdateCallbackId {
CustomWorldAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: CustomWorldAgentMessageUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `message_id` unique index on the table `custom_world_agent_message`,
/// which allows point queries on the field of the same name
/// via the [`CustomWorldAgentMessageMessageIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_agent_message().message_id().find(...)`.
pub struct CustomWorldAgentMessageMessageIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<CustomWorldAgentMessage, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> CustomWorldAgentMessageTableHandle<'ctx> {
/// Get a handle on the `message_id` unique index on the table `custom_world_agent_message`.
pub fn message_id(&self) -> CustomWorldAgentMessageMessageIdUnique<'ctx> {
CustomWorldAgentMessageMessageIdUnique {
imp: self.imp.get_unique_constraint::<String>("message_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> CustomWorldAgentMessageMessageIdUnique<'ctx> {
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<CustomWorldAgentMessage> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<CustomWorldAgentMessage>("custom_world_agent_message");
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldAgentMessage>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldAgentMessage>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `CustomWorldAgentMessage`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait custom_world_agent_messageQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `CustomWorldAgentMessage`.
fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table<CustomWorldAgentMessage>;
}
impl custom_world_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table<CustomWorldAgentMessage> {
__sdk::__query_builder::Table::new("custom_world_agent_message")
}
}

View File

@@ -0,0 +1,168 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::custom_world_agent_operation_type::CustomWorldAgentOperation;
use super::rpg_agent_operation_status_type::RpgAgentOperationStatus;
use super::rpg_agent_operation_type_type::RpgAgentOperationType;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `custom_world_agent_operation`.
///
/// Obtain a handle from the [`CustomWorldAgentOperationTableAccess::custom_world_agent_operation`] method on [`super::RemoteTables`],
/// like `ctx.db.custom_world_agent_operation()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_agent_operation().on_insert(...)`.
pub struct CustomWorldAgentOperationTableHandle<'ctx> {
imp: __sdk::TableHandle<CustomWorldAgentOperation>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `custom_world_agent_operation`.
///
/// Implemented for [`super::RemoteTables`].
pub trait CustomWorldAgentOperationTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`CustomWorldAgentOperationTableHandle`], which mediates access to the table `custom_world_agent_operation`.
fn custom_world_agent_operation(&self) -> CustomWorldAgentOperationTableHandle<'_>;
}
impl CustomWorldAgentOperationTableAccess for super::RemoteTables {
fn custom_world_agent_operation(&self) -> CustomWorldAgentOperationTableHandle<'_> {
CustomWorldAgentOperationTableHandle {
imp: self
.imp
.get_table::<CustomWorldAgentOperation>("custom_world_agent_operation"),
ctx: std::marker::PhantomData,
}
}
}
pub struct CustomWorldAgentOperationInsertCallbackId(__sdk::CallbackId);
pub struct CustomWorldAgentOperationDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for CustomWorldAgentOperationTableHandle<'ctx> {
type Row = CustomWorldAgentOperation;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = CustomWorldAgentOperation> + '_ {
self.imp.iter()
}
type InsertCallbackId = CustomWorldAgentOperationInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldAgentOperationInsertCallbackId {
CustomWorldAgentOperationInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: CustomWorldAgentOperationInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = CustomWorldAgentOperationDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldAgentOperationDeleteCallbackId {
CustomWorldAgentOperationDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: CustomWorldAgentOperationDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct CustomWorldAgentOperationUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentOperationTableHandle<'ctx> {
type UpdateCallbackId = CustomWorldAgentOperationUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> CustomWorldAgentOperationUpdateCallbackId {
CustomWorldAgentOperationUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: CustomWorldAgentOperationUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `operation_id` unique index on the table `custom_world_agent_operation`,
/// which allows point queries on the field of the same name
/// via the [`CustomWorldAgentOperationOperationIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_agent_operation().operation_id().find(...)`.
pub struct CustomWorldAgentOperationOperationIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<CustomWorldAgentOperation, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> CustomWorldAgentOperationTableHandle<'ctx> {
/// Get a handle on the `operation_id` unique index on the table `custom_world_agent_operation`.
pub fn operation_id(&self) -> CustomWorldAgentOperationOperationIdUnique<'ctx> {
CustomWorldAgentOperationOperationIdUnique {
imp: self.imp.get_unique_constraint::<String>("operation_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> CustomWorldAgentOperationOperationIdUnique<'ctx> {
/// Find the subscribed row whose `operation_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<CustomWorldAgentOperation> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<CustomWorldAgentOperation>("custom_world_agent_operation");
_table.add_unique_constraint::<String>("operation_id", |row| &row.operation_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldAgentOperation>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldAgentOperation>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `CustomWorldAgentOperation`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait custom_world_agent_operationQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `CustomWorldAgentOperation`.
fn custom_world_agent_operation(
&self,
) -> __sdk::__query_builder::Table<CustomWorldAgentOperation>;
}
impl custom_world_agent_operationQueryTableAccess for __sdk::QueryTableAccessor {
fn custom_world_agent_operation(
&self,
) -> __sdk::__query_builder::Table<CustomWorldAgentOperation> {
__sdk::__query_builder::Table::new("custom_world_agent_operation")
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::custom_world_agent_session_type::CustomWorldAgentSession;
use super::rpg_agent_stage_type::RpgAgentStage;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `custom_world_agent_session`.
///
/// Obtain a handle from the [`CustomWorldAgentSessionTableAccess::custom_world_agent_session`] method on [`super::RemoteTables`],
/// like `ctx.db.custom_world_agent_session()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_agent_session().on_insert(...)`.
pub struct CustomWorldAgentSessionTableHandle<'ctx> {
imp: __sdk::TableHandle<CustomWorldAgentSession>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `custom_world_agent_session`.
///
/// Implemented for [`super::RemoteTables`].
pub trait CustomWorldAgentSessionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`CustomWorldAgentSessionTableHandle`], which mediates access to the table `custom_world_agent_session`.
fn custom_world_agent_session(&self) -> CustomWorldAgentSessionTableHandle<'_>;
}
impl CustomWorldAgentSessionTableAccess for super::RemoteTables {
fn custom_world_agent_session(&self) -> CustomWorldAgentSessionTableHandle<'_> {
CustomWorldAgentSessionTableHandle {
imp: self
.imp
.get_table::<CustomWorldAgentSession>("custom_world_agent_session"),
ctx: std::marker::PhantomData,
}
}
}
pub struct CustomWorldAgentSessionInsertCallbackId(__sdk::CallbackId);
pub struct CustomWorldAgentSessionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for CustomWorldAgentSessionTableHandle<'ctx> {
type Row = CustomWorldAgentSession;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = CustomWorldAgentSession> + '_ {
self.imp.iter()
}
type InsertCallbackId = CustomWorldAgentSessionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldAgentSessionInsertCallbackId {
CustomWorldAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: CustomWorldAgentSessionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = CustomWorldAgentSessionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldAgentSessionDeleteCallbackId {
CustomWorldAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: CustomWorldAgentSessionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct CustomWorldAgentSessionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentSessionTableHandle<'ctx> {
type UpdateCallbackId = CustomWorldAgentSessionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> CustomWorldAgentSessionUpdateCallbackId {
CustomWorldAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: CustomWorldAgentSessionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `session_id` unique index on the table `custom_world_agent_session`,
/// which allows point queries on the field of the same name
/// via the [`CustomWorldAgentSessionSessionIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_agent_session().session_id().find(...)`.
pub struct CustomWorldAgentSessionSessionIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<CustomWorldAgentSession, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> CustomWorldAgentSessionTableHandle<'ctx> {
/// Get a handle on the `session_id` unique index on the table `custom_world_agent_session`.
pub fn session_id(&self) -> CustomWorldAgentSessionSessionIdUnique<'ctx> {
CustomWorldAgentSessionSessionIdUnique {
imp: self.imp.get_unique_constraint::<String>("session_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> CustomWorldAgentSessionSessionIdUnique<'ctx> {
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<CustomWorldAgentSession> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<CustomWorldAgentSession>("custom_world_agent_session");
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldAgentSession>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldAgentSession>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `CustomWorldAgentSession`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait custom_world_agent_sessionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `CustomWorldAgentSession`.
fn custom_world_agent_session(&self) -> __sdk::__query_builder::Table<CustomWorldAgentSession>;
}
impl custom_world_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor {
fn custom_world_agent_session(&self) -> __sdk::__query_builder::Table<CustomWorldAgentSession> {
__sdk::__query_builder::Table::new("custom_world_agent_session")
}
}

View File

@@ -0,0 +1,164 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::custom_world_draft_card_type::CustomWorldDraftCard;
use super::custom_world_role_asset_status_type::CustomWorldRoleAssetStatus;
use super::rpg_agent_draft_card_kind_type::RpgAgentDraftCardKind;
use super::rpg_agent_draft_card_status_type::RpgAgentDraftCardStatus;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `custom_world_draft_card`.
///
/// Obtain a handle from the [`CustomWorldDraftCardTableAccess::custom_world_draft_card`] method on [`super::RemoteTables`],
/// like `ctx.db.custom_world_draft_card()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_draft_card().on_insert(...)`.
pub struct CustomWorldDraftCardTableHandle<'ctx> {
imp: __sdk::TableHandle<CustomWorldDraftCard>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `custom_world_draft_card`.
///
/// Implemented for [`super::RemoteTables`].
pub trait CustomWorldDraftCardTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`CustomWorldDraftCardTableHandle`], which mediates access to the table `custom_world_draft_card`.
fn custom_world_draft_card(&self) -> CustomWorldDraftCardTableHandle<'_>;
}
impl CustomWorldDraftCardTableAccess for super::RemoteTables {
fn custom_world_draft_card(&self) -> CustomWorldDraftCardTableHandle<'_> {
CustomWorldDraftCardTableHandle {
imp: self
.imp
.get_table::<CustomWorldDraftCard>("custom_world_draft_card"),
ctx: std::marker::PhantomData,
}
}
}
pub struct CustomWorldDraftCardInsertCallbackId(__sdk::CallbackId);
pub struct CustomWorldDraftCardDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for CustomWorldDraftCardTableHandle<'ctx> {
type Row = CustomWorldDraftCard;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = CustomWorldDraftCard> + '_ {
self.imp.iter()
}
type InsertCallbackId = CustomWorldDraftCardInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldDraftCardInsertCallbackId {
CustomWorldDraftCardInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: CustomWorldDraftCardInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = CustomWorldDraftCardDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldDraftCardDeleteCallbackId {
CustomWorldDraftCardDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: CustomWorldDraftCardDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct CustomWorldDraftCardUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldDraftCardTableHandle<'ctx> {
type UpdateCallbackId = CustomWorldDraftCardUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> CustomWorldDraftCardUpdateCallbackId {
CustomWorldDraftCardUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: CustomWorldDraftCardUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `card_id` unique index on the table `custom_world_draft_card`,
/// which allows point queries on the field of the same name
/// via the [`CustomWorldDraftCardCardIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_draft_card().card_id().find(...)`.
pub struct CustomWorldDraftCardCardIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<CustomWorldDraftCard, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> CustomWorldDraftCardTableHandle<'ctx> {
/// Get a handle on the `card_id` unique index on the table `custom_world_draft_card`.
pub fn card_id(&self) -> CustomWorldDraftCardCardIdUnique<'ctx> {
CustomWorldDraftCardCardIdUnique {
imp: self.imp.get_unique_constraint::<String>("card_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> CustomWorldDraftCardCardIdUnique<'ctx> {
/// Find the subscribed row whose `card_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<CustomWorldDraftCard> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<CustomWorldDraftCard>("custom_world_draft_card");
_table.add_unique_constraint::<String>("card_id", |row| &row.card_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldDraftCard>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldDraftCard>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `CustomWorldDraftCard`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait custom_world_draft_cardQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `CustomWorldDraftCard`.
fn custom_world_draft_card(&self) -> __sdk::__query_builder::Table<CustomWorldDraftCard>;
}
impl custom_world_draft_cardQueryTableAccess for __sdk::QueryTableAccessor {
fn custom_world_draft_card(&self) -> __sdk::__query_builder::Table<CustomWorldDraftCard> {
__sdk::__query_builder::Table::new("custom_world_draft_card")
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::custom_world_profile_type::CustomWorldProfile;
use super::custom_world_publication_status_type::CustomWorldPublicationStatus;
use super::custom_world_theme_mode_type::CustomWorldThemeMode;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `custom_world_profile`.
///
/// Obtain a handle from the [`CustomWorldProfileTableAccess::custom_world_profile`] method on [`super::RemoteTables`],
/// like `ctx.db.custom_world_profile()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_profile().on_insert(...)`.
pub struct CustomWorldProfileTableHandle<'ctx> {
imp: __sdk::TableHandle<CustomWorldProfile>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `custom_world_profile`.
///
/// Implemented for [`super::RemoteTables`].
pub trait CustomWorldProfileTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`CustomWorldProfileTableHandle`], which mediates access to the table `custom_world_profile`.
fn custom_world_profile(&self) -> CustomWorldProfileTableHandle<'_>;
}
impl CustomWorldProfileTableAccess for super::RemoteTables {
fn custom_world_profile(&self) -> CustomWorldProfileTableHandle<'_> {
CustomWorldProfileTableHandle {
imp: self
.imp
.get_table::<CustomWorldProfile>("custom_world_profile"),
ctx: std::marker::PhantomData,
}
}
}
pub struct CustomWorldProfileInsertCallbackId(__sdk::CallbackId);
pub struct CustomWorldProfileDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for CustomWorldProfileTableHandle<'ctx> {
type Row = CustomWorldProfile;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = CustomWorldProfile> + '_ {
self.imp.iter()
}
type InsertCallbackId = CustomWorldProfileInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldProfileInsertCallbackId {
CustomWorldProfileInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: CustomWorldProfileInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = CustomWorldProfileDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldProfileDeleteCallbackId {
CustomWorldProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: CustomWorldProfileDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct CustomWorldProfileUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldProfileTableHandle<'ctx> {
type UpdateCallbackId = CustomWorldProfileUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> CustomWorldProfileUpdateCallbackId {
CustomWorldProfileUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: CustomWorldProfileUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `profile_id` unique index on the table `custom_world_profile`,
/// which allows point queries on the field of the same name
/// via the [`CustomWorldProfileProfileIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_profile().profile_id().find(...)`.
pub struct CustomWorldProfileProfileIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<CustomWorldProfile, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> CustomWorldProfileTableHandle<'ctx> {
/// Get a handle on the `profile_id` unique index on the table `custom_world_profile`.
pub fn profile_id(&self) -> CustomWorldProfileProfileIdUnique<'ctx> {
CustomWorldProfileProfileIdUnique {
imp: self.imp.get_unique_constraint::<String>("profile_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> CustomWorldProfileProfileIdUnique<'ctx> {
/// Find the subscribed row whose `profile_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<CustomWorldProfile> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<CustomWorldProfile>("custom_world_profile");
_table.add_unique_constraint::<String>("profile_id", |row| &row.profile_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldProfile>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldProfile>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `CustomWorldProfile`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait custom_world_profileQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `CustomWorldProfile`.
fn custom_world_profile(&self) -> __sdk::__query_builder::Table<CustomWorldProfile>;
}
impl custom_world_profileQueryTableAccess for __sdk::QueryTableAccessor {
fn custom_world_profile(&self) -> __sdk::__query_builder::Table<CustomWorldProfile> {
__sdk::__query_builder::Table::new("custom_world_profile")
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::custom_world_generation_mode_type::CustomWorldGenerationMode;
use super::custom_world_session_status_type::CustomWorldSessionStatus;
use super::custom_world_session_type::CustomWorldSession;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `custom_world_session`.
///
/// Obtain a handle from the [`CustomWorldSessionTableAccess::custom_world_session`] method on [`super::RemoteTables`],
/// like `ctx.db.custom_world_session()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_session().on_insert(...)`.
pub struct CustomWorldSessionTableHandle<'ctx> {
imp: __sdk::TableHandle<CustomWorldSession>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `custom_world_session`.
///
/// Implemented for [`super::RemoteTables`].
pub trait CustomWorldSessionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`CustomWorldSessionTableHandle`], which mediates access to the table `custom_world_session`.
fn custom_world_session(&self) -> CustomWorldSessionTableHandle<'_>;
}
impl CustomWorldSessionTableAccess for super::RemoteTables {
fn custom_world_session(&self) -> CustomWorldSessionTableHandle<'_> {
CustomWorldSessionTableHandle {
imp: self
.imp
.get_table::<CustomWorldSession>("custom_world_session"),
ctx: std::marker::PhantomData,
}
}
}
pub struct CustomWorldSessionInsertCallbackId(__sdk::CallbackId);
pub struct CustomWorldSessionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for CustomWorldSessionTableHandle<'ctx> {
type Row = CustomWorldSession;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = CustomWorldSession> + '_ {
self.imp.iter()
}
type InsertCallbackId = CustomWorldSessionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldSessionInsertCallbackId {
CustomWorldSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: CustomWorldSessionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = CustomWorldSessionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> CustomWorldSessionDeleteCallbackId {
CustomWorldSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: CustomWorldSessionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct CustomWorldSessionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldSessionTableHandle<'ctx> {
type UpdateCallbackId = CustomWorldSessionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> CustomWorldSessionUpdateCallbackId {
CustomWorldSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: CustomWorldSessionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `session_id` unique index on the table `custom_world_session`,
/// which allows point queries on the field of the same name
/// via the [`CustomWorldSessionSessionIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.custom_world_session().session_id().find(...)`.
pub struct CustomWorldSessionSessionIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<CustomWorldSession, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> CustomWorldSessionTableHandle<'ctx> {
/// Get a handle on the `session_id` unique index on the table `custom_world_session`.
pub fn session_id(&self) -> CustomWorldSessionSessionIdUnique<'ctx> {
CustomWorldSessionSessionIdUnique {
imp: self.imp.get_unique_constraint::<String>("session_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> CustomWorldSessionSessionIdUnique<'ctx> {
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<CustomWorldSession> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<CustomWorldSession>("custom_world_session");
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldSession>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldSession>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `CustomWorldSession`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait custom_world_sessionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `CustomWorldSession`.
fn custom_world_session(&self) -> __sdk::__query_builder::Table<CustomWorldSession>;
}
impl custom_world_sessionQueryTableAccess for __sdk::QueryTableAccessor {
fn custom_world_session(&self) -> __sdk::__query_builder::Table<CustomWorldSession> {
__sdk::__query_builder::Table::new("custom_world_session")
}
}

View File

@@ -0,0 +1,169 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::database_migration_import_chunk_type::DatabaseMigrationImportChunk;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `database_migration_import_chunk`.
///
/// Obtain a handle from the [`DatabaseMigrationImportChunkTableAccess::database_migration_import_chunk`] method on [`super::RemoteTables`],
/// like `ctx.db.database_migration_import_chunk()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.database_migration_import_chunk().on_insert(...)`.
pub struct DatabaseMigrationImportChunkTableHandle<'ctx> {
imp: __sdk::TableHandle<DatabaseMigrationImportChunk>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `database_migration_import_chunk`.
///
/// Implemented for [`super::RemoteTables`].
pub trait DatabaseMigrationImportChunkTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`DatabaseMigrationImportChunkTableHandle`], which mediates access to the table `database_migration_import_chunk`.
fn database_migration_import_chunk(&self) -> DatabaseMigrationImportChunkTableHandle<'_>;
}
impl DatabaseMigrationImportChunkTableAccess for super::RemoteTables {
fn database_migration_import_chunk(&self) -> DatabaseMigrationImportChunkTableHandle<'_> {
DatabaseMigrationImportChunkTableHandle {
imp: self
.imp
.get_table::<DatabaseMigrationImportChunk>("database_migration_import_chunk"),
ctx: std::marker::PhantomData,
}
}
}
pub struct DatabaseMigrationImportChunkInsertCallbackId(__sdk::CallbackId);
pub struct DatabaseMigrationImportChunkDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for DatabaseMigrationImportChunkTableHandle<'ctx> {
type Row = DatabaseMigrationImportChunk;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = DatabaseMigrationImportChunk> + '_ {
self.imp.iter()
}
type InsertCallbackId = DatabaseMigrationImportChunkInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> DatabaseMigrationImportChunkInsertCallbackId {
DatabaseMigrationImportChunkInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: DatabaseMigrationImportChunkInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = DatabaseMigrationImportChunkDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> DatabaseMigrationImportChunkDeleteCallbackId {
DatabaseMigrationImportChunkDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: DatabaseMigrationImportChunkDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct DatabaseMigrationImportChunkUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for DatabaseMigrationImportChunkTableHandle<'ctx> {
type UpdateCallbackId = DatabaseMigrationImportChunkUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> DatabaseMigrationImportChunkUpdateCallbackId {
DatabaseMigrationImportChunkUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: DatabaseMigrationImportChunkUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `chunk_key` unique index on the table `database_migration_import_chunk`,
/// which allows point queries on the field of the same name
/// via the [`DatabaseMigrationImportChunkChunkKeyUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.database_migration_import_chunk().chunk_key().find(...)`.
pub struct DatabaseMigrationImportChunkChunkKeyUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<DatabaseMigrationImportChunk, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> DatabaseMigrationImportChunkTableHandle<'ctx> {
/// Get a handle on the `chunk_key` unique index on the table `database_migration_import_chunk`.
pub fn chunk_key(&self) -> DatabaseMigrationImportChunkChunkKeyUnique<'ctx> {
DatabaseMigrationImportChunkChunkKeyUnique {
imp: self.imp.get_unique_constraint::<String>("chunk_key"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> DatabaseMigrationImportChunkChunkKeyUnique<'ctx> {
/// Find the subscribed row whose `chunk_key` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<DatabaseMigrationImportChunk> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache
.get_or_make_table::<DatabaseMigrationImportChunk>("database_migration_import_chunk");
_table.add_unique_constraint::<String>("chunk_key", |row| &row.chunk_key);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<DatabaseMigrationImportChunk>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse(
"TableUpdate<DatabaseMigrationImportChunk>",
"TableUpdate",
)
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `DatabaseMigrationImportChunk`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait database_migration_import_chunkQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `DatabaseMigrationImportChunk`.
fn database_migration_import_chunk(
&self,
) -> __sdk::__query_builder::Table<DatabaseMigrationImportChunk>;
}
impl database_migration_import_chunkQueryTableAccess for __sdk::QueryTableAccessor {
fn database_migration_import_chunk(
&self,
) -> __sdk::__query_builder::Table<DatabaseMigrationImportChunk> {
__sdk::__query_builder::Table::new("database_migration_import_chunk")
}
}

View File

@@ -0,0 +1,170 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::database_migration_operator_type::DatabaseMigrationOperator;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `database_migration_operator`.
///
/// Obtain a handle from the [`DatabaseMigrationOperatorTableAccess::database_migration_operator`] method on [`super::RemoteTables`],
/// like `ctx.db.database_migration_operator()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.database_migration_operator().on_insert(...)`.
pub struct DatabaseMigrationOperatorTableHandle<'ctx> {
imp: __sdk::TableHandle<DatabaseMigrationOperator>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `database_migration_operator`.
///
/// Implemented for [`super::RemoteTables`].
pub trait DatabaseMigrationOperatorTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`DatabaseMigrationOperatorTableHandle`], which mediates access to the table `database_migration_operator`.
fn database_migration_operator(&self) -> DatabaseMigrationOperatorTableHandle<'_>;
}
impl DatabaseMigrationOperatorTableAccess for super::RemoteTables {
fn database_migration_operator(&self) -> DatabaseMigrationOperatorTableHandle<'_> {
DatabaseMigrationOperatorTableHandle {
imp: self
.imp
.get_table::<DatabaseMigrationOperator>("database_migration_operator"),
ctx: std::marker::PhantomData,
}
}
}
pub struct DatabaseMigrationOperatorInsertCallbackId(__sdk::CallbackId);
pub struct DatabaseMigrationOperatorDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for DatabaseMigrationOperatorTableHandle<'ctx> {
type Row = DatabaseMigrationOperator;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = DatabaseMigrationOperator> + '_ {
self.imp.iter()
}
type InsertCallbackId = DatabaseMigrationOperatorInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> DatabaseMigrationOperatorInsertCallbackId {
DatabaseMigrationOperatorInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: DatabaseMigrationOperatorInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = DatabaseMigrationOperatorDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> DatabaseMigrationOperatorDeleteCallbackId {
DatabaseMigrationOperatorDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: DatabaseMigrationOperatorDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct DatabaseMigrationOperatorUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for DatabaseMigrationOperatorTableHandle<'ctx> {
type UpdateCallbackId = DatabaseMigrationOperatorUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> DatabaseMigrationOperatorUpdateCallbackId {
DatabaseMigrationOperatorUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: DatabaseMigrationOperatorUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `operator_identity` unique index on the table `database_migration_operator`,
/// which allows point queries on the field of the same name
/// via the [`DatabaseMigrationOperatorOperatorIdentityUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.database_migration_operator().operator_identity().find(...)`.
pub struct DatabaseMigrationOperatorOperatorIdentityUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<DatabaseMigrationOperator, __sdk::Identity>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> DatabaseMigrationOperatorTableHandle<'ctx> {
/// Get a handle on the `operator_identity` unique index on the table `database_migration_operator`.
pub fn operator_identity(&self) -> DatabaseMigrationOperatorOperatorIdentityUnique<'ctx> {
DatabaseMigrationOperatorOperatorIdentityUnique {
imp: self
.imp
.get_unique_constraint::<__sdk::Identity>("operator_identity"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> DatabaseMigrationOperatorOperatorIdentityUnique<'ctx> {
/// Find the subscribed row whose `operator_identity` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &__sdk::Identity) -> Option<DatabaseMigrationOperator> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<DatabaseMigrationOperator>("database_migration_operator");
_table.add_unique_constraint::<__sdk::Identity>("operator_identity", |row| {
&row.operator_identity
});
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<DatabaseMigrationOperator>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<DatabaseMigrationOperator>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `DatabaseMigrationOperator`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait database_migration_operatorQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `DatabaseMigrationOperator`.
fn database_migration_operator(
&self,
) -> __sdk::__query_builder::Table<DatabaseMigrationOperator>;
}
impl database_migration_operatorQueryTableAccess for __sdk::QueryTableAccessor {
fn database_migration_operator(
&self,
) -> __sdk::__query_builder::Table<DatabaseMigrationOperator> {
__sdk::__query_builder::Table::new("database_migration_operator")
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_work_delete_input_type::SquareHoleWorkDeleteInput;
use super::square_hole_works_procedure_result_type::SquareHoleWorksProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct DeleteSquareHoleWorkArgs {
pub input: SquareHoleWorkDeleteInput,
}
impl __sdk::InModule for DeleteSquareHoleWorkArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `delete_square_hole_work`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait delete_square_hole_work {
fn delete_square_hole_work(&self, input: SquareHoleWorkDeleteInput) {
self.delete_square_hole_work_then(input, |_, _| {});
}
fn delete_square_hole_work_then(
&self,
input: SquareHoleWorkDeleteInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleWorksProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl delete_square_hole_work for super::RemoteProcedures {
fn delete_square_hole_work_then(
&self,
input: SquareHoleWorkDeleteInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleWorksProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleWorksProcedureResult>(
"delete_square_hole_work",
DeleteSquareHoleWorkArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_drop_shape_procedure_result_type::SquareHoleDropShapeProcedureResult;
use super::square_hole_run_drop_input_type::SquareHoleRunDropInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct DropSquareHoleShapeArgs {
pub input: SquareHoleRunDropInput,
}
impl __sdk::InModule for DropSquareHoleShapeArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `drop_square_hole_shape`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait drop_square_hole_shape {
fn drop_square_hole_shape(&self, input: SquareHoleRunDropInput) {
self.drop_square_hole_shape_then(input, |_, _| {});
}
fn drop_square_hole_shape_then(
&self,
input: SquareHoleRunDropInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleDropShapeProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl drop_square_hole_shape for super::RemoteProcedures {
fn drop_square_hole_shape_then(
&self,
input: SquareHoleRunDropInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleDropShapeProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleDropShapeProcedureResult>(
"drop_square_hole_shape",
DropSquareHoleShapeArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,77 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::analytics_date_dimension_ensure_input_type::AnalyticsDateDimensionEnsureInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub(super) struct EnsureAnalyticsDateDimensionForDateArgs {
pub input: AnalyticsDateDimensionEnsureInput,
}
impl From<EnsureAnalyticsDateDimensionForDateArgs> for super::Reducer {
fn from(args: EnsureAnalyticsDateDimensionForDateArgs) -> Self {
Self::EnsureAnalyticsDateDimensionForDate { input: args.input }
}
}
impl __sdk::InModule for EnsureAnalyticsDateDimensionForDateArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the reducer `ensure_analytics_date_dimension_for_date`.
///
/// Implemented for [`super::RemoteReducers`].
pub trait ensure_analytics_date_dimension_for_date {
/// Request that the remote module invoke the reducer `ensure_analytics_date_dimension_for_date` to run as soon as possible.
///
/// This method returns immediately, and errors only if we are unable to send the request.
/// The reducer will run asynchronously in the future,
/// and this method provides no way to listen for its completion status.
/// /// Use [`ensure_analytics_date_dimension_for_date:ensure_analytics_date_dimension_for_date_then`] to run a callback after the reducer completes.
fn ensure_analytics_date_dimension_for_date(
&self,
input: AnalyticsDateDimensionEnsureInput,
) -> __sdk::Result<()> {
self.ensure_analytics_date_dimension_for_date_then(input, |_, _| {})
}
/// Request that the remote module invoke the reducer `ensure_analytics_date_dimension_for_date` to run as soon as possible,
/// registering `callback` to run when we are notified that the reducer completed.
///
/// This method returns immediately, and errors only if we are unable to send the request.
/// The reducer will run asynchronously in the future,
/// and its status can be observed with the `callback`.
fn ensure_analytics_date_dimension_for_date_then(
&self,
input: AnalyticsDateDimensionEnsureInput,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
impl ensure_analytics_date_dimension_for_date for super::RemoteReducers {
fn ensure_analytics_date_dimension_for_date_then(
&self,
input: AnalyticsDateDimensionEnsureInput,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp.invoke_reducer_with_callback(
EnsureAnalyticsDateDimensionForDateArgs { input },
callback,
)
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_agent_message_finalize_input_type::SquareHoleAgentMessageFinalizeInput;
use super::square_hole_agent_session_procedure_result_type::SquareHoleAgentSessionProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct FinalizeSquareHoleAgentMessageTurnArgs {
pub input: SquareHoleAgentMessageFinalizeInput,
}
impl __sdk::InModule for FinalizeSquareHoleAgentMessageTurnArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `finalize_square_hole_agent_message_turn`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait finalize_square_hole_agent_message_turn {
fn finalize_square_hole_agent_message_turn(&self, input: SquareHoleAgentMessageFinalizeInput) {
self.finalize_square_hole_agent_message_turn_then(input, |_, _| {});
}
fn finalize_square_hole_agent_message_turn_then(
&self,
input: SquareHoleAgentMessageFinalizeInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl finalize_square_hole_agent_message_turn for super::RemoteProcedures {
fn finalize_square_hole_agent_message_turn_then(
&self,
input: SquareHoleAgentMessageFinalizeInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleAgentSessionProcedureResult>(
"finalize_square_hole_agent_message_turn",
FinalizeSquareHoleAgentMessageTurnArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_run_procedure_result_type::SquareHoleRunProcedureResult;
use super::square_hole_run_time_up_input_type::SquareHoleRunTimeUpInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct FinishSquareHoleTimeUpArgs {
pub input: SquareHoleRunTimeUpInput,
}
impl __sdk::InModule for FinishSquareHoleTimeUpArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `finish_square_hole_time_up`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait finish_square_hole_time_up {
fn finish_square_hole_time_up(&self, input: SquareHoleRunTimeUpInput) {
self.finish_square_hole_time_up_then(input, |_, _| {});
}
fn finish_square_hole_time_up_then(
&self,
input: SquareHoleRunTimeUpInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl finish_square_hole_time_up for super::RemoteProcedures {
fn finish_square_hole_time_up_then(
&self,
input: SquareHoleRunTimeUpInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleRunProcedureResult>(
"finish_square_hole_time_up",
FinishSquareHoleTimeUpArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_agent_session_get_input_type::SquareHoleAgentSessionGetInput;
use super::square_hole_agent_session_procedure_result_type::SquareHoleAgentSessionProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct GetSquareHoleAgentSessionArgs {
pub input: SquareHoleAgentSessionGetInput,
}
impl __sdk::InModule for GetSquareHoleAgentSessionArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `get_square_hole_agent_session`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait get_square_hole_agent_session {
fn get_square_hole_agent_session(&self, input: SquareHoleAgentSessionGetInput) {
self.get_square_hole_agent_session_then(input, |_, _| {});
}
fn get_square_hole_agent_session_then(
&self,
input: SquareHoleAgentSessionGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl get_square_hole_agent_session for super::RemoteProcedures {
fn get_square_hole_agent_session_then(
&self,
input: SquareHoleAgentSessionGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleAgentSessionProcedureResult>(
"get_square_hole_agent_session",
GetSquareHoleAgentSessionArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_run_get_input_type::SquareHoleRunGetInput;
use super::square_hole_run_procedure_result_type::SquareHoleRunProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct GetSquareHoleRunArgs {
pub input: SquareHoleRunGetInput,
}
impl __sdk::InModule for GetSquareHoleRunArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `get_square_hole_run`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait get_square_hole_run {
fn get_square_hole_run(&self, input: SquareHoleRunGetInput) {
self.get_square_hole_run_then(input, |_, _| {});
}
fn get_square_hole_run_then(
&self,
input: SquareHoleRunGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl get_square_hole_run for super::RemoteProcedures {
fn get_square_hole_run_then(
&self,
input: SquareHoleRunGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleRunProcedureResult>(
"get_square_hole_run",
GetSquareHoleRunArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_work_get_input_type::SquareHoleWorkGetInput;
use super::square_hole_work_procedure_result_type::SquareHoleWorkProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct GetSquareHoleWorkDetailArgs {
pub input: SquareHoleWorkGetInput,
}
impl __sdk::InModule for GetSquareHoleWorkDetailArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `get_square_hole_work_detail`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait get_square_hole_work_detail {
fn get_square_hole_work_detail(&self, input: SquareHoleWorkGetInput) {
self.get_square_hole_work_detail_then(input, |_, _| {});
}
fn get_square_hole_work_detail_then(
&self,
input: SquareHoleWorkGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl get_square_hole_work_detail for super::RemoteProcedures {
fn get_square_hole_work_detail_then(
&self,
input: SquareHoleWorkGetInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleWorkProcedureResult>(
"get_square_hole_work_detail",
GetSquareHoleWorkDetailArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::inventory_container_kind_type::InventoryContainerKind;
use super::inventory_equipment_slot_type::InventoryEquipmentSlot;
use super::inventory_item_rarity_type::InventoryItemRarity;
use super::inventory_item_source_kind_type::InventoryItemSourceKind;
use super::inventory_slot_type::InventorySlot;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `inventory_slot`.
///
/// Obtain a handle from the [`InventorySlotTableAccess::inventory_slot`] method on [`super::RemoteTables`],
/// like `ctx.db.inventory_slot()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.inventory_slot().on_insert(...)`.
pub struct InventorySlotTableHandle<'ctx> {
imp: __sdk::TableHandle<InventorySlot>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `inventory_slot`.
///
/// Implemented for [`super::RemoteTables`].
pub trait InventorySlotTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`InventorySlotTableHandle`], which mediates access to the table `inventory_slot`.
fn inventory_slot(&self) -> InventorySlotTableHandle<'_>;
}
impl InventorySlotTableAccess for super::RemoteTables {
fn inventory_slot(&self) -> InventorySlotTableHandle<'_> {
InventorySlotTableHandle {
imp: self.imp.get_table::<InventorySlot>("inventory_slot"),
ctx: std::marker::PhantomData,
}
}
}
pub struct InventorySlotInsertCallbackId(__sdk::CallbackId);
pub struct InventorySlotDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for InventorySlotTableHandle<'ctx> {
type Row = InventorySlot;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = InventorySlot> + '_ {
self.imp.iter()
}
type InsertCallbackId = InventorySlotInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> InventorySlotInsertCallbackId {
InventorySlotInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: InventorySlotInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = InventorySlotDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> InventorySlotDeleteCallbackId {
InventorySlotDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: InventorySlotDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct InventorySlotUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for InventorySlotTableHandle<'ctx> {
type UpdateCallbackId = InventorySlotUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> InventorySlotUpdateCallbackId {
InventorySlotUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: InventorySlotUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `slot_id` unique index on the table `inventory_slot`,
/// which allows point queries on the field of the same name
/// via the [`InventorySlotSlotIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.inventory_slot().slot_id().find(...)`.
pub struct InventorySlotSlotIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<InventorySlot, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> InventorySlotTableHandle<'ctx> {
/// Get a handle on the `slot_id` unique index on the table `inventory_slot`.
pub fn slot_id(&self) -> InventorySlotSlotIdUnique<'ctx> {
InventorySlotSlotIdUnique {
imp: self.imp.get_unique_constraint::<String>("slot_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> InventorySlotSlotIdUnique<'ctx> {
/// Find the subscribed row whose `slot_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<InventorySlot> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<InventorySlot>("inventory_slot");
_table.add_unique_constraint::<String>("slot_id", |row| &row.slot_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<InventorySlot>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<InventorySlot>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `InventorySlot`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait inventory_slotQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `InventorySlot`.
fn inventory_slot(&self) -> __sdk::__query_builder::Table<InventorySlot>;
}
impl inventory_slotQueryTableAccess for __sdk::QueryTableAccessor {
fn inventory_slot(&self) -> __sdk::__query_builder::Table<InventorySlot> {
__sdk::__query_builder::Table::new("inventory_slot")
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_works_list_input_type::SquareHoleWorksListInput;
use super::square_hole_works_procedure_result_type::SquareHoleWorksProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct ListSquareHoleWorksArgs {
pub input: SquareHoleWorksListInput,
}
impl __sdk::InModule for ListSquareHoleWorksArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `list_square_hole_works`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait list_square_hole_works {
fn list_square_hole_works(&self, input: SquareHoleWorksListInput) {
self.list_square_hole_works_then(input, |_, _| {});
}
fn list_square_hole_works_then(
&self,
input: SquareHoleWorksListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleWorksProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl list_square_hole_works for super::RemoteProcedures {
fn list_square_hole_works_then(
&self,
input: SquareHoleWorksListInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleWorksProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleWorksProcedureResult>(
"list_square_hole_works",
ListSquareHoleWorksArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::match_3_d_agent_message_row_type::Match3DAgentMessageRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `match_3_d_agent_message`.
///
/// Obtain a handle from the [`Match3DAgentMessageTableAccess::match_3_d_agent_message`] method on [`super::RemoteTables`],
/// like `ctx.db.match_3_d_agent_message()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.match_3_d_agent_message().on_insert(...)`.
pub struct Match3DAgentMessageTableHandle<'ctx> {
imp: __sdk::TableHandle<Match3DAgentMessageRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `match_3_d_agent_message`.
///
/// Implemented for [`super::RemoteTables`].
pub trait Match3DAgentMessageTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`Match3DAgentMessageTableHandle`], which mediates access to the table `match_3_d_agent_message`.
fn match_3_d_agent_message(&self) -> Match3DAgentMessageTableHandle<'_>;
}
impl Match3DAgentMessageTableAccess for super::RemoteTables {
fn match_3_d_agent_message(&self) -> Match3DAgentMessageTableHandle<'_> {
Match3DAgentMessageTableHandle {
imp: self
.imp
.get_table::<Match3DAgentMessageRow>("match_3_d_agent_message"),
ctx: std::marker::PhantomData,
}
}
}
pub struct Match3DAgentMessageInsertCallbackId(__sdk::CallbackId);
pub struct Match3DAgentMessageDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for Match3DAgentMessageTableHandle<'ctx> {
type Row = Match3DAgentMessageRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = Match3DAgentMessageRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = Match3DAgentMessageInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> Match3DAgentMessageInsertCallbackId {
Match3DAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: Match3DAgentMessageInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = Match3DAgentMessageDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> Match3DAgentMessageDeleteCallbackId {
Match3DAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: Match3DAgentMessageDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct Match3DAgentMessageUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for Match3DAgentMessageTableHandle<'ctx> {
type UpdateCallbackId = Match3DAgentMessageUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> Match3DAgentMessageUpdateCallbackId {
Match3DAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: Match3DAgentMessageUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `message_id` unique index on the table `match_3_d_agent_message`,
/// which allows point queries on the field of the same name
/// via the [`Match3DAgentMessageMessageIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.match_3_d_agent_message().message_id().find(...)`.
pub struct Match3DAgentMessageMessageIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<Match3DAgentMessageRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> Match3DAgentMessageTableHandle<'ctx> {
/// Get a handle on the `message_id` unique index on the table `match_3_d_agent_message`.
pub fn message_id(&self) -> Match3DAgentMessageMessageIdUnique<'ctx> {
Match3DAgentMessageMessageIdUnique {
imp: self.imp.get_unique_constraint::<String>("message_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> Match3DAgentMessageMessageIdUnique<'ctx> {
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<Match3DAgentMessageRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<Match3DAgentMessageRow>("match_3_d_agent_message");
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<Match3DAgentMessageRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<Match3DAgentMessageRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `Match3DAgentMessageRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait match_3_d_agent_messageQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `Match3DAgentMessageRow`.
fn match_3_d_agent_message(&self) -> __sdk::__query_builder::Table<Match3DAgentMessageRow>;
}
impl match_3_d_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
fn match_3_d_agent_message(&self) -> __sdk::__query_builder::Table<Match3DAgentMessageRow> {
__sdk::__query_builder::Table::new("match_3_d_agent_message")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::match_3_d_agent_session_row_type::Match3DAgentSessionRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `match_3_d_agent_session`.
///
/// Obtain a handle from the [`Match3DAgentSessionTableAccess::match_3_d_agent_session`] method on [`super::RemoteTables`],
/// like `ctx.db.match_3_d_agent_session()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.match_3_d_agent_session().on_insert(...)`.
pub struct Match3DAgentSessionTableHandle<'ctx> {
imp: __sdk::TableHandle<Match3DAgentSessionRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `match_3_d_agent_session`.
///
/// Implemented for [`super::RemoteTables`].
pub trait Match3DAgentSessionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`Match3DAgentSessionTableHandle`], which mediates access to the table `match_3_d_agent_session`.
fn match_3_d_agent_session(&self) -> Match3DAgentSessionTableHandle<'_>;
}
impl Match3DAgentSessionTableAccess for super::RemoteTables {
fn match_3_d_agent_session(&self) -> Match3DAgentSessionTableHandle<'_> {
Match3DAgentSessionTableHandle {
imp: self
.imp
.get_table::<Match3DAgentSessionRow>("match_3_d_agent_session"),
ctx: std::marker::PhantomData,
}
}
}
pub struct Match3DAgentSessionInsertCallbackId(__sdk::CallbackId);
pub struct Match3DAgentSessionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for Match3DAgentSessionTableHandle<'ctx> {
type Row = Match3DAgentSessionRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = Match3DAgentSessionRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = Match3DAgentSessionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> Match3DAgentSessionInsertCallbackId {
Match3DAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: Match3DAgentSessionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = Match3DAgentSessionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> Match3DAgentSessionDeleteCallbackId {
Match3DAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: Match3DAgentSessionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct Match3DAgentSessionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for Match3DAgentSessionTableHandle<'ctx> {
type UpdateCallbackId = Match3DAgentSessionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> Match3DAgentSessionUpdateCallbackId {
Match3DAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: Match3DAgentSessionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `session_id` unique index on the table `match_3_d_agent_session`,
/// which allows point queries on the field of the same name
/// via the [`Match3DAgentSessionSessionIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.match_3_d_agent_session().session_id().find(...)`.
pub struct Match3DAgentSessionSessionIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<Match3DAgentSessionRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> Match3DAgentSessionTableHandle<'ctx> {
/// Get a handle on the `session_id` unique index on the table `match_3_d_agent_session`.
pub fn session_id(&self) -> Match3DAgentSessionSessionIdUnique<'ctx> {
Match3DAgentSessionSessionIdUnique {
imp: self.imp.get_unique_constraint::<String>("session_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> Match3DAgentSessionSessionIdUnique<'ctx> {
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<Match3DAgentSessionRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<Match3DAgentSessionRow>("match_3_d_agent_session");
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<Match3DAgentSessionRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<Match3DAgentSessionRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `Match3DAgentSessionRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait match_3_d_agent_sessionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `Match3DAgentSessionRow`.
fn match_3_d_agent_session(&self) -> __sdk::__query_builder::Table<Match3DAgentSessionRow>;
}
impl match_3_d_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor {
fn match_3_d_agent_session(&self) -> __sdk::__query_builder::Table<Match3DAgentSessionRow> {
__sdk::__query_builder::Table::new("match_3_d_agent_session")
}
}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::match_3_d_runtime_run_row_type::Match3DRuntimeRunRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `match_3_d_runtime_run`.
///
/// Obtain a handle from the [`Match3DRuntimeRunTableAccess::match_3_d_runtime_run`] method on [`super::RemoteTables`],
/// like `ctx.db.match_3_d_runtime_run()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.match_3_d_runtime_run().on_insert(...)`.
pub struct Match3DRuntimeRunTableHandle<'ctx> {
imp: __sdk::TableHandle<Match3DRuntimeRunRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `match_3_d_runtime_run`.
///
/// Implemented for [`super::RemoteTables`].
pub trait Match3DRuntimeRunTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`Match3DRuntimeRunTableHandle`], which mediates access to the table `match_3_d_runtime_run`.
fn match_3_d_runtime_run(&self) -> Match3DRuntimeRunTableHandle<'_>;
}
impl Match3DRuntimeRunTableAccess for super::RemoteTables {
fn match_3_d_runtime_run(&self) -> Match3DRuntimeRunTableHandle<'_> {
Match3DRuntimeRunTableHandle {
imp: self
.imp
.get_table::<Match3DRuntimeRunRow>("match_3_d_runtime_run"),
ctx: std::marker::PhantomData,
}
}
}
pub struct Match3DRuntimeRunInsertCallbackId(__sdk::CallbackId);
pub struct Match3DRuntimeRunDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for Match3DRuntimeRunTableHandle<'ctx> {
type Row = Match3DRuntimeRunRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = Match3DRuntimeRunRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = Match3DRuntimeRunInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> Match3DRuntimeRunInsertCallbackId {
Match3DRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: Match3DRuntimeRunInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = Match3DRuntimeRunDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> Match3DRuntimeRunDeleteCallbackId {
Match3DRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: Match3DRuntimeRunDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct Match3DRuntimeRunUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for Match3DRuntimeRunTableHandle<'ctx> {
type UpdateCallbackId = Match3DRuntimeRunUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> Match3DRuntimeRunUpdateCallbackId {
Match3DRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: Match3DRuntimeRunUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `run_id` unique index on the table `match_3_d_runtime_run`,
/// which allows point queries on the field of the same name
/// via the [`Match3DRuntimeRunRunIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.match_3_d_runtime_run().run_id().find(...)`.
pub struct Match3DRuntimeRunRunIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<Match3DRuntimeRunRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> Match3DRuntimeRunTableHandle<'ctx> {
/// Get a handle on the `run_id` unique index on the table `match_3_d_runtime_run`.
pub fn run_id(&self) -> Match3DRuntimeRunRunIdUnique<'ctx> {
Match3DRuntimeRunRunIdUnique {
imp: self.imp.get_unique_constraint::<String>("run_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> Match3DRuntimeRunRunIdUnique<'ctx> {
/// Find the subscribed row whose `run_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<Match3DRuntimeRunRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<Match3DRuntimeRunRow>("match_3_d_runtime_run");
_table.add_unique_constraint::<String>("run_id", |row| &row.run_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<Match3DRuntimeRunRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<Match3DRuntimeRunRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `Match3DRuntimeRunRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait match_3_d_runtime_runQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `Match3DRuntimeRunRow`.
fn match_3_d_runtime_run(&self) -> __sdk::__query_builder::Table<Match3DRuntimeRunRow>;
}
impl match_3_d_runtime_runQueryTableAccess for __sdk::QueryTableAccessor {
fn match_3_d_runtime_run(&self) -> __sdk::__query_builder::Table<Match3DRuntimeRunRow> {
__sdk::__query_builder::Table::new("match_3_d_runtime_run")
}
}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::match_3_d_work_profile_row_type::Match3DWorkProfileRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `match_3_d_work_profile`.
///
/// Obtain a handle from the [`Match3DWorkProfileTableAccess::match_3_d_work_profile`] method on [`super::RemoteTables`],
/// like `ctx.db.match_3_d_work_profile()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.match_3_d_work_profile().on_insert(...)`.
pub struct Match3DWorkProfileTableHandle<'ctx> {
imp: __sdk::TableHandle<Match3DWorkProfileRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `match_3_d_work_profile`.
///
/// Implemented for [`super::RemoteTables`].
pub trait Match3DWorkProfileTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`Match3DWorkProfileTableHandle`], which mediates access to the table `match_3_d_work_profile`.
fn match_3_d_work_profile(&self) -> Match3DWorkProfileTableHandle<'_>;
}
impl Match3DWorkProfileTableAccess for super::RemoteTables {
fn match_3_d_work_profile(&self) -> Match3DWorkProfileTableHandle<'_> {
Match3DWorkProfileTableHandle {
imp: self
.imp
.get_table::<Match3DWorkProfileRow>("match_3_d_work_profile"),
ctx: std::marker::PhantomData,
}
}
}
pub struct Match3DWorkProfileInsertCallbackId(__sdk::CallbackId);
pub struct Match3DWorkProfileDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for Match3DWorkProfileTableHandle<'ctx> {
type Row = Match3DWorkProfileRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = Match3DWorkProfileRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = Match3DWorkProfileInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> Match3DWorkProfileInsertCallbackId {
Match3DWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: Match3DWorkProfileInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = Match3DWorkProfileDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> Match3DWorkProfileDeleteCallbackId {
Match3DWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: Match3DWorkProfileDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct Match3DWorkProfileUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for Match3DWorkProfileTableHandle<'ctx> {
type UpdateCallbackId = Match3DWorkProfileUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> Match3DWorkProfileUpdateCallbackId {
Match3DWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: Match3DWorkProfileUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `profile_id` unique index on the table `match_3_d_work_profile`,
/// which allows point queries on the field of the same name
/// via the [`Match3DWorkProfileProfileIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.match_3_d_work_profile().profile_id().find(...)`.
pub struct Match3DWorkProfileProfileIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<Match3DWorkProfileRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> Match3DWorkProfileTableHandle<'ctx> {
/// Get a handle on the `profile_id` unique index on the table `match_3_d_work_profile`.
pub fn profile_id(&self) -> Match3DWorkProfileProfileIdUnique<'ctx> {
Match3DWorkProfileProfileIdUnique {
imp: self.imp.get_unique_constraint::<String>("profile_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> Match3DWorkProfileProfileIdUnique<'ctx> {
/// Find the subscribed row whose `profile_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<Match3DWorkProfileRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<Match3DWorkProfileRow>("match_3_d_work_profile");
_table.add_unique_constraint::<String>("profile_id", |row| &row.profile_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<Match3DWorkProfileRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<Match3DWorkProfileRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `Match3DWorkProfileRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait match_3_d_work_profileQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `Match3DWorkProfileRow`.
fn match_3_d_work_profile(&self) -> __sdk::__query_builder::Table<Match3DWorkProfileRow>;
}
impl match_3_d_work_profileQueryTableAccess for __sdk::QueryTableAccessor {
fn match_3_d_work_profile(&self) -> __sdk::__query_builder::Table<Match3DWorkProfileRow> {
__sdk::__query_builder::Table::new("match_3_d_work_profile")
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::npc_relation_state_type::NpcRelationState;
use super::npc_stance_profile_type::NpcStanceProfile;
use super::npc_state_type::NpcState;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `npc_state`.
///
/// Obtain a handle from the [`NpcStateTableAccess::npc_state`] method on [`super::RemoteTables`],
/// like `ctx.db.npc_state()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.npc_state().on_insert(...)`.
pub struct NpcStateTableHandle<'ctx> {
imp: __sdk::TableHandle<NpcState>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `npc_state`.
///
/// Implemented for [`super::RemoteTables`].
pub trait NpcStateTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`NpcStateTableHandle`], which mediates access to the table `npc_state`.
fn npc_state(&self) -> NpcStateTableHandle<'_>;
}
impl NpcStateTableAccess for super::RemoteTables {
fn npc_state(&self) -> NpcStateTableHandle<'_> {
NpcStateTableHandle {
imp: self.imp.get_table::<NpcState>("npc_state"),
ctx: std::marker::PhantomData,
}
}
}
pub struct NpcStateInsertCallbackId(__sdk::CallbackId);
pub struct NpcStateDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for NpcStateTableHandle<'ctx> {
type Row = NpcState;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = NpcState> + '_ {
self.imp.iter()
}
type InsertCallbackId = NpcStateInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> NpcStateInsertCallbackId {
NpcStateInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: NpcStateInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = NpcStateDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> NpcStateDeleteCallbackId {
NpcStateDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: NpcStateDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct NpcStateUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for NpcStateTableHandle<'ctx> {
type UpdateCallbackId = NpcStateUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> NpcStateUpdateCallbackId {
NpcStateUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: NpcStateUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `npc_state_id` unique index on the table `npc_state`,
/// which allows point queries on the field of the same name
/// via the [`NpcStateNpcStateIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.npc_state().npc_state_id().find(...)`.
pub struct NpcStateNpcStateIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<NpcState, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> NpcStateTableHandle<'ctx> {
/// Get a handle on the `npc_state_id` unique index on the table `npc_state`.
pub fn npc_state_id(&self) -> NpcStateNpcStateIdUnique<'ctx> {
NpcStateNpcStateIdUnique {
imp: self.imp.get_unique_constraint::<String>("npc_state_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> NpcStateNpcStateIdUnique<'ctx> {
/// Find the subscribed row whose `npc_state_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<NpcState> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<NpcState>("npc_state");
_table.add_unique_constraint::<String>("npc_state_id", |row| &row.npc_state_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<NpcState>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<NpcState>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `NpcState`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait npc_stateQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `NpcState`.
fn npc_state(&self) -> __sdk::__query_builder::Table<NpcState>;
}
impl npc_stateQueryTableAccess for __sdk::QueryTableAccessor {
fn npc_state(&self) -> __sdk::__query_builder::Table<NpcState> {
__sdk::__query_builder::Table::new("npc_state")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::player_progression_grant_source_type::PlayerProgressionGrantSource;
use super::player_progression_type::PlayerProgression;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `player_progression`.
///
/// Obtain a handle from the [`PlayerProgressionTableAccess::player_progression`] method on [`super::RemoteTables`],
/// like `ctx.db.player_progression()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.player_progression().on_insert(...)`.
pub struct PlayerProgressionTableHandle<'ctx> {
imp: __sdk::TableHandle<PlayerProgression>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `player_progression`.
///
/// Implemented for [`super::RemoteTables`].
pub trait PlayerProgressionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`PlayerProgressionTableHandle`], which mediates access to the table `player_progression`.
fn player_progression(&self) -> PlayerProgressionTableHandle<'_>;
}
impl PlayerProgressionTableAccess for super::RemoteTables {
fn player_progression(&self) -> PlayerProgressionTableHandle<'_> {
PlayerProgressionTableHandle {
imp: self
.imp
.get_table::<PlayerProgression>("player_progression"),
ctx: std::marker::PhantomData,
}
}
}
pub struct PlayerProgressionInsertCallbackId(__sdk::CallbackId);
pub struct PlayerProgressionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for PlayerProgressionTableHandle<'ctx> {
type Row = PlayerProgression;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = PlayerProgression> + '_ {
self.imp.iter()
}
type InsertCallbackId = PlayerProgressionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PlayerProgressionInsertCallbackId {
PlayerProgressionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: PlayerProgressionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = PlayerProgressionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PlayerProgressionDeleteCallbackId {
PlayerProgressionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: PlayerProgressionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct PlayerProgressionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for PlayerProgressionTableHandle<'ctx> {
type UpdateCallbackId = PlayerProgressionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> PlayerProgressionUpdateCallbackId {
PlayerProgressionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: PlayerProgressionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `user_id` unique index on the table `player_progression`,
/// which allows point queries on the field of the same name
/// via the [`PlayerProgressionUserIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.player_progression().user_id().find(...)`.
pub struct PlayerProgressionUserIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<PlayerProgression, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> PlayerProgressionTableHandle<'ctx> {
/// Get a handle on the `user_id` unique index on the table `player_progression`.
pub fn user_id(&self) -> PlayerProgressionUserIdUnique<'ctx> {
PlayerProgressionUserIdUnique {
imp: self.imp.get_unique_constraint::<String>("user_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> PlayerProgressionUserIdUnique<'ctx> {
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<PlayerProgression> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<PlayerProgression>("player_progression");
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<PlayerProgression>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<PlayerProgression>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `PlayerProgression`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait player_progressionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `PlayerProgression`.
fn player_progression(&self) -> __sdk::__query_builder::Table<PlayerProgression>;
}
impl player_progressionQueryTableAccess for __sdk::QueryTableAccessor {
fn player_progression(&self) -> __sdk::__query_builder::Table<PlayerProgression> {
__sdk::__query_builder::Table::new("player_progression")
}
}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_dashboard_state_type::ProfileDashboardState;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_dashboard_state`.
///
/// Obtain a handle from the [`ProfileDashboardStateTableAccess::profile_dashboard_state`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_dashboard_state()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_dashboard_state().on_insert(...)`.
pub struct ProfileDashboardStateTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileDashboardState>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_dashboard_state`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileDashboardStateTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileDashboardStateTableHandle`], which mediates access to the table `profile_dashboard_state`.
fn profile_dashboard_state(&self) -> ProfileDashboardStateTableHandle<'_>;
}
impl ProfileDashboardStateTableAccess for super::RemoteTables {
fn profile_dashboard_state(&self) -> ProfileDashboardStateTableHandle<'_> {
ProfileDashboardStateTableHandle {
imp: self
.imp
.get_table::<ProfileDashboardState>("profile_dashboard_state"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileDashboardStateInsertCallbackId(__sdk::CallbackId);
pub struct ProfileDashboardStateDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileDashboardStateTableHandle<'ctx> {
type Row = ProfileDashboardState;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileDashboardState> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileDashboardStateInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileDashboardStateInsertCallbackId {
ProfileDashboardStateInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileDashboardStateInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileDashboardStateDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileDashboardStateDeleteCallbackId {
ProfileDashboardStateDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileDashboardStateDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileDashboardStateUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileDashboardStateTableHandle<'ctx> {
type UpdateCallbackId = ProfileDashboardStateUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileDashboardStateUpdateCallbackId {
ProfileDashboardStateUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileDashboardStateUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `user_id` unique index on the table `profile_dashboard_state`,
/// which allows point queries on the field of the same name
/// via the [`ProfileDashboardStateUserIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_dashboard_state().user_id().find(...)`.
pub struct ProfileDashboardStateUserIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileDashboardState, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileDashboardStateTableHandle<'ctx> {
/// Get a handle on the `user_id` unique index on the table `profile_dashboard_state`.
pub fn user_id(&self) -> ProfileDashboardStateUserIdUnique<'ctx> {
ProfileDashboardStateUserIdUnique {
imp: self.imp.get_unique_constraint::<String>("user_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileDashboardStateUserIdUnique<'ctx> {
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileDashboardState> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<ProfileDashboardState>("profile_dashboard_state");
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileDashboardState>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileDashboardState>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileDashboardState`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_dashboard_stateQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileDashboardState`.
fn profile_dashboard_state(&self) -> __sdk::__query_builder::Table<ProfileDashboardState>;
}
impl profile_dashboard_stateQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_dashboard_state(&self) -> __sdk::__query_builder::Table<ProfileDashboardState> {
__sdk::__query_builder::Table::new("profile_dashboard_state")
}
}

View File

@@ -0,0 +1,192 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_invite_code_type::ProfileInviteCode;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_invite_code`.
///
/// Obtain a handle from the [`ProfileInviteCodeTableAccess::profile_invite_code`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_invite_code()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_invite_code().on_insert(...)`.
pub struct ProfileInviteCodeTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileInviteCode>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_invite_code`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileInviteCodeTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileInviteCodeTableHandle`], which mediates access to the table `profile_invite_code`.
fn profile_invite_code(&self) -> ProfileInviteCodeTableHandle<'_>;
}
impl ProfileInviteCodeTableAccess for super::RemoteTables {
fn profile_invite_code(&self) -> ProfileInviteCodeTableHandle<'_> {
ProfileInviteCodeTableHandle {
imp: self
.imp
.get_table::<ProfileInviteCode>("profile_invite_code"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileInviteCodeInsertCallbackId(__sdk::CallbackId);
pub struct ProfileInviteCodeDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileInviteCodeTableHandle<'ctx> {
type Row = ProfileInviteCode;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileInviteCode> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileInviteCodeInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileInviteCodeInsertCallbackId {
ProfileInviteCodeInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileInviteCodeInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileInviteCodeDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileInviteCodeDeleteCallbackId {
ProfileInviteCodeDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileInviteCodeDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileInviteCodeUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileInviteCodeTableHandle<'ctx> {
type UpdateCallbackId = ProfileInviteCodeUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileInviteCodeUpdateCallbackId {
ProfileInviteCodeUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileInviteCodeUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `user_id` unique index on the table `profile_invite_code`,
/// which allows point queries on the field of the same name
/// via the [`ProfileInviteCodeUserIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_invite_code().user_id().find(...)`.
pub struct ProfileInviteCodeUserIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileInviteCode, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileInviteCodeTableHandle<'ctx> {
/// Get a handle on the `user_id` unique index on the table `profile_invite_code`.
pub fn user_id(&self) -> ProfileInviteCodeUserIdUnique<'ctx> {
ProfileInviteCodeUserIdUnique {
imp: self.imp.get_unique_constraint::<String>("user_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileInviteCodeUserIdUnique<'ctx> {
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileInviteCode> {
self.imp.find(col_val)
}
}
/// Access to the `invite_code` unique index on the table `profile_invite_code`,
/// which allows point queries on the field of the same name
/// via the [`ProfileInviteCodeInviteCodeUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_invite_code().invite_code().find(...)`.
pub struct ProfileInviteCodeInviteCodeUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileInviteCode, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileInviteCodeTableHandle<'ctx> {
/// Get a handle on the `invite_code` unique index on the table `profile_invite_code`.
pub fn invite_code(&self) -> ProfileInviteCodeInviteCodeUnique<'ctx> {
ProfileInviteCodeInviteCodeUnique {
imp: self.imp.get_unique_constraint::<String>("invite_code"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileInviteCodeInviteCodeUnique<'ctx> {
/// Find the subscribed row whose `invite_code` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileInviteCode> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<ProfileInviteCode>("profile_invite_code");
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
_table.add_unique_constraint::<String>("invite_code", |row| &row.invite_code);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileInviteCode>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileInviteCode>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileInviteCode`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_invite_codeQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileInviteCode`.
fn profile_invite_code(&self) -> __sdk::__query_builder::Table<ProfileInviteCode>;
}
impl profile_invite_codeQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_invite_code(&self) -> __sdk::__query_builder::Table<ProfileInviteCode> {
__sdk::__query_builder::Table::new("profile_invite_code")
}
}

View File

@@ -12,6 +12,8 @@ pub struct ProfileInviteCode {
pub metadata_json: String,
pub created_at: __sdk::Timestamp,
pub updated_at: __sdk::Timestamp,
pub starts_at: Option<__sdk::Timestamp>,
pub expires_at: Option<__sdk::Timestamp>,
}
impl __sdk::InModule for ProfileInviteCode {
@@ -27,6 +29,8 @@ pub struct ProfileInviteCodeCols {
pub metadata_json: __sdk::__query_builder::Col<ProfileInviteCode, String>,
pub created_at: __sdk::__query_builder::Col<ProfileInviteCode, __sdk::Timestamp>,
pub updated_at: __sdk::__query_builder::Col<ProfileInviteCode, __sdk::Timestamp>,
pub starts_at: __sdk::__query_builder::Col<ProfileInviteCode, Option<__sdk::Timestamp>>,
pub expires_at: __sdk::__query_builder::Col<ProfileInviteCode, Option<__sdk::Timestamp>>,
}
impl __sdk::__query_builder::HasCols for ProfileInviteCode {
@@ -38,6 +42,8 @@ impl __sdk::__query_builder::HasCols for ProfileInviteCode {
metadata_json: __sdk::__query_builder::Col::new(table_name, "metadata_json"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
starts_at: __sdk::__query_builder::Col::new(table_name, "starts_at"),
expires_at: __sdk::__query_builder::Col::new(table_name, "expires_at"),
}
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_membership_type::ProfileMembership;
use super::runtime_profile_membership_status_type::RuntimeProfileMembershipStatus;
use super::runtime_profile_membership_tier_type::RuntimeProfileMembershipTier;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_membership`.
///
/// Obtain a handle from the [`ProfileMembershipTableAccess::profile_membership`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_membership()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_membership().on_insert(...)`.
pub struct ProfileMembershipTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileMembership>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_membership`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileMembershipTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileMembershipTableHandle`], which mediates access to the table `profile_membership`.
fn profile_membership(&self) -> ProfileMembershipTableHandle<'_>;
}
impl ProfileMembershipTableAccess for super::RemoteTables {
fn profile_membership(&self) -> ProfileMembershipTableHandle<'_> {
ProfileMembershipTableHandle {
imp: self
.imp
.get_table::<ProfileMembership>("profile_membership"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileMembershipInsertCallbackId(__sdk::CallbackId);
pub struct ProfileMembershipDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileMembershipTableHandle<'ctx> {
type Row = ProfileMembership;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileMembership> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileMembershipInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileMembershipInsertCallbackId {
ProfileMembershipInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileMembershipInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileMembershipDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileMembershipDeleteCallbackId {
ProfileMembershipDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileMembershipDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileMembershipUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileMembershipTableHandle<'ctx> {
type UpdateCallbackId = ProfileMembershipUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileMembershipUpdateCallbackId {
ProfileMembershipUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileMembershipUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `user_id` unique index on the table `profile_membership`,
/// which allows point queries on the field of the same name
/// via the [`ProfileMembershipUserIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_membership().user_id().find(...)`.
pub struct ProfileMembershipUserIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileMembership, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileMembershipTableHandle<'ctx> {
/// Get a handle on the `user_id` unique index on the table `profile_membership`.
pub fn user_id(&self) -> ProfileMembershipUserIdUnique<'ctx> {
ProfileMembershipUserIdUnique {
imp: self.imp.get_unique_constraint::<String>("user_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileMembershipUserIdUnique<'ctx> {
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileMembership> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<ProfileMembership>("profile_membership");
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileMembership>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileMembership>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileMembership`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_membershipQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileMembership`.
fn profile_membership(&self) -> __sdk::__query_builder::Table<ProfileMembership>;
}
impl profile_membershipQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_membership(&self) -> __sdk::__query_builder::Table<ProfileMembership> {
__sdk::__query_builder::Table::new("profile_membership")
}
}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_played_world_type::ProfilePlayedWorld;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_played_world`.
///
/// Obtain a handle from the [`ProfilePlayedWorldTableAccess::profile_played_world`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_played_world()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_played_world().on_insert(...)`.
pub struct ProfilePlayedWorldTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfilePlayedWorld>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_played_world`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfilePlayedWorldTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfilePlayedWorldTableHandle`], which mediates access to the table `profile_played_world`.
fn profile_played_world(&self) -> ProfilePlayedWorldTableHandle<'_>;
}
impl ProfilePlayedWorldTableAccess for super::RemoteTables {
fn profile_played_world(&self) -> ProfilePlayedWorldTableHandle<'_> {
ProfilePlayedWorldTableHandle {
imp: self
.imp
.get_table::<ProfilePlayedWorld>("profile_played_world"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfilePlayedWorldInsertCallbackId(__sdk::CallbackId);
pub struct ProfilePlayedWorldDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfilePlayedWorldTableHandle<'ctx> {
type Row = ProfilePlayedWorld;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfilePlayedWorld> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfilePlayedWorldInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfilePlayedWorldInsertCallbackId {
ProfilePlayedWorldInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfilePlayedWorldInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfilePlayedWorldDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfilePlayedWorldDeleteCallbackId {
ProfilePlayedWorldDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfilePlayedWorldDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfilePlayedWorldUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfilePlayedWorldTableHandle<'ctx> {
type UpdateCallbackId = ProfilePlayedWorldUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfilePlayedWorldUpdateCallbackId {
ProfilePlayedWorldUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfilePlayedWorldUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `played_world_id` unique index on the table `profile_played_world`,
/// which allows point queries on the field of the same name
/// via the [`ProfilePlayedWorldPlayedWorldIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_played_world().played_world_id().find(...)`.
pub struct ProfilePlayedWorldPlayedWorldIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfilePlayedWorld, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfilePlayedWorldTableHandle<'ctx> {
/// Get a handle on the `played_world_id` unique index on the table `profile_played_world`.
pub fn played_world_id(&self) -> ProfilePlayedWorldPlayedWorldIdUnique<'ctx> {
ProfilePlayedWorldPlayedWorldIdUnique {
imp: self.imp.get_unique_constraint::<String>("played_world_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfilePlayedWorldPlayedWorldIdUnique<'ctx> {
/// Find the subscribed row whose `played_world_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfilePlayedWorld> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<ProfilePlayedWorld>("profile_played_world");
_table.add_unique_constraint::<String>("played_world_id", |row| &row.played_world_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfilePlayedWorld>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfilePlayedWorld>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfilePlayedWorld`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_played_worldQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfilePlayedWorld`.
fn profile_played_world(&self) -> __sdk::__query_builder::Table<ProfilePlayedWorld>;
}
impl profile_played_worldQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_played_world(&self) -> __sdk::__query_builder::Table<ProfilePlayedWorld> {
__sdk::__query_builder::Table::new("profile_played_world")
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_recharge_order_type::ProfileRechargeOrder;
use super::runtime_profile_recharge_order_status_type::RuntimeProfileRechargeOrderStatus;
use super::runtime_profile_recharge_product_kind_type::RuntimeProfileRechargeProductKind;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_recharge_order`.
///
/// Obtain a handle from the [`ProfileRechargeOrderTableAccess::profile_recharge_order`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_recharge_order()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_recharge_order().on_insert(...)`.
pub struct ProfileRechargeOrderTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileRechargeOrder>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_recharge_order`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileRechargeOrderTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileRechargeOrderTableHandle`], which mediates access to the table `profile_recharge_order`.
fn profile_recharge_order(&self) -> ProfileRechargeOrderTableHandle<'_>;
}
impl ProfileRechargeOrderTableAccess for super::RemoteTables {
fn profile_recharge_order(&self) -> ProfileRechargeOrderTableHandle<'_> {
ProfileRechargeOrderTableHandle {
imp: self
.imp
.get_table::<ProfileRechargeOrder>("profile_recharge_order"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileRechargeOrderInsertCallbackId(__sdk::CallbackId);
pub struct ProfileRechargeOrderDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileRechargeOrderTableHandle<'ctx> {
type Row = ProfileRechargeOrder;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileRechargeOrder> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileRechargeOrderInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileRechargeOrderInsertCallbackId {
ProfileRechargeOrderInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileRechargeOrderInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileRechargeOrderDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileRechargeOrderDeleteCallbackId {
ProfileRechargeOrderDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileRechargeOrderDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileRechargeOrderUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeOrderTableHandle<'ctx> {
type UpdateCallbackId = ProfileRechargeOrderUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileRechargeOrderUpdateCallbackId {
ProfileRechargeOrderUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileRechargeOrderUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `order_id` unique index on the table `profile_recharge_order`,
/// which allows point queries on the field of the same name
/// via the [`ProfileRechargeOrderOrderIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_recharge_order().order_id().find(...)`.
pub struct ProfileRechargeOrderOrderIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileRechargeOrder, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileRechargeOrderTableHandle<'ctx> {
/// Get a handle on the `order_id` unique index on the table `profile_recharge_order`.
pub fn order_id(&self) -> ProfileRechargeOrderOrderIdUnique<'ctx> {
ProfileRechargeOrderOrderIdUnique {
imp: self.imp.get_unique_constraint::<String>("order_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileRechargeOrderOrderIdUnique<'ctx> {
/// Find the subscribed row whose `order_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileRechargeOrder> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<ProfileRechargeOrder>("profile_recharge_order");
_table.add_unique_constraint::<String>("order_id", |row| &row.order_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileRechargeOrder>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileRechargeOrder>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileRechargeOrder`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_recharge_orderQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileRechargeOrder`.
fn profile_recharge_order(&self) -> __sdk::__query_builder::Table<ProfileRechargeOrder>;
}
impl profile_recharge_orderQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_recharge_order(&self) -> __sdk::__query_builder::Table<ProfileRechargeOrder> {
__sdk::__query_builder::Table::new("profile_recharge_order")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_redeem_code_type::ProfileRedeemCode;
use super::runtime_profile_redeem_code_mode_type::RuntimeProfileRedeemCodeMode;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_redeem_code`.
///
/// Obtain a handle from the [`ProfileRedeemCodeTableAccess::profile_redeem_code`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_redeem_code()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_redeem_code().on_insert(...)`.
pub struct ProfileRedeemCodeTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileRedeemCode>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_redeem_code`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileRedeemCodeTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileRedeemCodeTableHandle`], which mediates access to the table `profile_redeem_code`.
fn profile_redeem_code(&self) -> ProfileRedeemCodeTableHandle<'_>;
}
impl ProfileRedeemCodeTableAccess for super::RemoteTables {
fn profile_redeem_code(&self) -> ProfileRedeemCodeTableHandle<'_> {
ProfileRedeemCodeTableHandle {
imp: self
.imp
.get_table::<ProfileRedeemCode>("profile_redeem_code"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileRedeemCodeInsertCallbackId(__sdk::CallbackId);
pub struct ProfileRedeemCodeDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileRedeemCodeTableHandle<'ctx> {
type Row = ProfileRedeemCode;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileRedeemCode> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileRedeemCodeInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileRedeemCodeInsertCallbackId {
ProfileRedeemCodeInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileRedeemCodeInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileRedeemCodeDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileRedeemCodeDeleteCallbackId {
ProfileRedeemCodeDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileRedeemCodeDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileRedeemCodeUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRedeemCodeTableHandle<'ctx> {
type UpdateCallbackId = ProfileRedeemCodeUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileRedeemCodeUpdateCallbackId {
ProfileRedeemCodeUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileRedeemCodeUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `code` unique index on the table `profile_redeem_code`,
/// which allows point queries on the field of the same name
/// via the [`ProfileRedeemCodeCodeUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_redeem_code().code().find(...)`.
pub struct ProfileRedeemCodeCodeUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileRedeemCode, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileRedeemCodeTableHandle<'ctx> {
/// Get a handle on the `code` unique index on the table `profile_redeem_code`.
pub fn code(&self) -> ProfileRedeemCodeCodeUnique<'ctx> {
ProfileRedeemCodeCodeUnique {
imp: self.imp.get_unique_constraint::<String>("code"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileRedeemCodeCodeUnique<'ctx> {
/// Find the subscribed row whose `code` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileRedeemCode> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<ProfileRedeemCode>("profile_redeem_code");
_table.add_unique_constraint::<String>("code", |row| &row.code);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileRedeemCode>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileRedeemCode>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileRedeemCode`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_redeem_codeQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileRedeemCode`.
fn profile_redeem_code(&self) -> __sdk::__query_builder::Table<ProfileRedeemCode>;
}
impl profile_redeem_codeQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_redeem_code(&self) -> __sdk::__query_builder::Table<ProfileRedeemCode> {
__sdk::__query_builder::Table::new("profile_redeem_code")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_redeem_code_usage_type::ProfileRedeemCodeUsage;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_redeem_code_usage`.
///
/// Obtain a handle from the [`ProfileRedeemCodeUsageTableAccess::profile_redeem_code_usage`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_redeem_code_usage()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_redeem_code_usage().on_insert(...)`.
pub struct ProfileRedeemCodeUsageTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileRedeemCodeUsage>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_redeem_code_usage`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileRedeemCodeUsageTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileRedeemCodeUsageTableHandle`], which mediates access to the table `profile_redeem_code_usage`.
fn profile_redeem_code_usage(&self) -> ProfileRedeemCodeUsageTableHandle<'_>;
}
impl ProfileRedeemCodeUsageTableAccess for super::RemoteTables {
fn profile_redeem_code_usage(&self) -> ProfileRedeemCodeUsageTableHandle<'_> {
ProfileRedeemCodeUsageTableHandle {
imp: self
.imp
.get_table::<ProfileRedeemCodeUsage>("profile_redeem_code_usage"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileRedeemCodeUsageInsertCallbackId(__sdk::CallbackId);
pub struct ProfileRedeemCodeUsageDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileRedeemCodeUsageTableHandle<'ctx> {
type Row = ProfileRedeemCodeUsage;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileRedeemCodeUsage> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileRedeemCodeUsageInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileRedeemCodeUsageInsertCallbackId {
ProfileRedeemCodeUsageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileRedeemCodeUsageInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileRedeemCodeUsageDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileRedeemCodeUsageDeleteCallbackId {
ProfileRedeemCodeUsageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileRedeemCodeUsageDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileRedeemCodeUsageUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRedeemCodeUsageTableHandle<'ctx> {
type UpdateCallbackId = ProfileRedeemCodeUsageUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileRedeemCodeUsageUpdateCallbackId {
ProfileRedeemCodeUsageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileRedeemCodeUsageUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `usage_id` unique index on the table `profile_redeem_code_usage`,
/// which allows point queries on the field of the same name
/// via the [`ProfileRedeemCodeUsageUsageIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_redeem_code_usage().usage_id().find(...)`.
pub struct ProfileRedeemCodeUsageUsageIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileRedeemCodeUsage, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileRedeemCodeUsageTableHandle<'ctx> {
/// Get a handle on the `usage_id` unique index on the table `profile_redeem_code_usage`.
pub fn usage_id(&self) -> ProfileRedeemCodeUsageUsageIdUnique<'ctx> {
ProfileRedeemCodeUsageUsageIdUnique {
imp: self.imp.get_unique_constraint::<String>("usage_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileRedeemCodeUsageUsageIdUnique<'ctx> {
/// Find the subscribed row whose `usage_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileRedeemCodeUsage> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<ProfileRedeemCodeUsage>("profile_redeem_code_usage");
_table.add_unique_constraint::<String>("usage_id", |row| &row.usage_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileRedeemCodeUsage>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileRedeemCodeUsage>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileRedeemCodeUsage`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_redeem_code_usageQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileRedeemCodeUsage`.
fn profile_redeem_code_usage(&self) -> __sdk::__query_builder::Table<ProfileRedeemCodeUsage>;
}
impl profile_redeem_code_usageQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_redeem_code_usage(&self) -> __sdk::__query_builder::Table<ProfileRedeemCodeUsage> {
__sdk::__query_builder::Table::new("profile_redeem_code_usage")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_referral_relation_type::ProfileReferralRelation;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_referral_relation`.
///
/// Obtain a handle from the [`ProfileReferralRelationTableAccess::profile_referral_relation`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_referral_relation()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_referral_relation().on_insert(...)`.
pub struct ProfileReferralRelationTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileReferralRelation>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_referral_relation`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileReferralRelationTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileReferralRelationTableHandle`], which mediates access to the table `profile_referral_relation`.
fn profile_referral_relation(&self) -> ProfileReferralRelationTableHandle<'_>;
}
impl ProfileReferralRelationTableAccess for super::RemoteTables {
fn profile_referral_relation(&self) -> ProfileReferralRelationTableHandle<'_> {
ProfileReferralRelationTableHandle {
imp: self
.imp
.get_table::<ProfileReferralRelation>("profile_referral_relation"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileReferralRelationInsertCallbackId(__sdk::CallbackId);
pub struct ProfileReferralRelationDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileReferralRelationTableHandle<'ctx> {
type Row = ProfileReferralRelation;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileReferralRelation> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileReferralRelationInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileReferralRelationInsertCallbackId {
ProfileReferralRelationInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileReferralRelationInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileReferralRelationDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileReferralRelationDeleteCallbackId {
ProfileReferralRelationDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileReferralRelationDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileReferralRelationUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileReferralRelationTableHandle<'ctx> {
type UpdateCallbackId = ProfileReferralRelationUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileReferralRelationUpdateCallbackId {
ProfileReferralRelationUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileReferralRelationUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `invitee_user_id` unique index on the table `profile_referral_relation`,
/// which allows point queries on the field of the same name
/// via the [`ProfileReferralRelationInviteeUserIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_referral_relation().invitee_user_id().find(...)`.
pub struct ProfileReferralRelationInviteeUserIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileReferralRelation, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileReferralRelationTableHandle<'ctx> {
/// Get a handle on the `invitee_user_id` unique index on the table `profile_referral_relation`.
pub fn invitee_user_id(&self) -> ProfileReferralRelationInviteeUserIdUnique<'ctx> {
ProfileReferralRelationInviteeUserIdUnique {
imp: self.imp.get_unique_constraint::<String>("invitee_user_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileReferralRelationInviteeUserIdUnique<'ctx> {
/// Find the subscribed row whose `invitee_user_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileReferralRelation> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<ProfileReferralRelation>("profile_referral_relation");
_table.add_unique_constraint::<String>("invitee_user_id", |row| &row.invitee_user_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileReferralRelation>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileReferralRelation>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileReferralRelation`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_referral_relationQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileReferralRelation`.
fn profile_referral_relation(&self) -> __sdk::__query_builder::Table<ProfileReferralRelation>;
}
impl profile_referral_relationQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_referral_relation(&self) -> __sdk::__query_builder::Table<ProfileReferralRelation> {
__sdk::__query_builder::Table::new("profile_referral_relation")
}
}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_save_archive_type::ProfileSaveArchive;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_save_archive`.
///
/// Obtain a handle from the [`ProfileSaveArchiveTableAccess::profile_save_archive`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_save_archive()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_save_archive().on_insert(...)`.
pub struct ProfileSaveArchiveTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileSaveArchive>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_save_archive`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileSaveArchiveTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileSaveArchiveTableHandle`], which mediates access to the table `profile_save_archive`.
fn profile_save_archive(&self) -> ProfileSaveArchiveTableHandle<'_>;
}
impl ProfileSaveArchiveTableAccess for super::RemoteTables {
fn profile_save_archive(&self) -> ProfileSaveArchiveTableHandle<'_> {
ProfileSaveArchiveTableHandle {
imp: self
.imp
.get_table::<ProfileSaveArchive>("profile_save_archive"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileSaveArchiveInsertCallbackId(__sdk::CallbackId);
pub struct ProfileSaveArchiveDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileSaveArchiveTableHandle<'ctx> {
type Row = ProfileSaveArchive;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileSaveArchive> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileSaveArchiveInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileSaveArchiveInsertCallbackId {
ProfileSaveArchiveInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileSaveArchiveInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileSaveArchiveDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileSaveArchiveDeleteCallbackId {
ProfileSaveArchiveDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileSaveArchiveDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileSaveArchiveUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileSaveArchiveTableHandle<'ctx> {
type UpdateCallbackId = ProfileSaveArchiveUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileSaveArchiveUpdateCallbackId {
ProfileSaveArchiveUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileSaveArchiveUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `archive_id` unique index on the table `profile_save_archive`,
/// which allows point queries on the field of the same name
/// via the [`ProfileSaveArchiveArchiveIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_save_archive().archive_id().find(...)`.
pub struct ProfileSaveArchiveArchiveIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileSaveArchive, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileSaveArchiveTableHandle<'ctx> {
/// Get a handle on the `archive_id` unique index on the table `profile_save_archive`.
pub fn archive_id(&self) -> ProfileSaveArchiveArchiveIdUnique<'ctx> {
ProfileSaveArchiveArchiveIdUnique {
imp: self.imp.get_unique_constraint::<String>("archive_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileSaveArchiveArchiveIdUnique<'ctx> {
/// Find the subscribed row whose `archive_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileSaveArchive> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<ProfileSaveArchive>("profile_save_archive");
_table.add_unique_constraint::<String>("archive_id", |row| &row.archive_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileSaveArchive>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileSaveArchive>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileSaveArchive`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_save_archiveQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileSaveArchive`.
fn profile_save_archive(&self) -> __sdk::__query_builder::Table<ProfileSaveArchive>;
}
impl profile_save_archiveQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_save_archive(&self) -> __sdk::__query_builder::Table<ProfileSaveArchive> {
__sdk::__query_builder::Table::new("profile_save_archive")
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_task_config_type::ProfileTaskConfig;
use super::runtime_profile_task_cycle_type::RuntimeProfileTaskCycle;
use super::runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_task_config`.
///
/// Obtain a handle from the [`ProfileTaskConfigTableAccess::profile_task_config`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_task_config()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_task_config().on_insert(...)`.
pub struct ProfileTaskConfigTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileTaskConfig>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_task_config`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileTaskConfigTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileTaskConfigTableHandle`], which mediates access to the table `profile_task_config`.
fn profile_task_config(&self) -> ProfileTaskConfigTableHandle<'_>;
}
impl ProfileTaskConfigTableAccess for super::RemoteTables {
fn profile_task_config(&self) -> ProfileTaskConfigTableHandle<'_> {
ProfileTaskConfigTableHandle {
imp: self
.imp
.get_table::<ProfileTaskConfig>("profile_task_config"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileTaskConfigInsertCallbackId(__sdk::CallbackId);
pub struct ProfileTaskConfigDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileTaskConfigTableHandle<'ctx> {
type Row = ProfileTaskConfig;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileTaskConfig> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileTaskConfigInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileTaskConfigInsertCallbackId {
ProfileTaskConfigInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileTaskConfigInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileTaskConfigDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileTaskConfigDeleteCallbackId {
ProfileTaskConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileTaskConfigDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileTaskConfigUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskConfigTableHandle<'ctx> {
type UpdateCallbackId = ProfileTaskConfigUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileTaskConfigUpdateCallbackId {
ProfileTaskConfigUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileTaskConfigUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `task_id` unique index on the table `profile_task_config`,
/// which allows point queries on the field of the same name
/// via the [`ProfileTaskConfigTaskIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_task_config().task_id().find(...)`.
pub struct ProfileTaskConfigTaskIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileTaskConfig, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileTaskConfigTableHandle<'ctx> {
/// Get a handle on the `task_id` unique index on the table `profile_task_config`.
pub fn task_id(&self) -> ProfileTaskConfigTaskIdUnique<'ctx> {
ProfileTaskConfigTaskIdUnique {
imp: self.imp.get_unique_constraint::<String>("task_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileTaskConfigTaskIdUnique<'ctx> {
/// Find the subscribed row whose `task_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileTaskConfig> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<ProfileTaskConfig>("profile_task_config");
_table.add_unique_constraint::<String>("task_id", |row| &row.task_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileTaskConfig>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileTaskConfig>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileTaskConfig`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_task_configQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileTaskConfig`.
fn profile_task_config(&self) -> __sdk::__query_builder::Table<ProfileTaskConfig>;
}
impl profile_task_configQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_task_config(&self) -> __sdk::__query_builder::Table<ProfileTaskConfig> {
__sdk::__query_builder::Table::new("profile_task_config")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_task_progress_type::ProfileTaskProgress;
use super::runtime_profile_task_status_type::RuntimeProfileTaskStatus;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_task_progress`.
///
/// Obtain a handle from the [`ProfileTaskProgressTableAccess::profile_task_progress`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_task_progress()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_task_progress().on_insert(...)`.
pub struct ProfileTaskProgressTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileTaskProgress>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_task_progress`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileTaskProgressTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileTaskProgressTableHandle`], which mediates access to the table `profile_task_progress`.
fn profile_task_progress(&self) -> ProfileTaskProgressTableHandle<'_>;
}
impl ProfileTaskProgressTableAccess for super::RemoteTables {
fn profile_task_progress(&self) -> ProfileTaskProgressTableHandle<'_> {
ProfileTaskProgressTableHandle {
imp: self
.imp
.get_table::<ProfileTaskProgress>("profile_task_progress"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileTaskProgressInsertCallbackId(__sdk::CallbackId);
pub struct ProfileTaskProgressDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileTaskProgressTableHandle<'ctx> {
type Row = ProfileTaskProgress;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileTaskProgress> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileTaskProgressInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileTaskProgressInsertCallbackId {
ProfileTaskProgressInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileTaskProgressInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileTaskProgressDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileTaskProgressDeleteCallbackId {
ProfileTaskProgressDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileTaskProgressDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileTaskProgressUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskProgressTableHandle<'ctx> {
type UpdateCallbackId = ProfileTaskProgressUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileTaskProgressUpdateCallbackId {
ProfileTaskProgressUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileTaskProgressUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `progress_id` unique index on the table `profile_task_progress`,
/// which allows point queries on the field of the same name
/// via the [`ProfileTaskProgressProgressIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_task_progress().progress_id().find(...)`.
pub struct ProfileTaskProgressProgressIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileTaskProgress, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileTaskProgressTableHandle<'ctx> {
/// Get a handle on the `progress_id` unique index on the table `profile_task_progress`.
pub fn progress_id(&self) -> ProfileTaskProgressProgressIdUnique<'ctx> {
ProfileTaskProgressProgressIdUnique {
imp: self.imp.get_unique_constraint::<String>("progress_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileTaskProgressProgressIdUnique<'ctx> {
/// Find the subscribed row whose `progress_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileTaskProgress> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<ProfileTaskProgress>("profile_task_progress");
_table.add_unique_constraint::<String>("progress_id", |row| &row.progress_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileTaskProgress>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileTaskProgress>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileTaskProgress`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_task_progressQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileTaskProgress`.
fn profile_task_progress(&self) -> __sdk::__query_builder::Table<ProfileTaskProgress>;
}
impl profile_task_progressQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_task_progress(&self) -> __sdk::__query_builder::Table<ProfileTaskProgress> {
__sdk::__query_builder::Table::new("profile_task_progress")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_task_reward_claim_type::ProfileTaskRewardClaim;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_task_reward_claim`.
///
/// Obtain a handle from the [`ProfileTaskRewardClaimTableAccess::profile_task_reward_claim`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_task_reward_claim()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_task_reward_claim().on_insert(...)`.
pub struct ProfileTaskRewardClaimTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileTaskRewardClaim>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_task_reward_claim`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileTaskRewardClaimTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileTaskRewardClaimTableHandle`], which mediates access to the table `profile_task_reward_claim`.
fn profile_task_reward_claim(&self) -> ProfileTaskRewardClaimTableHandle<'_>;
}
impl ProfileTaskRewardClaimTableAccess for super::RemoteTables {
fn profile_task_reward_claim(&self) -> ProfileTaskRewardClaimTableHandle<'_> {
ProfileTaskRewardClaimTableHandle {
imp: self
.imp
.get_table::<ProfileTaskRewardClaim>("profile_task_reward_claim"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileTaskRewardClaimInsertCallbackId(__sdk::CallbackId);
pub struct ProfileTaskRewardClaimDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileTaskRewardClaimTableHandle<'ctx> {
type Row = ProfileTaskRewardClaim;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileTaskRewardClaim> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileTaskRewardClaimInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileTaskRewardClaimInsertCallbackId {
ProfileTaskRewardClaimInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileTaskRewardClaimInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileTaskRewardClaimDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileTaskRewardClaimDeleteCallbackId {
ProfileTaskRewardClaimDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileTaskRewardClaimDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileTaskRewardClaimUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskRewardClaimTableHandle<'ctx> {
type UpdateCallbackId = ProfileTaskRewardClaimUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileTaskRewardClaimUpdateCallbackId {
ProfileTaskRewardClaimUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileTaskRewardClaimUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `claim_id` unique index on the table `profile_task_reward_claim`,
/// which allows point queries on the field of the same name
/// via the [`ProfileTaskRewardClaimClaimIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_task_reward_claim().claim_id().find(...)`.
pub struct ProfileTaskRewardClaimClaimIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileTaskRewardClaim, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileTaskRewardClaimTableHandle<'ctx> {
/// Get a handle on the `claim_id` unique index on the table `profile_task_reward_claim`.
pub fn claim_id(&self) -> ProfileTaskRewardClaimClaimIdUnique<'ctx> {
ProfileTaskRewardClaimClaimIdUnique {
imp: self.imp.get_unique_constraint::<String>("claim_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileTaskRewardClaimClaimIdUnique<'ctx> {
/// Find the subscribed row whose `claim_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileTaskRewardClaim> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<ProfileTaskRewardClaim>("profile_task_reward_claim");
_table.add_unique_constraint::<String>("claim_id", |row| &row.claim_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileTaskRewardClaim>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileTaskRewardClaim>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileTaskRewardClaim`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_task_reward_claimQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileTaskRewardClaim`.
fn profile_task_reward_claim(&self) -> __sdk::__query_builder::Table<ProfileTaskRewardClaim>;
}
impl profile_task_reward_claimQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_task_reward_claim(&self) -> __sdk::__query_builder::Table<ProfileTaskRewardClaim> {
__sdk::__query_builder::Table::new("profile_task_reward_claim")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::profile_wallet_ledger_type::ProfileWalletLedger;
use super::runtime_profile_wallet_ledger_source_type_type::RuntimeProfileWalletLedgerSourceType;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `profile_wallet_ledger`.
///
/// Obtain a handle from the [`ProfileWalletLedgerTableAccess::profile_wallet_ledger`] method on [`super::RemoteTables`],
/// like `ctx.db.profile_wallet_ledger()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_wallet_ledger().on_insert(...)`.
pub struct ProfileWalletLedgerTableHandle<'ctx> {
imp: __sdk::TableHandle<ProfileWalletLedger>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `profile_wallet_ledger`.
///
/// Implemented for [`super::RemoteTables`].
pub trait ProfileWalletLedgerTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`ProfileWalletLedgerTableHandle`], which mediates access to the table `profile_wallet_ledger`.
fn profile_wallet_ledger(&self) -> ProfileWalletLedgerTableHandle<'_>;
}
impl ProfileWalletLedgerTableAccess for super::RemoteTables {
fn profile_wallet_ledger(&self) -> ProfileWalletLedgerTableHandle<'_> {
ProfileWalletLedgerTableHandle {
imp: self
.imp
.get_table::<ProfileWalletLedger>("profile_wallet_ledger"),
ctx: std::marker::PhantomData,
}
}
}
pub struct ProfileWalletLedgerInsertCallbackId(__sdk::CallbackId);
pub struct ProfileWalletLedgerDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for ProfileWalletLedgerTableHandle<'ctx> {
type Row = ProfileWalletLedger;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = ProfileWalletLedger> + '_ {
self.imp.iter()
}
type InsertCallbackId = ProfileWalletLedgerInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileWalletLedgerInsertCallbackId {
ProfileWalletLedgerInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: ProfileWalletLedgerInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = ProfileWalletLedgerDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> ProfileWalletLedgerDeleteCallbackId {
ProfileWalletLedgerDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: ProfileWalletLedgerDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct ProfileWalletLedgerUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileWalletLedgerTableHandle<'ctx> {
type UpdateCallbackId = ProfileWalletLedgerUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> ProfileWalletLedgerUpdateCallbackId {
ProfileWalletLedgerUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: ProfileWalletLedgerUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `wallet_ledger_id` unique index on the table `profile_wallet_ledger`,
/// which allows point queries on the field of the same name
/// via the [`ProfileWalletLedgerWalletLedgerIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.profile_wallet_ledger().wallet_ledger_id().find(...)`.
pub struct ProfileWalletLedgerWalletLedgerIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<ProfileWalletLedger, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> ProfileWalletLedgerTableHandle<'ctx> {
/// Get a handle on the `wallet_ledger_id` unique index on the table `profile_wallet_ledger`.
pub fn wallet_ledger_id(&self) -> ProfileWalletLedgerWalletLedgerIdUnique<'ctx> {
ProfileWalletLedgerWalletLedgerIdUnique {
imp: self.imp.get_unique_constraint::<String>("wallet_ledger_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> ProfileWalletLedgerWalletLedgerIdUnique<'ctx> {
/// Find the subscribed row whose `wallet_ledger_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<ProfileWalletLedger> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<ProfileWalletLedger>("profile_wallet_ledger");
_table.add_unique_constraint::<String>("wallet_ledger_id", |row| &row.wallet_ledger_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<ProfileWalletLedger>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<ProfileWalletLedger>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `ProfileWalletLedger`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait profile_wallet_ledgerQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `ProfileWalletLedger`.
fn profile_wallet_ledger(&self) -> __sdk::__query_builder::Table<ProfileWalletLedger>;
}
impl profile_wallet_ledgerQueryTableAccess for __sdk::QueryTableAccessor {
fn profile_wallet_ledger(&self) -> __sdk::__query_builder::Table<ProfileWalletLedger> {
__sdk::__query_builder::Table::new("profile_wallet_ledger")
}
}

View File

@@ -0,0 +1,159 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::public_work_like_type::PublicWorkLike;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `public_work_like`.
///
/// Obtain a handle from the [`PublicWorkLikeTableAccess::public_work_like`] method on [`super::RemoteTables`],
/// like `ctx.db.public_work_like()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.public_work_like().on_insert(...)`.
pub struct PublicWorkLikeTableHandle<'ctx> {
imp: __sdk::TableHandle<PublicWorkLike>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `public_work_like`.
///
/// Implemented for [`super::RemoteTables`].
pub trait PublicWorkLikeTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`PublicWorkLikeTableHandle`], which mediates access to the table `public_work_like`.
fn public_work_like(&self) -> PublicWorkLikeTableHandle<'_>;
}
impl PublicWorkLikeTableAccess for super::RemoteTables {
fn public_work_like(&self) -> PublicWorkLikeTableHandle<'_> {
PublicWorkLikeTableHandle {
imp: self.imp.get_table::<PublicWorkLike>("public_work_like"),
ctx: std::marker::PhantomData,
}
}
}
pub struct PublicWorkLikeInsertCallbackId(__sdk::CallbackId);
pub struct PublicWorkLikeDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for PublicWorkLikeTableHandle<'ctx> {
type Row = PublicWorkLike;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = PublicWorkLike> + '_ {
self.imp.iter()
}
type InsertCallbackId = PublicWorkLikeInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PublicWorkLikeInsertCallbackId {
PublicWorkLikeInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: PublicWorkLikeInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = PublicWorkLikeDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PublicWorkLikeDeleteCallbackId {
PublicWorkLikeDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: PublicWorkLikeDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct PublicWorkLikeUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for PublicWorkLikeTableHandle<'ctx> {
type UpdateCallbackId = PublicWorkLikeUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> PublicWorkLikeUpdateCallbackId {
PublicWorkLikeUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: PublicWorkLikeUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `like_id` unique index on the table `public_work_like`,
/// which allows point queries on the field of the same name
/// via the [`PublicWorkLikeLikeIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.public_work_like().like_id().find(...)`.
pub struct PublicWorkLikeLikeIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<PublicWorkLike, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> PublicWorkLikeTableHandle<'ctx> {
/// Get a handle on the `like_id` unique index on the table `public_work_like`.
pub fn like_id(&self) -> PublicWorkLikeLikeIdUnique<'ctx> {
PublicWorkLikeLikeIdUnique {
imp: self.imp.get_unique_constraint::<String>("like_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> PublicWorkLikeLikeIdUnique<'ctx> {
/// Find the subscribed row whose `like_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<PublicWorkLike> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<PublicWorkLike>("public_work_like");
_table.add_unique_constraint::<String>("like_id", |row| &row.like_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<PublicWorkLike>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<PublicWorkLike>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `PublicWorkLike`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait public_work_likeQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `PublicWorkLike`.
fn public_work_like(&self) -> __sdk::__query_builder::Table<PublicWorkLike>;
}
impl public_work_likeQueryTableAccess for __sdk::QueryTableAccessor {
fn public_work_like(&self) -> __sdk::__query_builder::Table<PublicWorkLike> {
__sdk::__query_builder::Table::new("public_work_like")
}
}

View File

@@ -0,0 +1,165 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::public_work_play_daily_stat_type::PublicWorkPlayDailyStat;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `public_work_play_daily_stat`.
///
/// Obtain a handle from the [`PublicWorkPlayDailyStatTableAccess::public_work_play_daily_stat`] method on [`super::RemoteTables`],
/// like `ctx.db.public_work_play_daily_stat()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.public_work_play_daily_stat().on_insert(...)`.
pub struct PublicWorkPlayDailyStatTableHandle<'ctx> {
imp: __sdk::TableHandle<PublicWorkPlayDailyStat>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `public_work_play_daily_stat`.
///
/// Implemented for [`super::RemoteTables`].
pub trait PublicWorkPlayDailyStatTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`PublicWorkPlayDailyStatTableHandle`], which mediates access to the table `public_work_play_daily_stat`.
fn public_work_play_daily_stat(&self) -> PublicWorkPlayDailyStatTableHandle<'_>;
}
impl PublicWorkPlayDailyStatTableAccess for super::RemoteTables {
fn public_work_play_daily_stat(&self) -> PublicWorkPlayDailyStatTableHandle<'_> {
PublicWorkPlayDailyStatTableHandle {
imp: self
.imp
.get_table::<PublicWorkPlayDailyStat>("public_work_play_daily_stat"),
ctx: std::marker::PhantomData,
}
}
}
pub struct PublicWorkPlayDailyStatInsertCallbackId(__sdk::CallbackId);
pub struct PublicWorkPlayDailyStatDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for PublicWorkPlayDailyStatTableHandle<'ctx> {
type Row = PublicWorkPlayDailyStat;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = PublicWorkPlayDailyStat> + '_ {
self.imp.iter()
}
type InsertCallbackId = PublicWorkPlayDailyStatInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PublicWorkPlayDailyStatInsertCallbackId {
PublicWorkPlayDailyStatInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: PublicWorkPlayDailyStatInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = PublicWorkPlayDailyStatDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PublicWorkPlayDailyStatDeleteCallbackId {
PublicWorkPlayDailyStatDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: PublicWorkPlayDailyStatDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct PublicWorkPlayDailyStatUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for PublicWorkPlayDailyStatTableHandle<'ctx> {
type UpdateCallbackId = PublicWorkPlayDailyStatUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> PublicWorkPlayDailyStatUpdateCallbackId {
PublicWorkPlayDailyStatUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: PublicWorkPlayDailyStatUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `stat_id` unique index on the table `public_work_play_daily_stat`,
/// which allows point queries on the field of the same name
/// via the [`PublicWorkPlayDailyStatStatIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.public_work_play_daily_stat().stat_id().find(...)`.
pub struct PublicWorkPlayDailyStatStatIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<PublicWorkPlayDailyStat, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> PublicWorkPlayDailyStatTableHandle<'ctx> {
/// Get a handle on the `stat_id` unique index on the table `public_work_play_daily_stat`.
pub fn stat_id(&self) -> PublicWorkPlayDailyStatStatIdUnique<'ctx> {
PublicWorkPlayDailyStatStatIdUnique {
imp: self.imp.get_unique_constraint::<String>("stat_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> PublicWorkPlayDailyStatStatIdUnique<'ctx> {
/// Find the subscribed row whose `stat_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<PublicWorkPlayDailyStat> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<PublicWorkPlayDailyStat>("public_work_play_daily_stat");
_table.add_unique_constraint::<String>("stat_id", |row| &row.stat_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<PublicWorkPlayDailyStat>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<PublicWorkPlayDailyStat>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `PublicWorkPlayDailyStat`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait public_work_play_daily_statQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `PublicWorkPlayDailyStat`.
fn public_work_play_daily_stat(&self)
-> __sdk::__query_builder::Table<PublicWorkPlayDailyStat>;
}
impl public_work_play_daily_statQueryTableAccess for __sdk::QueryTableAccessor {
fn public_work_play_daily_stat(
&self,
) -> __sdk::__query_builder::Table<PublicWorkPlayDailyStat> {
__sdk::__query_builder::Table::new("public_work_play_daily_stat")
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_work_procedure_result_type::SquareHoleWorkProcedureResult;
use super::square_hole_work_publish_input_type::SquareHoleWorkPublishInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct PublishSquareHoleWorkArgs {
pub input: SquareHoleWorkPublishInput,
}
impl __sdk::InModule for PublishSquareHoleWorkArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `publish_square_hole_work`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait publish_square_hole_work {
fn publish_square_hole_work(&self, input: SquareHoleWorkPublishInput) {
self.publish_square_hole_work_then(input, |_, _| {});
}
fn publish_square_hole_work_then(
&self,
input: SquareHoleWorkPublishInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl publish_square_hole_work for super::RemoteProcedures {
fn publish_square_hole_work_then(
&self,
input: SquareHoleWorkPublishInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleWorkProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleWorkProcedureResult>(
"publish_square_hole_work",
PublishSquareHoleWorkArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::puzzle_agent_message_kind_type::PuzzleAgentMessageKind;
use super::puzzle_agent_message_role_type::PuzzleAgentMessageRole;
use super::puzzle_agent_message_row_type::PuzzleAgentMessageRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `puzzle_agent_message`.
///
/// Obtain a handle from the [`PuzzleAgentMessageTableAccess::puzzle_agent_message`] method on [`super::RemoteTables`],
/// like `ctx.db.puzzle_agent_message()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.puzzle_agent_message().on_insert(...)`.
pub struct PuzzleAgentMessageTableHandle<'ctx> {
imp: __sdk::TableHandle<PuzzleAgentMessageRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `puzzle_agent_message`.
///
/// Implemented for [`super::RemoteTables`].
pub trait PuzzleAgentMessageTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`PuzzleAgentMessageTableHandle`], which mediates access to the table `puzzle_agent_message`.
fn puzzle_agent_message(&self) -> PuzzleAgentMessageTableHandle<'_>;
}
impl PuzzleAgentMessageTableAccess for super::RemoteTables {
fn puzzle_agent_message(&self) -> PuzzleAgentMessageTableHandle<'_> {
PuzzleAgentMessageTableHandle {
imp: self
.imp
.get_table::<PuzzleAgentMessageRow>("puzzle_agent_message"),
ctx: std::marker::PhantomData,
}
}
}
pub struct PuzzleAgentMessageInsertCallbackId(__sdk::CallbackId);
pub struct PuzzleAgentMessageDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for PuzzleAgentMessageTableHandle<'ctx> {
type Row = PuzzleAgentMessageRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = PuzzleAgentMessageRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = PuzzleAgentMessageInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PuzzleAgentMessageInsertCallbackId {
PuzzleAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: PuzzleAgentMessageInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = PuzzleAgentMessageDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PuzzleAgentMessageDeleteCallbackId {
PuzzleAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: PuzzleAgentMessageDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct PuzzleAgentMessageUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentMessageTableHandle<'ctx> {
type UpdateCallbackId = PuzzleAgentMessageUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> PuzzleAgentMessageUpdateCallbackId {
PuzzleAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: PuzzleAgentMessageUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `message_id` unique index on the table `puzzle_agent_message`,
/// which allows point queries on the field of the same name
/// via the [`PuzzleAgentMessageMessageIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.puzzle_agent_message().message_id().find(...)`.
pub struct PuzzleAgentMessageMessageIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<PuzzleAgentMessageRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> PuzzleAgentMessageTableHandle<'ctx> {
/// Get a handle on the `message_id` unique index on the table `puzzle_agent_message`.
pub fn message_id(&self) -> PuzzleAgentMessageMessageIdUnique<'ctx> {
PuzzleAgentMessageMessageIdUnique {
imp: self.imp.get_unique_constraint::<String>("message_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> PuzzleAgentMessageMessageIdUnique<'ctx> {
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<PuzzleAgentMessageRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<PuzzleAgentMessageRow>("puzzle_agent_message");
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<PuzzleAgentMessageRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<PuzzleAgentMessageRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `PuzzleAgentMessageRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait puzzle_agent_messageQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `PuzzleAgentMessageRow`.
fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table<PuzzleAgentMessageRow>;
}
impl puzzle_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table<PuzzleAgentMessageRow> {
__sdk::__query_builder::Table::new("puzzle_agent_message")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::puzzle_agent_session_row_type::PuzzleAgentSessionRow;
use super::puzzle_agent_stage_type::PuzzleAgentStage;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `puzzle_agent_session`.
///
/// Obtain a handle from the [`PuzzleAgentSessionTableAccess::puzzle_agent_session`] method on [`super::RemoteTables`],
/// like `ctx.db.puzzle_agent_session()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.puzzle_agent_session().on_insert(...)`.
pub struct PuzzleAgentSessionTableHandle<'ctx> {
imp: __sdk::TableHandle<PuzzleAgentSessionRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `puzzle_agent_session`.
///
/// Implemented for [`super::RemoteTables`].
pub trait PuzzleAgentSessionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`PuzzleAgentSessionTableHandle`], which mediates access to the table `puzzle_agent_session`.
fn puzzle_agent_session(&self) -> PuzzleAgentSessionTableHandle<'_>;
}
impl PuzzleAgentSessionTableAccess for super::RemoteTables {
fn puzzle_agent_session(&self) -> PuzzleAgentSessionTableHandle<'_> {
PuzzleAgentSessionTableHandle {
imp: self
.imp
.get_table::<PuzzleAgentSessionRow>("puzzle_agent_session"),
ctx: std::marker::PhantomData,
}
}
}
pub struct PuzzleAgentSessionInsertCallbackId(__sdk::CallbackId);
pub struct PuzzleAgentSessionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for PuzzleAgentSessionTableHandle<'ctx> {
type Row = PuzzleAgentSessionRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = PuzzleAgentSessionRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = PuzzleAgentSessionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PuzzleAgentSessionInsertCallbackId {
PuzzleAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: PuzzleAgentSessionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = PuzzleAgentSessionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PuzzleAgentSessionDeleteCallbackId {
PuzzleAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: PuzzleAgentSessionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct PuzzleAgentSessionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentSessionTableHandle<'ctx> {
type UpdateCallbackId = PuzzleAgentSessionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> PuzzleAgentSessionUpdateCallbackId {
PuzzleAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: PuzzleAgentSessionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `session_id` unique index on the table `puzzle_agent_session`,
/// which allows point queries on the field of the same name
/// via the [`PuzzleAgentSessionSessionIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.puzzle_agent_session().session_id().find(...)`.
pub struct PuzzleAgentSessionSessionIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<PuzzleAgentSessionRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> PuzzleAgentSessionTableHandle<'ctx> {
/// Get a handle on the `session_id` unique index on the table `puzzle_agent_session`.
pub fn session_id(&self) -> PuzzleAgentSessionSessionIdUnique<'ctx> {
PuzzleAgentSessionSessionIdUnique {
imp: self.imp.get_unique_constraint::<String>("session_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> PuzzleAgentSessionSessionIdUnique<'ctx> {
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<PuzzleAgentSessionRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<PuzzleAgentSessionRow>("puzzle_agent_session");
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<PuzzleAgentSessionRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<PuzzleAgentSessionRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `PuzzleAgentSessionRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait puzzle_agent_sessionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `PuzzleAgentSessionRow`.
fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table<PuzzleAgentSessionRow>;
}
impl puzzle_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor {
fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table<PuzzleAgentSessionRow> {
__sdk::__query_builder::Table::new("puzzle_agent_session")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::puzzle_leaderboard_entry_row_type::PuzzleLeaderboardEntryRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `puzzle_leaderboard_entry`.
///
/// Obtain a handle from the [`PuzzleLeaderboardEntryTableAccess::puzzle_leaderboard_entry`] method on [`super::RemoteTables`],
/// like `ctx.db.puzzle_leaderboard_entry()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.puzzle_leaderboard_entry().on_insert(...)`.
pub struct PuzzleLeaderboardEntryTableHandle<'ctx> {
imp: __sdk::TableHandle<PuzzleLeaderboardEntryRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `puzzle_leaderboard_entry`.
///
/// Implemented for [`super::RemoteTables`].
pub trait PuzzleLeaderboardEntryTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`PuzzleLeaderboardEntryTableHandle`], which mediates access to the table `puzzle_leaderboard_entry`.
fn puzzle_leaderboard_entry(&self) -> PuzzleLeaderboardEntryTableHandle<'_>;
}
impl PuzzleLeaderboardEntryTableAccess for super::RemoteTables {
fn puzzle_leaderboard_entry(&self) -> PuzzleLeaderboardEntryTableHandle<'_> {
PuzzleLeaderboardEntryTableHandle {
imp: self
.imp
.get_table::<PuzzleLeaderboardEntryRow>("puzzle_leaderboard_entry"),
ctx: std::marker::PhantomData,
}
}
}
pub struct PuzzleLeaderboardEntryInsertCallbackId(__sdk::CallbackId);
pub struct PuzzleLeaderboardEntryDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for PuzzleLeaderboardEntryTableHandle<'ctx> {
type Row = PuzzleLeaderboardEntryRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = PuzzleLeaderboardEntryRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = PuzzleLeaderboardEntryInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PuzzleLeaderboardEntryInsertCallbackId {
PuzzleLeaderboardEntryInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: PuzzleLeaderboardEntryInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = PuzzleLeaderboardEntryDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PuzzleLeaderboardEntryDeleteCallbackId {
PuzzleLeaderboardEntryDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: PuzzleLeaderboardEntryDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct PuzzleLeaderboardEntryUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleLeaderboardEntryTableHandle<'ctx> {
type UpdateCallbackId = PuzzleLeaderboardEntryUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> PuzzleLeaderboardEntryUpdateCallbackId {
PuzzleLeaderboardEntryUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: PuzzleLeaderboardEntryUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `entry_id` unique index on the table `puzzle_leaderboard_entry`,
/// which allows point queries on the field of the same name
/// via the [`PuzzleLeaderboardEntryEntryIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.puzzle_leaderboard_entry().entry_id().find(...)`.
pub struct PuzzleLeaderboardEntryEntryIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<PuzzleLeaderboardEntryRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> PuzzleLeaderboardEntryTableHandle<'ctx> {
/// Get a handle on the `entry_id` unique index on the table `puzzle_leaderboard_entry`.
pub fn entry_id(&self) -> PuzzleLeaderboardEntryEntryIdUnique<'ctx> {
PuzzleLeaderboardEntryEntryIdUnique {
imp: self.imp.get_unique_constraint::<String>("entry_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> PuzzleLeaderboardEntryEntryIdUnique<'ctx> {
/// Find the subscribed row whose `entry_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<PuzzleLeaderboardEntryRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<PuzzleLeaderboardEntryRow>("puzzle_leaderboard_entry");
_table.add_unique_constraint::<String>("entry_id", |row| &row.entry_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<PuzzleLeaderboardEntryRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<PuzzleLeaderboardEntryRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `PuzzleLeaderboardEntryRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait puzzle_leaderboard_entryQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `PuzzleLeaderboardEntryRow`.
fn puzzle_leaderboard_entry(&self) -> __sdk::__query_builder::Table<PuzzleLeaderboardEntryRow>;
}
impl puzzle_leaderboard_entryQueryTableAccess for __sdk::QueryTableAccessor {
fn puzzle_leaderboard_entry(&self) -> __sdk::__query_builder::Table<PuzzleLeaderboardEntryRow> {
__sdk::__query_builder::Table::new("puzzle_leaderboard_entry")
}
}

View File

@@ -0,0 +1,161 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::puzzle_runtime_run_row_type::PuzzleRuntimeRunRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `puzzle_runtime_run`.
///
/// Obtain a handle from the [`PuzzleRuntimeRunTableAccess::puzzle_runtime_run`] method on [`super::RemoteTables`],
/// like `ctx.db.puzzle_runtime_run()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.puzzle_runtime_run().on_insert(...)`.
pub struct PuzzleRuntimeRunTableHandle<'ctx> {
imp: __sdk::TableHandle<PuzzleRuntimeRunRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `puzzle_runtime_run`.
///
/// Implemented for [`super::RemoteTables`].
pub trait PuzzleRuntimeRunTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`PuzzleRuntimeRunTableHandle`], which mediates access to the table `puzzle_runtime_run`.
fn puzzle_runtime_run(&self) -> PuzzleRuntimeRunTableHandle<'_>;
}
impl PuzzleRuntimeRunTableAccess for super::RemoteTables {
fn puzzle_runtime_run(&self) -> PuzzleRuntimeRunTableHandle<'_> {
PuzzleRuntimeRunTableHandle {
imp: self
.imp
.get_table::<PuzzleRuntimeRunRow>("puzzle_runtime_run"),
ctx: std::marker::PhantomData,
}
}
}
pub struct PuzzleRuntimeRunInsertCallbackId(__sdk::CallbackId);
pub struct PuzzleRuntimeRunDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for PuzzleRuntimeRunTableHandle<'ctx> {
type Row = PuzzleRuntimeRunRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = PuzzleRuntimeRunRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = PuzzleRuntimeRunInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PuzzleRuntimeRunInsertCallbackId {
PuzzleRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: PuzzleRuntimeRunInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = PuzzleRuntimeRunDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PuzzleRuntimeRunDeleteCallbackId {
PuzzleRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: PuzzleRuntimeRunDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct PuzzleRuntimeRunUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleRuntimeRunTableHandle<'ctx> {
type UpdateCallbackId = PuzzleRuntimeRunUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> PuzzleRuntimeRunUpdateCallbackId {
PuzzleRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: PuzzleRuntimeRunUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `run_id` unique index on the table `puzzle_runtime_run`,
/// which allows point queries on the field of the same name
/// via the [`PuzzleRuntimeRunRunIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.puzzle_runtime_run().run_id().find(...)`.
pub struct PuzzleRuntimeRunRunIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<PuzzleRuntimeRunRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> PuzzleRuntimeRunTableHandle<'ctx> {
/// Get a handle on the `run_id` unique index on the table `puzzle_runtime_run`.
pub fn run_id(&self) -> PuzzleRuntimeRunRunIdUnique<'ctx> {
PuzzleRuntimeRunRunIdUnique {
imp: self.imp.get_unique_constraint::<String>("run_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> PuzzleRuntimeRunRunIdUnique<'ctx> {
/// Find the subscribed row whose `run_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<PuzzleRuntimeRunRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<PuzzleRuntimeRunRow>("puzzle_runtime_run");
_table.add_unique_constraint::<String>("run_id", |row| &row.run_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<PuzzleRuntimeRunRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<PuzzleRuntimeRunRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `PuzzleRuntimeRunRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait puzzle_runtime_runQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `PuzzleRuntimeRunRow`.
fn puzzle_runtime_run(&self) -> __sdk::__query_builder::Table<PuzzleRuntimeRunRow>;
}
impl puzzle_runtime_runQueryTableAccess for __sdk::QueryTableAccessor {
fn puzzle_runtime_run(&self) -> __sdk::__query_builder::Table<PuzzleRuntimeRunRow> {
__sdk::__query_builder::Table::new("puzzle_runtime_run")
}
}

View File

@@ -0,0 +1,162 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::puzzle_publication_status_type::PuzzlePublicationStatus;
use super::puzzle_work_profile_row_type::PuzzleWorkProfileRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `puzzle_work_profile`.
///
/// Obtain a handle from the [`PuzzleWorkProfileTableAccess::puzzle_work_profile`] method on [`super::RemoteTables`],
/// like `ctx.db.puzzle_work_profile()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.puzzle_work_profile().on_insert(...)`.
pub struct PuzzleWorkProfileTableHandle<'ctx> {
imp: __sdk::TableHandle<PuzzleWorkProfileRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `puzzle_work_profile`.
///
/// Implemented for [`super::RemoteTables`].
pub trait PuzzleWorkProfileTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`PuzzleWorkProfileTableHandle`], which mediates access to the table `puzzle_work_profile`.
fn puzzle_work_profile(&self) -> PuzzleWorkProfileTableHandle<'_>;
}
impl PuzzleWorkProfileTableAccess for super::RemoteTables {
fn puzzle_work_profile(&self) -> PuzzleWorkProfileTableHandle<'_> {
PuzzleWorkProfileTableHandle {
imp: self
.imp
.get_table::<PuzzleWorkProfileRow>("puzzle_work_profile"),
ctx: std::marker::PhantomData,
}
}
}
pub struct PuzzleWorkProfileInsertCallbackId(__sdk::CallbackId);
pub struct PuzzleWorkProfileDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for PuzzleWorkProfileTableHandle<'ctx> {
type Row = PuzzleWorkProfileRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = PuzzleWorkProfileRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = PuzzleWorkProfileInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PuzzleWorkProfileInsertCallbackId {
PuzzleWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: PuzzleWorkProfileInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = PuzzleWorkProfileDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> PuzzleWorkProfileDeleteCallbackId {
PuzzleWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: PuzzleWorkProfileDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct PuzzleWorkProfileUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleWorkProfileTableHandle<'ctx> {
type UpdateCallbackId = PuzzleWorkProfileUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> PuzzleWorkProfileUpdateCallbackId {
PuzzleWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: PuzzleWorkProfileUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `profile_id` unique index on the table `puzzle_work_profile`,
/// which allows point queries on the field of the same name
/// via the [`PuzzleWorkProfileProfileIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.puzzle_work_profile().profile_id().find(...)`.
pub struct PuzzleWorkProfileProfileIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<PuzzleWorkProfileRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> PuzzleWorkProfileTableHandle<'ctx> {
/// Get a handle on the `profile_id` unique index on the table `puzzle_work_profile`.
pub fn profile_id(&self) -> PuzzleWorkProfileProfileIdUnique<'ctx> {
PuzzleWorkProfileProfileIdUnique {
imp: self.imp.get_unique_constraint::<String>("profile_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> PuzzleWorkProfileProfileIdUnique<'ctx> {
/// Find the subscribed row whose `profile_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<PuzzleWorkProfileRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<PuzzleWorkProfileRow>("puzzle_work_profile");
_table.add_unique_constraint::<String>("profile_id", |row| &row.profile_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<PuzzleWorkProfileRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<PuzzleWorkProfileRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `PuzzleWorkProfileRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait puzzle_work_profileQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `PuzzleWorkProfileRow`.
fn puzzle_work_profile(&self) -> __sdk::__query_builder::Table<PuzzleWorkProfileRow>;
}
impl puzzle_work_profileQueryTableAccess for __sdk::QueryTableAccessor {
fn puzzle_work_profile(&self) -> __sdk::__query_builder::Table<PuzzleWorkProfileRow> {
__sdk::__query_builder::Table::new("puzzle_work_profile")
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::analytics_metric_query_input_type::AnalyticsMetricQueryInput;
use super::analytics_metric_query_procedure_result_type::AnalyticsMetricQueryProcedureResult;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct QueryAnalyticsMetricArgs {
pub input: AnalyticsMetricQueryInput,
}
impl __sdk::InModule for QueryAnalyticsMetricArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `query_analytics_metric`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait query_analytics_metric {
fn query_analytics_metric(&self, input: AnalyticsMetricQueryInput) {
self.query_analytics_metric_then(input, |_, _| {});
}
fn query_analytics_metric_then(
&self,
input: AnalyticsMetricQueryInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AnalyticsMetricQueryProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl query_analytics_metric for super::RemoteProcedures {
fn query_analytics_metric_then(
&self,
input: AnalyticsMetricQueryInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<AnalyticsMetricQueryProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, AnalyticsMetricQueryProcedureResult>(
"query_analytics_metric",
QueryAnalyticsMetricArgs { input },
__callback,
);
}
}

View File

@@ -0,0 +1,163 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::quest_log_event_kind_type::QuestLogEventKind;
use super::quest_log_type::QuestLog;
use super::quest_progress_signal_type::QuestProgressSignal;
use super::quest_signal_kind_type::QuestSignalKind;
use super::quest_status_type::QuestStatus;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `quest_log`.
///
/// Obtain a handle from the [`QuestLogTableAccess::quest_log`] method on [`super::RemoteTables`],
/// like `ctx.db.quest_log()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.quest_log().on_insert(...)`.
pub struct QuestLogTableHandle<'ctx> {
imp: __sdk::TableHandle<QuestLog>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `quest_log`.
///
/// Implemented for [`super::RemoteTables`].
pub trait QuestLogTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`QuestLogTableHandle`], which mediates access to the table `quest_log`.
fn quest_log(&self) -> QuestLogTableHandle<'_>;
}
impl QuestLogTableAccess for super::RemoteTables {
fn quest_log(&self) -> QuestLogTableHandle<'_> {
QuestLogTableHandle {
imp: self.imp.get_table::<QuestLog>("quest_log"),
ctx: std::marker::PhantomData,
}
}
}
pub struct QuestLogInsertCallbackId(__sdk::CallbackId);
pub struct QuestLogDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for QuestLogTableHandle<'ctx> {
type Row = QuestLog;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = QuestLog> + '_ {
self.imp.iter()
}
type InsertCallbackId = QuestLogInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> QuestLogInsertCallbackId {
QuestLogInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: QuestLogInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = QuestLogDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> QuestLogDeleteCallbackId {
QuestLogDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: QuestLogDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct QuestLogUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for QuestLogTableHandle<'ctx> {
type UpdateCallbackId = QuestLogUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> QuestLogUpdateCallbackId {
QuestLogUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: QuestLogUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `log_id` unique index on the table `quest_log`,
/// which allows point queries on the field of the same name
/// via the [`QuestLogLogIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.quest_log().log_id().find(...)`.
pub struct QuestLogLogIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<QuestLog, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> QuestLogTableHandle<'ctx> {
/// Get a handle on the `log_id` unique index on the table `quest_log`.
pub fn log_id(&self) -> QuestLogLogIdUnique<'ctx> {
QuestLogLogIdUnique {
imp: self.imp.get_unique_constraint::<String>("log_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> QuestLogLogIdUnique<'ctx> {
/// Find the subscribed row whose `log_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<QuestLog> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<QuestLog>("quest_log");
_table.add_unique_constraint::<String>("log_id", |row| &row.log_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<QuestLog>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<QuestLog>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `QuestLog`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait quest_logQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `QuestLog`.
fn quest_log(&self) -> __sdk::__query_builder::Table<QuestLog>;
}
impl quest_logQueryTableAccess for __sdk::QueryTableAccessor {
fn quest_log(&self) -> __sdk::__query_builder::Table<QuestLog> {
__sdk::__query_builder::Table::new("quest_log")
}
}

View File

@@ -0,0 +1,164 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot;
use super::quest_objective_snapshot_type::QuestObjectiveSnapshot;
use super::quest_record_type::QuestRecord;
use super::quest_reward_snapshot_type::QuestRewardSnapshot;
use super::quest_status_type::QuestStatus;
use super::quest_step_snapshot_type::QuestStepSnapshot;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `quest_record`.
///
/// Obtain a handle from the [`QuestRecordTableAccess::quest_record`] method on [`super::RemoteTables`],
/// like `ctx.db.quest_record()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.quest_record().on_insert(...)`.
pub struct QuestRecordTableHandle<'ctx> {
imp: __sdk::TableHandle<QuestRecord>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `quest_record`.
///
/// Implemented for [`super::RemoteTables`].
pub trait QuestRecordTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`QuestRecordTableHandle`], which mediates access to the table `quest_record`.
fn quest_record(&self) -> QuestRecordTableHandle<'_>;
}
impl QuestRecordTableAccess for super::RemoteTables {
fn quest_record(&self) -> QuestRecordTableHandle<'_> {
QuestRecordTableHandle {
imp: self.imp.get_table::<QuestRecord>("quest_record"),
ctx: std::marker::PhantomData,
}
}
}
pub struct QuestRecordInsertCallbackId(__sdk::CallbackId);
pub struct QuestRecordDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for QuestRecordTableHandle<'ctx> {
type Row = QuestRecord;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = QuestRecord> + '_ {
self.imp.iter()
}
type InsertCallbackId = QuestRecordInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> QuestRecordInsertCallbackId {
QuestRecordInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: QuestRecordInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = QuestRecordDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> QuestRecordDeleteCallbackId {
QuestRecordDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: QuestRecordDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct QuestRecordUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for QuestRecordTableHandle<'ctx> {
type UpdateCallbackId = QuestRecordUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> QuestRecordUpdateCallbackId {
QuestRecordUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: QuestRecordUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `quest_id` unique index on the table `quest_record`,
/// which allows point queries on the field of the same name
/// via the [`QuestRecordQuestIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.quest_record().quest_id().find(...)`.
pub struct QuestRecordQuestIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<QuestRecord, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> QuestRecordTableHandle<'ctx> {
/// Get a handle on the `quest_id` unique index on the table `quest_record`.
pub fn quest_id(&self) -> QuestRecordQuestIdUnique<'ctx> {
QuestRecordQuestIdUnique {
imp: self.imp.get_unique_constraint::<String>("quest_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> QuestRecordQuestIdUnique<'ctx> {
/// Find the subscribed row whose `quest_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<QuestRecord> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<QuestRecord>("quest_record");
_table.add_unique_constraint::<String>("quest_id", |row| &row.quest_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<QuestRecord>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<QuestRecord>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `QuestRecord`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait quest_recordQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `QuestRecord`.
fn quest_record(&self) -> __sdk::__query_builder::Table<QuestRecord>;
}
impl quest_recordQueryTableAccess for __sdk::QueryTableAccessor {
fn quest_record(&self) -> __sdk::__query_builder::Table<QuestRecord> {
__sdk::__query_builder::Table::new("quest_record")
}
}

View File

@@ -0,0 +1,159 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::refresh_session_type::RefreshSession;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `refresh_session`.
///
/// Obtain a handle from the [`RefreshSessionTableAccess::refresh_session`] method on [`super::RemoteTables`],
/// like `ctx.db.refresh_session()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.refresh_session().on_insert(...)`.
pub struct RefreshSessionTableHandle<'ctx> {
imp: __sdk::TableHandle<RefreshSession>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `refresh_session`.
///
/// Implemented for [`super::RemoteTables`].
pub trait RefreshSessionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`RefreshSessionTableHandle`], which mediates access to the table `refresh_session`.
fn refresh_session(&self) -> RefreshSessionTableHandle<'_>;
}
impl RefreshSessionTableAccess for super::RemoteTables {
fn refresh_session(&self) -> RefreshSessionTableHandle<'_> {
RefreshSessionTableHandle {
imp: self.imp.get_table::<RefreshSession>("refresh_session"),
ctx: std::marker::PhantomData,
}
}
}
pub struct RefreshSessionInsertCallbackId(__sdk::CallbackId);
pub struct RefreshSessionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for RefreshSessionTableHandle<'ctx> {
type Row = RefreshSession;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = RefreshSession> + '_ {
self.imp.iter()
}
type InsertCallbackId = RefreshSessionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> RefreshSessionInsertCallbackId {
RefreshSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: RefreshSessionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = RefreshSessionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> RefreshSessionDeleteCallbackId {
RefreshSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: RefreshSessionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct RefreshSessionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for RefreshSessionTableHandle<'ctx> {
type UpdateCallbackId = RefreshSessionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> RefreshSessionUpdateCallbackId {
RefreshSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: RefreshSessionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `session_id` unique index on the table `refresh_session`,
/// which allows point queries on the field of the same name
/// via the [`RefreshSessionSessionIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.refresh_session().session_id().find(...)`.
pub struct RefreshSessionSessionIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<RefreshSession, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> RefreshSessionTableHandle<'ctx> {
/// Get a handle on the `session_id` unique index on the table `refresh_session`.
pub fn session_id(&self) -> RefreshSessionSessionIdUnique<'ctx> {
RefreshSessionSessionIdUnique {
imp: self.imp.get_unique_constraint::<String>("session_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> RefreshSessionSessionIdUnique<'ctx> {
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<RefreshSession> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<RefreshSession>("refresh_session");
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<RefreshSession>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<RefreshSession>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `RefreshSession`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait refresh_sessionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `RefreshSession`.
fn refresh_session(&self) -> __sdk::__query_builder::Table<RefreshSession>;
}
impl refresh_sessionQueryTableAccess for __sdk::QueryTableAccessor {
fn refresh_session(&self) -> __sdk::__query_builder::Table<RefreshSession> {
__sdk::__query_builder::Table::new("refresh_session")
}
}

View File

@@ -0,0 +1,59 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::square_hole_run_procedure_result_type::SquareHoleRunProcedureResult;
use super::square_hole_run_restart_input_type::SquareHoleRunRestartInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
struct RestartSquareHoleRunArgs {
pub input: SquareHoleRunRestartInput,
}
impl __sdk::InModule for RestartSquareHoleRunArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the procedure `restart_square_hole_run`.
///
/// Implemented for [`super::RemoteProcedures`].
pub trait restart_square_hole_run {
fn restart_square_hole_run(&self, input: SquareHoleRunRestartInput) {
self.restart_square_hole_run_then(input, |_, _| {});
}
fn restart_square_hole_run_then(
&self,
input: SquareHoleRunRestartInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
);
}
impl restart_square_hole_run for super::RemoteProcedures {
fn restart_square_hole_run_then(
&self,
input: SquareHoleRunRestartInput,
__callback: impl FnOnce(
&super::ProcedureEventContext,
Result<SquareHoleRunProcedureResult, __sdk::InternalError>,
) + Send
+ 'static,
) {
self.imp
.invoke_procedure_with_callback::<_, SquareHoleRunProcedureResult>(
"restart_square_hole_run",
RestartSquareHoleRunArgs { input },
__callback,
);
}
}

View File

@@ -10,6 +10,8 @@ pub struct RuntimeProfileInviteCodeAdminUpsertInput {
pub admin_user_id: String,
pub invite_code: String,
pub metadata_json: String,
pub starts_at_micros: Option<i64>,
pub expires_at_micros: Option<i64>,
pub updated_at_micros: i64,
}

View File

@@ -10,6 +10,8 @@ pub struct RuntimeProfileInviteCodeSnapshot {
pub user_id: String,
pub invite_code: String,
pub metadata_json: String,
pub starts_at_micros: Option<i64>,
pub expires_at_micros: Option<i64>,
pub created_at_micros: i64,
pub updated_at_micros: i64,
}

View File

@@ -0,0 +1,160 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::runtime_platform_theme_type::RuntimePlatformTheme;
use super::runtime_setting_type::RuntimeSetting;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `runtime_setting`.
///
/// Obtain a handle from the [`RuntimeSettingTableAccess::runtime_setting`] method on [`super::RemoteTables`],
/// like `ctx.db.runtime_setting()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.runtime_setting().on_insert(...)`.
pub struct RuntimeSettingTableHandle<'ctx> {
imp: __sdk::TableHandle<RuntimeSetting>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `runtime_setting`.
///
/// Implemented for [`super::RemoteTables`].
pub trait RuntimeSettingTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`RuntimeSettingTableHandle`], which mediates access to the table `runtime_setting`.
fn runtime_setting(&self) -> RuntimeSettingTableHandle<'_>;
}
impl RuntimeSettingTableAccess for super::RemoteTables {
fn runtime_setting(&self) -> RuntimeSettingTableHandle<'_> {
RuntimeSettingTableHandle {
imp: self.imp.get_table::<RuntimeSetting>("runtime_setting"),
ctx: std::marker::PhantomData,
}
}
}
pub struct RuntimeSettingInsertCallbackId(__sdk::CallbackId);
pub struct RuntimeSettingDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for RuntimeSettingTableHandle<'ctx> {
type Row = RuntimeSetting;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = RuntimeSetting> + '_ {
self.imp.iter()
}
type InsertCallbackId = RuntimeSettingInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> RuntimeSettingInsertCallbackId {
RuntimeSettingInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: RuntimeSettingInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = RuntimeSettingDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> RuntimeSettingDeleteCallbackId {
RuntimeSettingDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: RuntimeSettingDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct RuntimeSettingUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for RuntimeSettingTableHandle<'ctx> {
type UpdateCallbackId = RuntimeSettingUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> RuntimeSettingUpdateCallbackId {
RuntimeSettingUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: RuntimeSettingUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `user_id` unique index on the table `runtime_setting`,
/// which allows point queries on the field of the same name
/// via the [`RuntimeSettingUserIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.runtime_setting().user_id().find(...)`.
pub struct RuntimeSettingUserIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<RuntimeSetting, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> RuntimeSettingTableHandle<'ctx> {
/// Get a handle on the `user_id` unique index on the table `runtime_setting`.
pub fn user_id(&self) -> RuntimeSettingUserIdUnique<'ctx> {
RuntimeSettingUserIdUnique {
imp: self.imp.get_unique_constraint::<String>("user_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> RuntimeSettingUserIdUnique<'ctx> {
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<RuntimeSetting> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<RuntimeSetting>("runtime_setting");
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<RuntimeSetting>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<RuntimeSetting>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `RuntimeSetting`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait runtime_settingQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `RuntimeSetting`.
fn runtime_setting(&self) -> __sdk::__query_builder::Table<RuntimeSetting>;
}
impl runtime_settingQueryTableAccess for __sdk::QueryTableAccessor {
fn runtime_setting(&self) -> __sdk::__query_builder::Table<RuntimeSetting> {
__sdk::__query_builder::Table::new("runtime_setting")
}
}

View File

@@ -0,0 +1,159 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::runtime_snapshot_row_type::RuntimeSnapshotRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `runtime_snapshot`.
///
/// Obtain a handle from the [`RuntimeSnapshotTableAccess::runtime_snapshot`] method on [`super::RemoteTables`],
/// like `ctx.db.runtime_snapshot()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.runtime_snapshot().on_insert(...)`.
pub struct RuntimeSnapshotTableHandle<'ctx> {
imp: __sdk::TableHandle<RuntimeSnapshotRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `runtime_snapshot`.
///
/// Implemented for [`super::RemoteTables`].
pub trait RuntimeSnapshotTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`RuntimeSnapshotTableHandle`], which mediates access to the table `runtime_snapshot`.
fn runtime_snapshot(&self) -> RuntimeSnapshotTableHandle<'_>;
}
impl RuntimeSnapshotTableAccess for super::RemoteTables {
fn runtime_snapshot(&self) -> RuntimeSnapshotTableHandle<'_> {
RuntimeSnapshotTableHandle {
imp: self.imp.get_table::<RuntimeSnapshotRow>("runtime_snapshot"),
ctx: std::marker::PhantomData,
}
}
}
pub struct RuntimeSnapshotInsertCallbackId(__sdk::CallbackId);
pub struct RuntimeSnapshotDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for RuntimeSnapshotTableHandle<'ctx> {
type Row = RuntimeSnapshotRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = RuntimeSnapshotRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = RuntimeSnapshotInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> RuntimeSnapshotInsertCallbackId {
RuntimeSnapshotInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: RuntimeSnapshotInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = RuntimeSnapshotDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> RuntimeSnapshotDeleteCallbackId {
RuntimeSnapshotDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: RuntimeSnapshotDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct RuntimeSnapshotUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for RuntimeSnapshotTableHandle<'ctx> {
type UpdateCallbackId = RuntimeSnapshotUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> RuntimeSnapshotUpdateCallbackId {
RuntimeSnapshotUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: RuntimeSnapshotUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `user_id` unique index on the table `runtime_snapshot`,
/// which allows point queries on the field of the same name
/// via the [`RuntimeSnapshotUserIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.runtime_snapshot().user_id().find(...)`.
pub struct RuntimeSnapshotUserIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<RuntimeSnapshotRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> RuntimeSnapshotTableHandle<'ctx> {
/// Get a handle on the `user_id` unique index on the table `runtime_snapshot`.
pub fn user_id(&self) -> RuntimeSnapshotUserIdUnique<'ctx> {
RuntimeSnapshotUserIdUnique {
imp: self.imp.get_unique_constraint::<String>("user_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> RuntimeSnapshotUserIdUnique<'ctx> {
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<RuntimeSnapshotRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table = client_cache.get_or_make_table::<RuntimeSnapshotRow>("runtime_snapshot");
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<RuntimeSnapshotRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<RuntimeSnapshotRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `RuntimeSnapshotRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait runtime_snapshotQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `RuntimeSnapshotRow`.
fn runtime_snapshot(&self) -> __sdk::__query_builder::Table<RuntimeSnapshotRow>;
}
impl runtime_snapshotQueryTableAccess for __sdk::QueryTableAccessor {
fn runtime_snapshot(&self) -> __sdk::__query_builder::Table<RuntimeSnapshotRow> {
__sdk::__query_builder::Table::new("runtime_snapshot")
}
}

View File

@@ -0,0 +1,75 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
use super::analytics_date_dimension_seed_input_type::AnalyticsDateDimensionSeedInput;
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub(super) struct SeedAnalyticsDateDimensionsArgs {
pub input: AnalyticsDateDimensionSeedInput,
}
impl From<SeedAnalyticsDateDimensionsArgs> for super::Reducer {
fn from(args: SeedAnalyticsDateDimensionsArgs) -> Self {
Self::SeedAnalyticsDateDimensions { input: args.input }
}
}
impl __sdk::InModule for SeedAnalyticsDateDimensionsArgs {
type Module = super::RemoteModule;
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the reducer `seed_analytics_date_dimensions`.
///
/// Implemented for [`super::RemoteReducers`].
pub trait seed_analytics_date_dimensions {
/// Request that the remote module invoke the reducer `seed_analytics_date_dimensions` to run as soon as possible.
///
/// This method returns immediately, and errors only if we are unable to send the request.
/// The reducer will run asynchronously in the future,
/// and this method provides no way to listen for its completion status.
/// /// Use [`seed_analytics_date_dimensions:seed_analytics_date_dimensions_then`] to run a callback after the reducer completes.
fn seed_analytics_date_dimensions(
&self,
input: AnalyticsDateDimensionSeedInput,
) -> __sdk::Result<()> {
self.seed_analytics_date_dimensions_then(input, |_, _| {})
}
/// Request that the remote module invoke the reducer `seed_analytics_date_dimensions` to run as soon as possible,
/// registering `callback` to run when we are notified that the reducer completed.
///
/// This method returns immediately, and errors only if we are unable to send the request.
/// The reducer will run asynchronously in the future,
/// and its status can be observed with the `callback`.
fn seed_analytics_date_dimensions_then(
&self,
input: AnalyticsDateDimensionSeedInput,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()>;
}
impl seed_analytics_date_dimensions for super::RemoteReducers {
fn seed_analytics_date_dimensions_then(
&self,
input: AnalyticsDateDimensionSeedInput,
callback: impl FnOnce(
&super::ReducerEventContext,
Result<Result<(), String>, __sdk::InternalError>,
) + Send
+ 'static,
) -> __sdk::Result<()> {
self.imp
.invoke_reducer_with_callback(SeedAnalyticsDateDimensionsArgs { input }, callback)
}
}

View File

@@ -0,0 +1,23 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleAgentMessageFinalizeInput {
pub session_id: String,
pub owner_user_id: String,
pub assistant_message_id: Option<String>,
pub assistant_reply_text: Option<String>,
pub config_json: Option<String>,
pub progress_percent: u32,
pub stage: String,
pub updated_at_micros: i64,
pub error_message: Option<String>,
}
impl __sdk::InModule for SquareHoleAgentMessageFinalizeInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,66 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleAgentMessageRow {
pub message_id: String,
pub session_id: String,
pub role: String,
pub kind: String,
pub text: String,
pub created_at: __sdk::Timestamp,
}
impl __sdk::InModule for SquareHoleAgentMessageRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `SquareHoleAgentMessageRow`.
///
/// Provides typed access to columns for query building.
pub struct SquareHoleAgentMessageRowCols {
pub message_id: __sdk::__query_builder::Col<SquareHoleAgentMessageRow, String>,
pub session_id: __sdk::__query_builder::Col<SquareHoleAgentMessageRow, String>,
pub role: __sdk::__query_builder::Col<SquareHoleAgentMessageRow, String>,
pub kind: __sdk::__query_builder::Col<SquareHoleAgentMessageRow, String>,
pub text: __sdk::__query_builder::Col<SquareHoleAgentMessageRow, String>,
pub created_at: __sdk::__query_builder::Col<SquareHoleAgentMessageRow, __sdk::Timestamp>,
}
impl __sdk::__query_builder::HasCols for SquareHoleAgentMessageRow {
type Cols = SquareHoleAgentMessageRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
SquareHoleAgentMessageRowCols {
message_id: __sdk::__query_builder::Col::new(table_name, "message_id"),
session_id: __sdk::__query_builder::Col::new(table_name, "session_id"),
role: __sdk::__query_builder::Col::new(table_name, "role"),
kind: __sdk::__query_builder::Col::new(table_name, "kind"),
text: __sdk::__query_builder::Col::new(table_name, "text"),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
}
}
}
/// Indexed column accessor struct for the table `SquareHoleAgentMessageRow`.
///
/// Provides typed access to indexed columns for query building.
pub struct SquareHoleAgentMessageRowIxCols {
pub message_id: __sdk::__query_builder::IxCol<SquareHoleAgentMessageRow, String>,
pub session_id: __sdk::__query_builder::IxCol<SquareHoleAgentMessageRow, String>,
}
impl __sdk::__query_builder::HasIxCols for SquareHoleAgentMessageRow {
type IxCols = SquareHoleAgentMessageRowIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
SquareHoleAgentMessageRowIxCols {
message_id: __sdk::__query_builder::IxCol::new(table_name, "message_id"),
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
}
}
}
impl __sdk::__query_builder::CanBeLookupTable for SquareHoleAgentMessageRow {}

View File

@@ -0,0 +1,19 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleAgentMessageSubmitInput {
pub session_id: String,
pub owner_user_id: String,
pub user_message_id: String,
pub user_message_text: String,
pub submitted_at_micros: i64,
}
impl __sdk::InModule for SquareHoleAgentMessageSubmitInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,165 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::square_hole_agent_message_row_type::SquareHoleAgentMessageRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `square_hole_agent_message`.
///
/// Obtain a handle from the [`SquareHoleAgentMessageTableAccess::square_hole_agent_message`] method on [`super::RemoteTables`],
/// like `ctx.db.square_hole_agent_message()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.square_hole_agent_message().on_insert(...)`.
pub struct SquareHoleAgentMessageTableHandle<'ctx> {
imp: __sdk::TableHandle<SquareHoleAgentMessageRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `square_hole_agent_message`.
///
/// Implemented for [`super::RemoteTables`].
pub trait SquareHoleAgentMessageTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`SquareHoleAgentMessageTableHandle`], which mediates access to the table `square_hole_agent_message`.
fn square_hole_agent_message(&self) -> SquareHoleAgentMessageTableHandle<'_>;
}
impl SquareHoleAgentMessageTableAccess for super::RemoteTables {
fn square_hole_agent_message(&self) -> SquareHoleAgentMessageTableHandle<'_> {
SquareHoleAgentMessageTableHandle {
imp: self
.imp
.get_table::<SquareHoleAgentMessageRow>("square_hole_agent_message"),
ctx: std::marker::PhantomData,
}
}
}
pub struct SquareHoleAgentMessageInsertCallbackId(__sdk::CallbackId);
pub struct SquareHoleAgentMessageDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for SquareHoleAgentMessageTableHandle<'ctx> {
type Row = SquareHoleAgentMessageRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = SquareHoleAgentMessageRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = SquareHoleAgentMessageInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> SquareHoleAgentMessageInsertCallbackId {
SquareHoleAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: SquareHoleAgentMessageInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = SquareHoleAgentMessageDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> SquareHoleAgentMessageDeleteCallbackId {
SquareHoleAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: SquareHoleAgentMessageDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct SquareHoleAgentMessageUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for SquareHoleAgentMessageTableHandle<'ctx> {
type UpdateCallbackId = SquareHoleAgentMessageUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> SquareHoleAgentMessageUpdateCallbackId {
SquareHoleAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: SquareHoleAgentMessageUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `message_id` unique index on the table `square_hole_agent_message`,
/// which allows point queries on the field of the same name
/// via the [`SquareHoleAgentMessageMessageIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.square_hole_agent_message().message_id().find(...)`.
pub struct SquareHoleAgentMessageMessageIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<SquareHoleAgentMessageRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> SquareHoleAgentMessageTableHandle<'ctx> {
/// Get a handle on the `message_id` unique index on the table `square_hole_agent_message`.
pub fn message_id(&self) -> SquareHoleAgentMessageMessageIdUnique<'ctx> {
SquareHoleAgentMessageMessageIdUnique {
imp: self.imp.get_unique_constraint::<String>("message_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> SquareHoleAgentMessageMessageIdUnique<'ctx> {
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<SquareHoleAgentMessageRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<SquareHoleAgentMessageRow>("square_hole_agent_message");
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<SquareHoleAgentMessageRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<SquareHoleAgentMessageRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `SquareHoleAgentMessageRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait square_hole_agent_messageQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `SquareHoleAgentMessageRow`.
fn square_hole_agent_message(&self)
-> __sdk::__query_builder::Table<SquareHoleAgentMessageRow>;
}
impl square_hole_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
fn square_hole_agent_message(
&self,
) -> __sdk::__query_builder::Table<SquareHoleAgentMessageRow> {
__sdk::__query_builder::Table::new("square_hole_agent_message")
}
}

View File

@@ -0,0 +1,21 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleAgentSessionCreateInput {
pub session_id: String,
pub owner_user_id: String,
pub seed_text: String,
pub welcome_message_id: String,
pub welcome_message_text: String,
pub config_json: Option<String>,
pub created_at_micros: i64,
}
impl __sdk::InModule for SquareHoleAgentSessionCreateInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,16 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleAgentSessionGetInput {
pub session_id: String,
pub owner_user_id: String,
}
impl __sdk::InModule for SquareHoleAgentSessionGetInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,17 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleAgentSessionProcedureResult {
pub ok: bool,
pub session_json: Option<String>,
pub error_message: Option<String>,
}
impl __sdk::InModule for SquareHoleAgentSessionProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,90 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleAgentSessionRow {
pub session_id: String,
pub owner_user_id: String,
pub seed_text: String,
pub current_turn: u32,
pub progress_percent: u32,
pub stage: String,
pub config_json: String,
pub draft_json: String,
pub last_assistant_reply: String,
pub published_profile_id: String,
pub created_at: __sdk::Timestamp,
pub updated_at: __sdk::Timestamp,
}
impl __sdk::InModule for SquareHoleAgentSessionRow {
type Module = super::RemoteModule;
}
/// Column accessor struct for the table `SquareHoleAgentSessionRow`.
///
/// Provides typed access to columns for query building.
pub struct SquareHoleAgentSessionRowCols {
pub session_id: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, String>,
pub owner_user_id: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, String>,
pub seed_text: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, String>,
pub current_turn: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, u32>,
pub progress_percent: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, u32>,
pub stage: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, String>,
pub config_json: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, String>,
pub draft_json: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, String>,
pub last_assistant_reply: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, String>,
pub published_profile_id: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, String>,
pub created_at: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, __sdk::Timestamp>,
pub updated_at: __sdk::__query_builder::Col<SquareHoleAgentSessionRow, __sdk::Timestamp>,
}
impl __sdk::__query_builder::HasCols for SquareHoleAgentSessionRow {
type Cols = SquareHoleAgentSessionRowCols;
fn cols(table_name: &'static str) -> Self::Cols {
SquareHoleAgentSessionRowCols {
session_id: __sdk::__query_builder::Col::new(table_name, "session_id"),
owner_user_id: __sdk::__query_builder::Col::new(table_name, "owner_user_id"),
seed_text: __sdk::__query_builder::Col::new(table_name, "seed_text"),
current_turn: __sdk::__query_builder::Col::new(table_name, "current_turn"),
progress_percent: __sdk::__query_builder::Col::new(table_name, "progress_percent"),
stage: __sdk::__query_builder::Col::new(table_name, "stage"),
config_json: __sdk::__query_builder::Col::new(table_name, "config_json"),
draft_json: __sdk::__query_builder::Col::new(table_name, "draft_json"),
last_assistant_reply: __sdk::__query_builder::Col::new(
table_name,
"last_assistant_reply",
),
published_profile_id: __sdk::__query_builder::Col::new(
table_name,
"published_profile_id",
),
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
}
}
}
/// Indexed column accessor struct for the table `SquareHoleAgentSessionRow`.
///
/// Provides typed access to indexed columns for query building.
pub struct SquareHoleAgentSessionRowIxCols {
pub owner_user_id: __sdk::__query_builder::IxCol<SquareHoleAgentSessionRow, String>,
pub session_id: __sdk::__query_builder::IxCol<SquareHoleAgentSessionRow, String>,
}
impl __sdk::__query_builder::HasIxCols for SquareHoleAgentSessionRow {
type IxCols = SquareHoleAgentSessionRowIxCols;
fn ix_cols(table_name: &'static str) -> Self::IxCols {
SquareHoleAgentSessionRowIxCols {
owner_user_id: __sdk::__query_builder::IxCol::new(table_name, "owner_user_id"),
session_id: __sdk::__query_builder::IxCol::new(table_name, "session_id"),
}
}
}
impl __sdk::__query_builder::CanBeLookupTable for SquareHoleAgentSessionRow {}

View File

@@ -0,0 +1,165 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use super::square_hole_agent_session_row_type::SquareHoleAgentSessionRow;
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
/// Table handle for the table `square_hole_agent_session`.
///
/// Obtain a handle from the [`SquareHoleAgentSessionTableAccess::square_hole_agent_session`] method on [`super::RemoteTables`],
/// like `ctx.db.square_hole_agent_session()`.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.square_hole_agent_session().on_insert(...)`.
pub struct SquareHoleAgentSessionTableHandle<'ctx> {
imp: __sdk::TableHandle<SquareHoleAgentSessionRow>,
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
#[allow(non_camel_case_types)]
/// Extension trait for access to the table `square_hole_agent_session`.
///
/// Implemented for [`super::RemoteTables`].
pub trait SquareHoleAgentSessionTableAccess {
#[allow(non_snake_case)]
/// Obtain a [`SquareHoleAgentSessionTableHandle`], which mediates access to the table `square_hole_agent_session`.
fn square_hole_agent_session(&self) -> SquareHoleAgentSessionTableHandle<'_>;
}
impl SquareHoleAgentSessionTableAccess for super::RemoteTables {
fn square_hole_agent_session(&self) -> SquareHoleAgentSessionTableHandle<'_> {
SquareHoleAgentSessionTableHandle {
imp: self
.imp
.get_table::<SquareHoleAgentSessionRow>("square_hole_agent_session"),
ctx: std::marker::PhantomData,
}
}
}
pub struct SquareHoleAgentSessionInsertCallbackId(__sdk::CallbackId);
pub struct SquareHoleAgentSessionDeleteCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::Table for SquareHoleAgentSessionTableHandle<'ctx> {
type Row = SquareHoleAgentSessionRow;
type EventContext = super::EventContext;
fn count(&self) -> u64 {
self.imp.count()
}
fn iter(&self) -> impl Iterator<Item = SquareHoleAgentSessionRow> + '_ {
self.imp.iter()
}
type InsertCallbackId = SquareHoleAgentSessionInsertCallbackId;
fn on_insert(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> SquareHoleAgentSessionInsertCallbackId {
SquareHoleAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
}
fn remove_on_insert(&self, callback: SquareHoleAgentSessionInsertCallbackId) {
self.imp.remove_on_insert(callback.0)
}
type DeleteCallbackId = SquareHoleAgentSessionDeleteCallbackId;
fn on_delete(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
) -> SquareHoleAgentSessionDeleteCallbackId {
SquareHoleAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
}
fn remove_on_delete(&self, callback: SquareHoleAgentSessionDeleteCallbackId) {
self.imp.remove_on_delete(callback.0)
}
}
pub struct SquareHoleAgentSessionUpdateCallbackId(__sdk::CallbackId);
impl<'ctx> __sdk::TableWithPrimaryKey for SquareHoleAgentSessionTableHandle<'ctx> {
type UpdateCallbackId = SquareHoleAgentSessionUpdateCallbackId;
fn on_update(
&self,
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
) -> SquareHoleAgentSessionUpdateCallbackId {
SquareHoleAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
}
fn remove_on_update(&self, callback: SquareHoleAgentSessionUpdateCallbackId) {
self.imp.remove_on_update(callback.0)
}
}
/// Access to the `session_id` unique index on the table `square_hole_agent_session`,
/// which allows point queries on the field of the same name
/// via the [`SquareHoleAgentSessionSessionIdUnique::find`] method.
///
/// Users are encouraged not to explicitly reference this type,
/// but to directly chain method calls,
/// like `ctx.db.square_hole_agent_session().session_id().find(...)`.
pub struct SquareHoleAgentSessionSessionIdUnique<'ctx> {
imp: __sdk::UniqueConstraintHandle<SquareHoleAgentSessionRow, String>,
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
}
impl<'ctx> SquareHoleAgentSessionTableHandle<'ctx> {
/// Get a handle on the `session_id` unique index on the table `square_hole_agent_session`.
pub fn session_id(&self) -> SquareHoleAgentSessionSessionIdUnique<'ctx> {
SquareHoleAgentSessionSessionIdUnique {
imp: self.imp.get_unique_constraint::<String>("session_id"),
phantom: std::marker::PhantomData,
}
}
}
impl<'ctx> SquareHoleAgentSessionSessionIdUnique<'ctx> {
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
/// if such a row is present in the client cache.
pub fn find(&self, col_val: &String) -> Option<SquareHoleAgentSessionRow> {
self.imp.find(col_val)
}
}
#[doc(hidden)]
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
let _table =
client_cache.get_or_make_table::<SquareHoleAgentSessionRow>("square_hole_agent_session");
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
}
#[doc(hidden)]
pub(super) fn parse_table_update(
raw_updates: __ws::v2::TableUpdate,
) -> __sdk::Result<__sdk::TableUpdate<SquareHoleAgentSessionRow>> {
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
__sdk::InternalError::failed_parse("TableUpdate<SquareHoleAgentSessionRow>", "TableUpdate")
.with_cause(e)
.into()
})
}
#[allow(non_camel_case_types)]
/// Extension trait for query builder access to the table `SquareHoleAgentSessionRow`.
///
/// Implemented for [`__sdk::QueryTableAccessor`].
pub trait square_hole_agent_sessionQueryTableAccess {
#[allow(non_snake_case)]
/// Get a query builder for the table `SquareHoleAgentSessionRow`.
fn square_hole_agent_session(&self)
-> __sdk::__query_builder::Table<SquareHoleAgentSessionRow>;
}
impl square_hole_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor {
fn square_hole_agent_session(
&self,
) -> __sdk::__query_builder::Table<SquareHoleAgentSessionRow> {
__sdk::__query_builder::Table::new("square_hole_agent_session")
}
}

View File

@@ -0,0 +1,23 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleDraftCompileInput {
pub session_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub author_display_name: String,
pub game_name: Option<String>,
pub summary_text: Option<String>,
pub tags_json: Option<String>,
pub cover_image_src: Option<String>,
pub compiled_at_micros: i64,
}
impl __sdk::InModule for SquareHoleDraftCompileInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,20 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleDropShapeProcedureResult {
pub ok: bool,
pub status: String,
pub run_json: Option<String>,
pub feedback_json: Option<String>,
pub failure_reason: Option<String>,
pub error_message: Option<String>,
}
impl __sdk::InModule for SquareHoleDropShapeProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,20 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleRunDropInput {
pub run_id: String,
pub owner_user_id: String,
pub hole_id: String,
pub client_snapshot_version: u64,
pub client_event_id: String,
pub dropped_at_ms: i64,
}
impl __sdk::InModule for SquareHoleRunDropInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,16 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleRunGetInput {
pub run_id: String,
pub owner_user_id: String,
}
impl __sdk::InModule for SquareHoleRunGetInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,17 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleRunProcedureResult {
pub ok: bool,
pub run_json: Option<String>,
pub error_message: Option<String>,
}
impl __sdk::InModule for SquareHoleRunProcedureResult {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,18 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleRunRestartInput {
pub source_run_id: String,
pub next_run_id: String,
pub owner_user_id: String,
pub restarted_at_ms: i64,
}
impl __sdk::InModule for SquareHoleRunRestartInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,18 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleRunStartInput {
pub run_id: String,
pub owner_user_id: String,
pub profile_id: String,
pub started_at_ms: i64,
}
impl __sdk::InModule for SquareHoleRunStartInput {
type Module = super::RemoteModule;
}

View File

@@ -0,0 +1,17 @@
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
#![allow(unused, clippy::all)]
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
#[sats(crate = __lib)]
pub struct SquareHoleRunStopInput {
pub run_id: String,
pub owner_user_id: String,
pub stopped_at_ms: i64,
}
impl __sdk::InModule for SquareHoleRunStopInput {
type Module = super::RemoteModule;
}

Some files were not shown because too many files have changed in this diff Show More