1
This commit is contained in:
@@ -23,7 +23,7 @@ use crate::{
|
||||
},
|
||||
assets::{
|
||||
bind_asset_object_to_entity, confirm_asset_object, create_direct_upload_ticket,
|
||||
create_sts_upload_credentials, get_asset_read_url,
|
||||
create_sts_upload_credentials, get_asset_history, get_asset_read_url,
|
||||
},
|
||||
auth::{
|
||||
attach_refresh_session_token, inspect_auth_claims, inspect_refresh_session_cookie,
|
||||
@@ -394,6 +394,13 @@ pub fn build_router(state: AppState) -> Router {
|
||||
get(get_character_workflow_cache),
|
||||
)
|
||||
.route("/api/assets/read-url", get(get_asset_read_url))
|
||||
.route(
|
||||
"/api/assets/history",
|
||||
get(get_asset_history).route_layer(middleware::from_fn_with_state(
|
||||
state.clone(),
|
||||
require_bearer_auth,
|
||||
)),
|
||||
)
|
||||
.route(
|
||||
"/api/runtime/settings",
|
||||
get(get_runtime_settings)
|
||||
|
||||
@@ -14,10 +14,11 @@ use platform_oss::{
|
||||
};
|
||||
use serde_json::{Value, json};
|
||||
use shared_contracts::assets::{
|
||||
AssetBindingPayload, AssetObjectPayload, AssetReadUrlPayload, BindAssetObjectRequest,
|
||||
BindAssetObjectResponse, ConfirmAssetObjectAccessPolicy, ConfirmAssetObjectRequest,
|
||||
ConfirmAssetObjectResponse, CreateDirectUploadTicketRequest, CreateDirectUploadTicketResponse,
|
||||
DirectUploadTicketPayload, GetAssetReadUrlResponse, GetReadUrlQuery,
|
||||
AssetBindingPayload, AssetHistoryEntryPayload, AssetHistoryListResponse, AssetHistoryQuery,
|
||||
AssetObjectPayload, AssetReadUrlPayload, BindAssetObjectRequest, BindAssetObjectResponse,
|
||||
ConfirmAssetObjectAccessPolicy, ConfirmAssetObjectRequest, ConfirmAssetObjectResponse,
|
||||
CreateDirectUploadTicketRequest, CreateDirectUploadTicketResponse, DirectUploadTicketPayload,
|
||||
GetAssetReadUrlResponse, GetReadUrlQuery,
|
||||
};
|
||||
use spacetime_client::SpacetimeClientError;
|
||||
|
||||
@@ -111,6 +112,51 @@ pub async fn get_asset_read_url(
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn get_asset_history(
|
||||
State(state): State<AppState>,
|
||||
Extension(request_context): Extension<RequestContext>,
|
||||
Query(query): Query<AssetHistoryQuery>,
|
||||
) -> Result<Json<Value>, AppError> {
|
||||
let asset_kind = query.kind.trim().to_string();
|
||||
if asset_kind != "character_visual" && asset_kind != "scene_image" {
|
||||
return Err(
|
||||
AppError::from_status(StatusCode::BAD_REQUEST).with_details(json!({
|
||||
"field": "kind",
|
||||
"message": "历史素材类型只支持 character_visual 或 scene_image",
|
||||
})),
|
||||
);
|
||||
}
|
||||
|
||||
let entries = state
|
||||
.spacetime_client()
|
||||
.list_asset_history(module_assets::AssetHistoryListInput {
|
||||
asset_kind,
|
||||
limit: query.limit.unwrap_or(120).clamp(1, 120),
|
||||
})
|
||||
.await
|
||||
.map_err(map_confirm_asset_object_error)?;
|
||||
|
||||
Ok(json_success_body(
|
||||
Some(&request_context),
|
||||
AssetHistoryListResponse {
|
||||
assets: entries
|
||||
.into_iter()
|
||||
.map(|entry| AssetHistoryEntryPayload {
|
||||
owner_label: format_asset_owner_label(entry.owner_user_id.as_deref()),
|
||||
asset_object_id: entry.asset_object_id,
|
||||
asset_kind: entry.asset_kind,
|
||||
image_src: entry.image_src,
|
||||
owner_user_id: entry.owner_user_id,
|
||||
profile_id: entry.profile_id,
|
||||
entity_id: entry.entity_id,
|
||||
created_at: entry.created_at,
|
||||
updated_at: entry.updated_at,
|
||||
})
|
||||
.collect(),
|
||||
},
|
||||
))
|
||||
}
|
||||
|
||||
pub async fn create_sts_upload_credentials(
|
||||
Extension(_request_context): Extension<RequestContext>,
|
||||
) -> Result<Json<Value>, AppError> {
|
||||
@@ -232,6 +278,16 @@ fn resolve_object_key_from_query(query: &GetReadUrlQuery) -> Option<String> {
|
||||
.map(|value| value.trim_start_matches('/').to_string())
|
||||
}
|
||||
|
||||
fn format_asset_owner_label(owner_user_id: Option<&str>) -> String {
|
||||
let Some(owner_user_id) = owner_user_id
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
else {
|
||||
return "未记录账号".to_string();
|
||||
};
|
||||
format!("账号 {owner_user_id}")
|
||||
}
|
||||
|
||||
async fn build_confirm_asset_object_upsert_input(
|
||||
oss_client: &platform_oss::OssClient,
|
||||
payload: ConfirmAssetObjectRequest,
|
||||
|
||||
@@ -189,7 +189,9 @@ fn extract_bearer_token(headers: &HeaderMap) -> Result<String, AppError> {
|
||||
|
||||
fn allows_internal_forwarded_auth(path: &str) -> bool {
|
||||
// Node 代理已经完成平台账号 JWT 校验,Rust 运行时只信任这些明确的内部转发路径。
|
||||
path.starts_with("/api/runtime/big-fish/") || path.starts_with("/api/runtime/puzzle/")
|
||||
path.starts_with("/api/runtime/big-fish/")
|
||||
|| path.starts_with("/api/runtime/chat/")
|
||||
|| path.starts_with("/api/runtime/puzzle/")
|
||||
}
|
||||
|
||||
fn try_build_internal_forwarded_claims(
|
||||
@@ -282,6 +284,9 @@ mod tests {
|
||||
assert!(allows_internal_forwarded_auth(
|
||||
"/api/runtime/big-fish/sessions"
|
||||
));
|
||||
assert!(allows_internal_forwarded_auth(
|
||||
"/api/runtime/chat/npc/turn/stream"
|
||||
));
|
||||
assert!(allows_internal_forwarded_auth("/api/runtime/puzzle/works"));
|
||||
assert!(!allows_internal_forwarded_auth("/api/auth/me"));
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ pub async fn generate_custom_world_foundation_draft(
|
||||
.await?;
|
||||
framework["storyNpcs"] = JsonValue::Array(story_outlines.clone());
|
||||
|
||||
let landmarks = generate_foundation_landmark_seed_entries(
|
||||
let generated_scene_entries = generate_foundation_landmark_seed_entries(
|
||||
llm_client,
|
||||
&framework,
|
||||
FOUNDATION_DRAFT_LANDMARK_COUNT,
|
||||
@@ -83,7 +83,7 @@ pub async fn generate_custom_world_foundation_draft(
|
||||
&mut on_progress,
|
||||
)
|
||||
.await?;
|
||||
framework["landmarks"] = JsonValue::Array(landmarks.clone());
|
||||
framework["landmarks"] = JsonValue::Array(generated_scene_entries.clone());
|
||||
|
||||
let playable_narrative = expand_foundation_role_entries(
|
||||
llm_client,
|
||||
@@ -137,7 +137,7 @@ pub async fn generate_custom_world_foundation_draft(
|
||||
framework,
|
||||
playable_detailed,
|
||||
story_detailed,
|
||||
landmarks,
|
||||
generated_scene_entries,
|
||||
session,
|
||||
setting_text.as_str(),
|
||||
);
|
||||
@@ -304,6 +304,7 @@ async fn generate_foundation_landmark_seed_entries(
|
||||
}
|
||||
let batch_count = (total_count - merged_entries.len()).min(FOUNDATION_LANDMARK_BATCH_SIZE);
|
||||
let forbidden_names = names_from_entries(&merged_entries);
|
||||
let is_opening_batch = batch_index == 0 && merged_entries.is_empty();
|
||||
emit_foundation_draft_progress(
|
||||
on_progress,
|
||||
"生成关键场景",
|
||||
@@ -319,13 +320,19 @@ async fn generate_foundation_landmark_seed_entries(
|
||||
);
|
||||
let raw = request_foundation_json_stage(
|
||||
llm_client,
|
||||
build_custom_world_landmark_seed_batch_prompt(framework, batch_count, &forbidden_names),
|
||||
build_custom_world_landmark_seed_batch_prompt(
|
||||
framework,
|
||||
batch_count,
|
||||
&forbidden_names,
|
||||
is_opening_batch,
|
||||
),
|
||||
format!("agent-foundation-landmark-seed-batch-{}", batch_index + 1).as_str(),
|
||||
|response_text| {
|
||||
build_custom_world_landmark_seed_batch_json_repair_prompt(
|
||||
response_text,
|
||||
batch_count,
|
||||
&forbidden_names,
|
||||
is_opening_batch,
|
||||
)
|
||||
},
|
||||
format!(
|
||||
@@ -714,7 +721,7 @@ fn build_foundation_draft_profile_from_framework(
|
||||
framework: JsonValue,
|
||||
playable_detailed: Vec<JsonValue>,
|
||||
story_detailed: Vec<JsonValue>,
|
||||
landmarks: Vec<JsonValue>,
|
||||
generated_scene_entries: Vec<JsonValue>,
|
||||
session: &CustomWorldAgentSessionRecord,
|
||||
setting_text: &str,
|
||||
) -> JsonMap<String, JsonValue> {
|
||||
@@ -793,9 +800,14 @@ fn build_foundation_draft_profile_from_framework(
|
||||
setting_text,
|
||||
),
|
||||
);
|
||||
let camp = framework.get("camp").cloned().unwrap_or_else(
|
||||
let fallback_camp = framework.get("camp").cloned().unwrap_or_else(
|
||||
|| json!({ "name": "开局归处", "description": "玩家进入世界后的第一处落脚点。" }),
|
||||
);
|
||||
let playable_detailed = assign_role_ids(playable_detailed, "playable-npc");
|
||||
let story_detailed = assign_role_ids(story_detailed, "story-npc");
|
||||
let scene_role_refs = collect_scene_role_refs(&story_detailed);
|
||||
let (camp, landmarks) =
|
||||
split_generated_scenes_into_camp_and_landmarks(fallback_camp, generated_scene_entries);
|
||||
object.insert("camp".to_string(), camp.clone());
|
||||
object.insert(
|
||||
"playableNpcs".to_string(),
|
||||
@@ -803,7 +815,7 @@ fn build_foundation_draft_profile_from_framework(
|
||||
);
|
||||
object.insert("storyNpcs".to_string(), JsonValue::Array(story_detailed));
|
||||
let scene_chapter_blueprints =
|
||||
build_scene_chapter_blueprints_from_camp_and_landmarks(&camp, &landmarks);
|
||||
build_scene_chapter_blueprints_from_camp_and_landmarks(&camp, &landmarks, &scene_role_refs);
|
||||
object.insert("landmarks".to_string(), JsonValue::Array(landmarks));
|
||||
object.insert("chapters".to_string(), JsonValue::Array(Vec::new()));
|
||||
object.insert(
|
||||
@@ -1095,9 +1107,50 @@ fn stable_ascii_slug(value: &str) -> String {
|
||||
format!("{hash:08x}")
|
||||
}
|
||||
|
||||
fn split_generated_scenes_into_camp_and_landmarks(
|
||||
fallback_camp: JsonValue,
|
||||
generated_scene_entries: Vec<JsonValue>,
|
||||
) -> (JsonValue, Vec<JsonValue>) {
|
||||
let mut entries = generated_scene_entries.into_iter();
|
||||
let opening_scene = entries.next().unwrap_or(fallback_camp);
|
||||
let camp = normalize_generated_opening_scene(opening_scene);
|
||||
let landmarks = entries.collect::<Vec<_>>();
|
||||
(camp, landmarks)
|
||||
}
|
||||
|
||||
fn normalize_generated_opening_scene(scene: JsonValue) -> JsonValue {
|
||||
let mut object = scene.as_object().cloned().unwrap_or_default();
|
||||
let name = object
|
||||
.get("name")
|
||||
.and_then(JsonValue::as_str)
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
.unwrap_or("开局归处")
|
||||
.to_string();
|
||||
let description = object
|
||||
.get("description")
|
||||
.and_then(JsonValue::as_str)
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
.unwrap_or("玩家进入世界后的第一处落脚点。")
|
||||
.to_string();
|
||||
object.insert("id".to_string(), JsonValue::String("camp-1".to_string()));
|
||||
object.insert("kind".to_string(), JsonValue::String("camp".to_string()));
|
||||
object.insert("name".to_string(), JsonValue::String(name));
|
||||
object.insert("description".to_string(), JsonValue::String(description));
|
||||
JsonValue::Object(object)
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
struct SceneRoleRef {
|
||||
id: String,
|
||||
name: String,
|
||||
}
|
||||
|
||||
fn build_scene_chapter_blueprints_from_camp_and_landmarks(
|
||||
camp: &JsonValue,
|
||||
landmarks: &[JsonValue],
|
||||
scene_role_refs: &[SceneRoleRef],
|
||||
) -> Vec<JsonValue> {
|
||||
let mut blueprints = Vec::with_capacity(landmarks.len() + 1);
|
||||
blueprints.push(build_scene_chapter_blueprint_from_scene(
|
||||
@@ -1105,12 +1158,19 @@ fn build_scene_chapter_blueprints_from_camp_and_landmarks(
|
||||
0,
|
||||
"camp",
|
||||
"开局归处",
|
||||
scene_role_refs,
|
||||
));
|
||||
blueprints.extend(build_scene_chapter_blueprints_from_landmarks(
|
||||
landmarks,
|
||||
scene_role_refs,
|
||||
));
|
||||
blueprints.extend(build_scene_chapter_blueprints_from_landmarks(landmarks));
|
||||
blueprints
|
||||
}
|
||||
|
||||
fn build_scene_chapter_blueprints_from_landmarks(landmarks: &[JsonValue]) -> Vec<JsonValue> {
|
||||
fn build_scene_chapter_blueprints_from_landmarks(
|
||||
landmarks: &[JsonValue],
|
||||
scene_role_refs: &[SceneRoleRef],
|
||||
) -> Vec<JsonValue> {
|
||||
// 幕背景描述必须来自关键场景生成步骤,不能在草稿合成阶段再用规则句拼接。
|
||||
landmarks
|
||||
.iter()
|
||||
@@ -1121,6 +1181,7 @@ fn build_scene_chapter_blueprints_from_landmarks(landmarks: &[JsonValue]) -> Vec
|
||||
chapter_index,
|
||||
"saved-landmark",
|
||||
"关键场景",
|
||||
scene_role_refs,
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
@@ -1131,6 +1192,7 @@ fn build_scene_chapter_blueprint_from_scene(
|
||||
chapter_index: usize,
|
||||
id_prefix: &str,
|
||||
fallback_name_prefix: &str,
|
||||
scene_role_refs: &[SceneRoleRef],
|
||||
) -> JsonValue {
|
||||
let scene_name = json_text(scene, "name")
|
||||
.unwrap_or_else(|| format!("{}{}", fallback_name_prefix, chapter_index + 1));
|
||||
@@ -1144,6 +1206,13 @@ fn build_scene_chapter_blueprint_from_scene(
|
||||
let act_npc_names = json_string_array(scene, "actNPCNames")
|
||||
.or_else(|| json_string_array(scene, "sceneNpcNames"))
|
||||
.unwrap_or_default();
|
||||
let resolved_act_roles = resolve_scene_act_roles(&act_npc_names, scene_role_refs);
|
||||
let scene_npc_ids = dedupe_text_values(
|
||||
&resolved_act_roles
|
||||
.iter()
|
||||
.map(|role| role.id.clone())
|
||||
.collect::<Vec<_>>(),
|
||||
);
|
||||
|
||||
json!({
|
||||
"id": scene_id.clone(),
|
||||
@@ -1152,13 +1221,14 @@ fn build_scene_chapter_blueprint_from_scene(
|
||||
"summary": summary,
|
||||
"sceneTaskDescription": scene_task_description,
|
||||
"linkedLandmarkIds": [scene_id.clone()],
|
||||
"sceneNpcIds": scene_npc_ids,
|
||||
"acts": (0..3)
|
||||
.map(|act_index| build_scene_act_blueprint_from_landmark(
|
||||
&scene_id,
|
||||
&summary,
|
||||
&act_prompts,
|
||||
&act_events,
|
||||
&act_npc_names,
|
||||
&resolved_act_roles,
|
||||
act_index,
|
||||
))
|
||||
.collect::<Vec<_>>(),
|
||||
@@ -1170,7 +1240,7 @@ fn build_scene_act_blueprint_from_landmark(
|
||||
scene_summary: &str,
|
||||
act_prompts: &[String],
|
||||
act_events: &[String],
|
||||
act_npc_names: &[String],
|
||||
act_roles: &[SceneRoleRef],
|
||||
act_index: usize,
|
||||
) -> JsonValue {
|
||||
let act_title = if act_index == 0 {
|
||||
@@ -1184,10 +1254,17 @@ fn build_scene_act_blueprint_from_landmark(
|
||||
.map(str::trim)
|
||||
.filter(|value| !value.is_empty())
|
||||
.map(ToOwned::to_owned);
|
||||
let opposite_npc_id = act_npc_names
|
||||
let opposite_role = act_roles
|
||||
.get(act_index)
|
||||
.or_else(|| act_npc_names.first())
|
||||
.cloned()
|
||||
.or_else(|| act_roles.first())
|
||||
.cloned();
|
||||
let opposite_npc_id = opposite_role
|
||||
.as_ref()
|
||||
.map(|role| role.id.clone())
|
||||
.unwrap_or_default();
|
||||
let opposite_role_name = opposite_role
|
||||
.as_ref()
|
||||
.map(|role| role.name.clone())
|
||||
.unwrap_or_default();
|
||||
let event_description = act_events
|
||||
.get(act_index)
|
||||
@@ -1196,12 +1273,16 @@ fn build_scene_act_blueprint_from_landmark(
|
||||
.filter(|value| !value.is_empty())
|
||||
.map(ToOwned::to_owned)
|
||||
.unwrap_or_else(|| {
|
||||
build_default_act_event_description(scene_summary, opposite_npc_id.as_str(), act_index)
|
||||
build_default_act_event_description(
|
||||
scene_summary,
|
||||
opposite_role_name.as_str(),
|
||||
act_index,
|
||||
)
|
||||
});
|
||||
let background_prompt = prompt.unwrap_or_else(|| {
|
||||
build_default_act_background_prompt(
|
||||
scene_summary,
|
||||
opposite_npc_id.as_str(),
|
||||
opposite_role_name.as_str(),
|
||||
event_description.as_str(),
|
||||
act_index,
|
||||
)
|
||||
@@ -1212,21 +1293,23 @@ fn build_scene_act_blueprint_from_landmark(
|
||||
"title": act_title,
|
||||
"summary": scene_summary,
|
||||
"backgroundPromptText": background_prompt,
|
||||
"encounterNpcIds": build_act_encounter_npc_ids(act_npc_names, opposite_npc_id.as_str()),
|
||||
"encounterNpcIds": build_act_encounter_npc_ids(act_roles, opposite_npc_id.as_str()),
|
||||
"primaryNpcId": opposite_npc_id,
|
||||
"oppositeNpcId": opposite_npc_id,
|
||||
"primaryRoleName": opposite_role_name,
|
||||
"oppositeRoleName": opposite_role_name,
|
||||
"eventDescription": event_description,
|
||||
})
|
||||
}
|
||||
|
||||
fn build_act_encounter_npc_ids(act_npc_names: &[String], primary_npc_id: &str) -> Vec<String> {
|
||||
let mut names = Vec::with_capacity(act_npc_names.len().max(1));
|
||||
fn build_act_encounter_npc_ids(act_roles: &[SceneRoleRef], primary_npc_id: &str) -> Vec<String> {
|
||||
let mut names = Vec::with_capacity(act_roles.len().max(1));
|
||||
let primary = primary_npc_id.trim();
|
||||
if !primary.is_empty() {
|
||||
names.push(primary.to_string());
|
||||
}
|
||||
for name in act_npc_names {
|
||||
let normalized = name.trim();
|
||||
for role in act_roles {
|
||||
let normalized = role.id.trim();
|
||||
if normalized.is_empty() || names.iter().any(|item| item == normalized) {
|
||||
continue;
|
||||
}
|
||||
@@ -1235,6 +1318,98 @@ fn build_act_encounter_npc_ids(act_npc_names: &[String], primary_npc_id: &str) -
|
||||
names
|
||||
}
|
||||
|
||||
fn assign_role_ids(entries: Vec<JsonValue>, id_prefix: &str) -> Vec<JsonValue> {
|
||||
entries
|
||||
.into_iter()
|
||||
.enumerate()
|
||||
.map(|(index, entry)| assign_role_id(entry, id_prefix, index))
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn assign_role_id(mut entry: JsonValue, id_prefix: &str, index: usize) -> JsonValue {
|
||||
let name = json_text(&entry, "name").unwrap_or_else(|| format!("角色{}", index + 1));
|
||||
let fallback_id = format!("{}-{}", id_prefix, stable_ascii_slug(name.as_str()));
|
||||
let Some(object) = entry.as_object_mut() else {
|
||||
return json!({
|
||||
"id": fallback_id,
|
||||
"name": name,
|
||||
});
|
||||
};
|
||||
if object
|
||||
.get("id")
|
||||
.and_then(JsonValue::as_str)
|
||||
.map(str::trim)
|
||||
.is_none_or(str::is_empty)
|
||||
{
|
||||
object.insert("id".to_string(), JsonValue::String(fallback_id));
|
||||
}
|
||||
entry
|
||||
}
|
||||
|
||||
fn collect_scene_role_refs(entries: &[JsonValue]) -> Vec<SceneRoleRef> {
|
||||
entries
|
||||
.iter()
|
||||
.filter_map(|entry| {
|
||||
let name = json_text(entry, "name")?;
|
||||
let id = json_text(entry, "id")?;
|
||||
Some(SceneRoleRef { id, name })
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn resolve_scene_act_roles(
|
||||
requested_role_names: &[String],
|
||||
scene_role_refs: &[SceneRoleRef],
|
||||
) -> Vec<SceneRoleRef> {
|
||||
let mut resolved = requested_role_names
|
||||
.iter()
|
||||
.filter_map(|name| resolve_scene_role_ref(name, scene_role_refs))
|
||||
.collect::<Vec<_>>();
|
||||
if resolved.is_empty() {
|
||||
resolved.extend(scene_role_refs.iter().take(3).cloned());
|
||||
}
|
||||
dedupe_scene_role_refs(resolved)
|
||||
}
|
||||
|
||||
fn resolve_scene_role_ref(
|
||||
name_or_id: &str,
|
||||
scene_role_refs: &[SceneRoleRef],
|
||||
) -> Option<SceneRoleRef> {
|
||||
let normalized = name_or_id.trim();
|
||||
if normalized.is_empty() {
|
||||
return None;
|
||||
}
|
||||
scene_role_refs
|
||||
.iter()
|
||||
.find(|role| role.name == normalized || role.id == normalized)
|
||||
.cloned()
|
||||
}
|
||||
|
||||
fn dedupe_scene_role_refs(entries: Vec<SceneRoleRef>) -> Vec<SceneRoleRef> {
|
||||
let mut seen = Vec::new();
|
||||
let mut result = Vec::new();
|
||||
for entry in entries {
|
||||
if entry.id.trim().is_empty() || seen.iter().any(|id| id == &entry.id) {
|
||||
continue;
|
||||
}
|
||||
seen.push(entry.id.clone());
|
||||
result.push(entry);
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
fn dedupe_text_values(values: &[String]) -> Vec<String> {
|
||||
let mut result = Vec::new();
|
||||
for value in values {
|
||||
let normalized = value.trim();
|
||||
if normalized.is_empty() || result.iter().any(|item| item == normalized) {
|
||||
continue;
|
||||
}
|
||||
result.push(normalized.to_string());
|
||||
}
|
||||
result
|
||||
}
|
||||
|
||||
fn build_default_scene_task_description(scene_name: &str, scene_summary: &str) -> String {
|
||||
if scene_summary.trim().is_empty() {
|
||||
return format!(
|
||||
@@ -1374,66 +1549,15 @@ fn normalize_framework_shape(framework: &mut JsonValue, setting_text: &str) {
|
||||
"description".to_string(),
|
||||
JsonValue::String(camp_description.clone()),
|
||||
);
|
||||
if !camp
|
||||
.get("sceneTaskDescription")
|
||||
.and_then(JsonValue::as_str)
|
||||
.map(str::trim)
|
||||
.is_some_and(|value| !value.is_empty())
|
||||
{
|
||||
camp.insert(
|
||||
"sceneTaskDescription".to_string(),
|
||||
JsonValue::String(build_default_scene_task_description(
|
||||
camp_name.as_str(),
|
||||
camp_description.as_str(),
|
||||
)),
|
||||
);
|
||||
}
|
||||
if !camp
|
||||
.get("actBackgroundPromptTexts")
|
||||
.and_then(JsonValue::as_array)
|
||||
.is_some_and(|items| items.len() == 3)
|
||||
{
|
||||
// 中文注释:开局场景也必须进入逐幕生图队列;模型漏字段时用 camp 信息生成可用的三幕画面描述。
|
||||
camp.insert(
|
||||
"actBackgroundPromptTexts".to_string(),
|
||||
JsonValue::Array(
|
||||
(0..3)
|
||||
.map(|index| {
|
||||
let event_description = build_default_act_event_description(
|
||||
camp_description.as_str(),
|
||||
"开局关键角色",
|
||||
index,
|
||||
);
|
||||
JsonValue::String(build_default_act_background_prompt(
|
||||
camp_description.as_str(),
|
||||
"开局关键角色",
|
||||
event_description.as_str(),
|
||||
index,
|
||||
))
|
||||
})
|
||||
.collect(),
|
||||
),
|
||||
);
|
||||
}
|
||||
if !camp
|
||||
.get("actEventDescriptions")
|
||||
.and_then(JsonValue::as_array)
|
||||
.is_some_and(|items| items.len() == 3)
|
||||
{
|
||||
camp.insert(
|
||||
"actEventDescriptions".to_string(),
|
||||
JsonValue::Array(
|
||||
(0..3)
|
||||
.map(|index| {
|
||||
JsonValue::String(build_default_act_event_description(
|
||||
camp_description.as_str(),
|
||||
"开局关键角色",
|
||||
index,
|
||||
))
|
||||
})
|
||||
.collect(),
|
||||
),
|
||||
);
|
||||
// 中文注释:framework 只保留开局归处占位;完整开局场景任务与三幕内容统一交给场景批生成阶段。
|
||||
for generated_scene_key in [
|
||||
"sceneTaskDescription",
|
||||
"actBackgroundPromptTexts",
|
||||
"actEventDescriptions",
|
||||
"actNPCNames",
|
||||
"sceneNpcNames",
|
||||
] {
|
||||
camp.remove(generated_scene_key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2024,7 +2148,18 @@ mod tests {
|
||||
"actNPCNames": ["灯童丁", "档吏庚", "灯童丁"]
|
||||
})];
|
||||
|
||||
let blueprints = build_scene_chapter_blueprints_from_landmarks(&landmarks);
|
||||
let scene_role_refs = vec![
|
||||
SceneRoleRef {
|
||||
id: "story-npc-lamp-child".to_string(),
|
||||
name: "灯童丁".to_string(),
|
||||
},
|
||||
SceneRoleRef {
|
||||
id: "story-npc-archive-clerk".to_string(),
|
||||
name: "档吏庚".to_string(),
|
||||
},
|
||||
];
|
||||
let blueprints =
|
||||
build_scene_chapter_blueprints_from_landmarks(&landmarks, &scene_role_refs);
|
||||
let acts = blueprints[0]
|
||||
.get("acts")
|
||||
.and_then(JsonValue::as_array)
|
||||
@@ -2043,10 +2178,23 @@ mod tests {
|
||||
"首次进入雾港码头时,查明黑潮船骨与灯童丁目击证词的关联。"
|
||||
))
|
||||
);
|
||||
assert_eq!(acts[0].get("oppositeNpcId"), Some(&json!("灯童丁")));
|
||||
assert_eq!(acts[0].get("primaryNpcId"), Some(&json!("灯童丁")));
|
||||
assert_eq!(acts[1].get("oppositeNpcId"), Some(&json!("档吏庚")));
|
||||
assert_eq!(acts[1].get("primaryNpcId"), Some(&json!("档吏庚")));
|
||||
assert_eq!(
|
||||
acts[0].get("oppositeNpcId"),
|
||||
Some(&json!("story-npc-lamp-child"))
|
||||
);
|
||||
assert_eq!(
|
||||
acts[0].get("primaryNpcId"),
|
||||
Some(&json!("story-npc-lamp-child"))
|
||||
);
|
||||
assert_eq!(acts[0].get("primaryRoleName"), Some(&json!("灯童丁")));
|
||||
assert_eq!(
|
||||
acts[1].get("oppositeNpcId"),
|
||||
Some(&json!("story-npc-archive-clerk"))
|
||||
);
|
||||
assert_eq!(
|
||||
acts[1].get("primaryNpcId"),
|
||||
Some(&json!("story-npc-archive-clerk"))
|
||||
);
|
||||
assert_eq!(
|
||||
acts[0].get("eventDescription"),
|
||||
Some(&json!(
|
||||
@@ -2081,7 +2229,16 @@ mod tests {
|
||||
"actBackgroundPromptTexts": ["斗技台晨雾未散,石阶旁少年们列队观望。", "木桩与兵器架围出训练区,族徽旗帜在风里猎猎。", "暮色压下斗技场,中央擂台留出一对一交锋空间。"]
|
||||
})];
|
||||
|
||||
let blueprints = build_scene_chapter_blueprints_from_camp_and_landmarks(camp, &landmarks);
|
||||
let scene_role_refs = vec![SceneRoleRef {
|
||||
id: "story-npc-mentor".to_string(),
|
||||
name: "药师长老".to_string(),
|
||||
}];
|
||||
|
||||
let blueprints = build_scene_chapter_blueprints_from_camp_and_landmarks(
|
||||
camp,
|
||||
&landmarks,
|
||||
&scene_role_refs,
|
||||
);
|
||||
let opening_chapter = &blueprints[0];
|
||||
let opening_acts = opening_chapter
|
||||
.get("acts")
|
||||
@@ -2106,6 +2263,18 @@ mod tests {
|
||||
.and_then(JsonValue::as_str)
|
||||
.is_some_and(|value| !value.trim().is_empty())
|
||||
}));
|
||||
assert!(opening_acts.iter().all(|act| {
|
||||
act.get("primaryNpcId")
|
||||
.and_then(JsonValue::as_str)
|
||||
.is_some_and(|value| value == "story-npc-mentor")
|
||||
}));
|
||||
assert!(opening_acts.iter().all(|act| {
|
||||
act.get("encounterNpcIds")
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|items| items.first())
|
||||
.and_then(JsonValue::as_str)
|
||||
.is_some_and(|value| value == "story-npc-mentor")
|
||||
}));
|
||||
assert_eq!(blueprints.len(), 2);
|
||||
}
|
||||
|
||||
@@ -2377,7 +2546,11 @@ mod tests {
|
||||
assert!(request_text.contains("attributeSchema"));
|
||||
assert!(request_text.contains("可扮演角色框架名单"));
|
||||
assert!(request_text.contains("场景角色框架名单"));
|
||||
assert!(request_text.contains("关键场景框架名单"));
|
||||
assert!(request_text.contains("场景框架名单"));
|
||||
assert!(request_text.contains("第一条场景必须是玩家进入世界时所在的开局场景"));
|
||||
assert!(request_text.contains("camp 只表示玩家开局时的落脚处占位"));
|
||||
assert!(!request_text.contains("camp.sceneTaskDescription"));
|
||||
assert!(!request_text.contains("camp.actBackgroundPromptTexts"));
|
||||
assert!(request_text.contains("actNPCNames"));
|
||||
assert!(!request_text.contains("\"sceneNpcNames\""));
|
||||
assert!(request_text.contains("connectedLandmarkNames"));
|
||||
@@ -2434,6 +2607,43 @@ mod tests {
|
||||
.and_then(JsonValue::as_str)
|
||||
.is_some()
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
.get("camp")
|
||||
.and_then(|entry| entry.get("name"))
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("旧灯塔")
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
.get("camp")
|
||||
.and_then(|entry| entry.get("id"))
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("camp-1")
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
.get("camp")
|
||||
.and_then(|entry| entry.get("sceneTaskDescription"))
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("首次进入旧灯塔时,追查被篡改的灯火航线记录。")
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
.get("landmarks")
|
||||
.and_then(JsonValue::as_array)
|
||||
.map(Vec::len),
|
||||
Some(1)
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
.get("landmarks")
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|entries| entries.first())
|
||||
.and_then(|entry| entry.get("name"))
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("沉船湾")
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
.get("sceneChapterBlueprints")
|
||||
@@ -2462,19 +2672,57 @@ mod tests {
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|items| items.first())
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("灯童丁")
|
||||
Some("船魂戊")
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
.get("sceneChapterBlueprints")
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|entries| entries.get(1))
|
||||
.and_then(|entries| entries.first())
|
||||
.and_then(|entry| entry.get("acts"))
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|acts| acts.get(1))
|
||||
.and_then(|act| act.get("primaryNpcId"))
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("档吏庚")
|
||||
Some("story-npc-0192680e")
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
.get("sceneChapterBlueprints")
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|entries| entries.first())
|
||||
.and_then(|entry| entry.get("acts"))
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|acts| acts.first())
|
||||
.and_then(|act| act.get("primaryNpcId"))
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("story-npc-01b5406b")
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
.get("sceneChapterBlueprints")
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|entries| entries.first())
|
||||
.and_then(|entry| entry.get("acts"))
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|acts| acts.first())
|
||||
.and_then(|act| act.get("encounterNpcIds"))
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|items| items.first())
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("story-npc-01b5406b")
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
.get("sceneChapterBlueprints")
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|entries| entries.first())
|
||||
.and_then(|entry| entry.get("acts"))
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|acts| acts.first())
|
||||
.and_then(|act| act.get("primaryRoleName"))
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("灯童丁")
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
@@ -2486,8 +2734,54 @@ mod tests {
|
||||
.and_then(|acts| acts.first())
|
||||
.and_then(|act| act.get("primaryNpcId"))
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("灯童丁")
|
||||
Some("story-npc-01fc0701")
|
||||
);
|
||||
assert_eq!(
|
||||
draft_profile
|
||||
.get("sceneChapterBlueprints")
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|entries| entries.get(1))
|
||||
.and_then(|entry| entry.get("acts"))
|
||||
.and_then(JsonValue::as_array)
|
||||
.and_then(|acts| acts.get(1))
|
||||
.and_then(|act| act.get("primaryNpcId"))
|
||||
.and_then(JsonValue::as_str),
|
||||
Some("story-npc-01acae6c")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn generated_scene_batch_first_entry_becomes_opening_camp() {
|
||||
let fallback_camp = json!({
|
||||
"name": "世界骨架占位归处",
|
||||
"description": "只来自 framework 的轻量占位。"
|
||||
});
|
||||
let generated_scenes = vec![
|
||||
json!({
|
||||
"name": "旧灯塔",
|
||||
"description": "雾中仍亮着错位灯火",
|
||||
"sceneTaskDescription": "首次进入旧灯塔时,追查被篡改的灯火航线记录。",
|
||||
"actBackgroundPromptTexts": ["一", "二", "三"],
|
||||
"actEventDescriptions": ["甲", "乙", "丙"],
|
||||
}),
|
||||
json!({
|
||||
"name": "沉船湾",
|
||||
"description": "退潮后露出旧船骨"
|
||||
}),
|
||||
];
|
||||
|
||||
let (camp, landmarks) =
|
||||
split_generated_scenes_into_camp_and_landmarks(fallback_camp, generated_scenes);
|
||||
|
||||
assert_eq!(camp.get("id"), Some(&json!("camp-1")));
|
||||
assert_eq!(camp.get("kind"), Some(&json!("camp")));
|
||||
assert_eq!(camp.get("name"), Some(&json!("旧灯塔")));
|
||||
assert_eq!(
|
||||
camp.get("sceneTaskDescription"),
|
||||
Some(&json!("首次进入旧灯塔时,追查被篡改的灯火航线记录。"))
|
||||
);
|
||||
assert_eq!(landmarks.len(), 1);
|
||||
assert_eq!(landmarks[0].get("name"), Some(&json!("沉船湾")));
|
||||
}
|
||||
|
||||
fn llm_response(content: &str) -> String {
|
||||
|
||||
@@ -6,7 +6,7 @@ pub(crate) fn build_custom_world_framework_prompt(setting_text: &str) -> String
|
||||
[
|
||||
"请先根据下面的玩家设定创建一份“世界核心骨架”,后续我会分步骤生成角色名单、场景名单和详细档案。".to_string(),
|
||||
"你必须只输出一个能被 JSON.parse 直接解析的 JSON 对象,不要输出 Markdown、代码块、注释或解释。".to_string(),
|
||||
"这一步只保留世界顶层信息与一个开局归处场景,不要输出 playableNpcs、storyNpcs、landmarks,也不要展开人物和地图细节。".to_string(),
|
||||
"这一步只保留世界顶层信息与一个开局归处占位,不要输出 playableNpcs、storyNpcs、landmarks,也不要展开人物、地图细节或多幕场景内容。".to_string(),
|
||||
"玩家设定:".to_string(),
|
||||
setting_text.trim().to_string(),
|
||||
"".to_string(),
|
||||
@@ -33,10 +33,7 @@ pub(crate) fn build_custom_world_framework_prompt(setting_text: &str) -> String
|
||||
" },".to_string(),
|
||||
" \"camp\": {".to_string(),
|
||||
" \"name\": \"开局归处名称\",".to_string(),
|
||||
" \"description\": \"这是玩家进入世界后的第一处落脚点描述\",".to_string(),
|
||||
" \"sceneTaskDescription\": \"首次进入该场景时要生成的章节任务核心上下文\",".to_string(),
|
||||
" \"actBackgroundPromptTexts\": [\"开局第一幕背景画面描述\", \"开局第二幕背景画面描述\", \"开局第三幕背景画面描述\"],".to_string(),
|
||||
" \"actEventDescriptions\": [\"开局第一幕事件描述\", \"开局第二幕事件描述\", \"开局第三幕事件描述\"],".to_string(),
|
||||
" \"description\": \"这是玩家进入世界后的第一处落脚点描述\"".to_string(),
|
||||
" }".to_string(),
|
||||
"}".to_string(),
|
||||
"".to_string(),
|
||||
@@ -45,10 +42,7 @@ pub(crate) fn build_custom_world_framework_prompt(setting_text: &str) -> String
|
||||
"- 这一步只输出顶层 10 个字段:name、subtitle、summary、tone、playerGoal、templateWorldType、majorFactions、coreConflicts、attributeSchema、camp。".to_string(),
|
||||
"- 这是一个完全独立的自定义世界;不要在任何正文里直接写出“武侠世界”“仙侠世界”等现成世界名。".to_string(),
|
||||
"- templateWorldType 只是系统兼容字段,不代表正文应当引用的世界名称。".to_string(),
|
||||
"- camp 必须表示玩家开局时的落脚处,更接近归舍、住处、栖居、前哨居所这类“家/归处”的概念。".to_string(),
|
||||
"- camp.sceneTaskDescription 必须描述玩家首次进入开局场景时要完成的核心任务,会作为游戏章节任务生成上下文,控制在 24 到 56 个汉字内。".to_string(),
|
||||
"- camp.actEventDescriptions 必须恰好 3 条,分别描述每一幕发生的事件;第 1 幕负责铺垫,第 2 幕必须让冲突升级,第 3 幕必须形成高潮或关键抉择;事件必须和当前幕对面的角色强相关,控制在 24 到 56 个汉字内。".to_string(),
|
||||
"- camp.actBackgroundPromptTexts 必须恰好 3 条,分别对应第 1/2/3 幕背景图画面内容描述;每条必须基于同序号 actEventDescriptions 和相关角色写出画面主体、站位空间、冲突痕迹与氛围,能直接交给生图模型,控制在 40 到 90 个汉字内。".to_string(),
|
||||
"- camp 只表示玩家开局时的落脚处占位,更接近归舍、住处、栖居、前哨居所这类“家/归处”的概念;不要在这一步生成开局场景任务、三幕事件或三幕背景。".to_string(),
|
||||
"- 不要输出 playableNpcs、storyNpcs、landmarks、items,也不要输出任何角色和地图细节。".to_string(),
|
||||
"- majorFactions 保持 2 到 3 个,coreConflicts 保持 2 到 3 个。".to_string(),
|
||||
"- attributeSchema 必须是本世界专属的角色六维属性体系,slots 必须恰好 6 个,slotId 固定为 axis_a 到 axis_f,维度名必须是 2 到 4 个汉字且互不重复。".to_string(),
|
||||
@@ -68,7 +62,7 @@ pub(crate) fn build_custom_world_framework_json_repair_prompt(response_text: &st
|
||||
"不要输出 playableNpcs、storyNpcs、landmarks、items 或任何其他字段。",
|
||||
"majorFactions 与 coreConflicts 必须是字符串数组。",
|
||||
"attributeSchema 必须是对象,且包含 schemaName 与 slots;slots 必须恰好 6 个,slotId 固定为 axis_a 到 axis_f。",
|
||||
"camp 必须是对象,且包含:name、description、sceneTaskDescription、actBackgroundPromptTexts、actEventDescriptions。",
|
||||
"camp 必须是对象,且只包含:name、description。",
|
||||
"原始文本:",
|
||||
response_text.trim(),
|
||||
].join("\n")
|
||||
@@ -154,16 +148,26 @@ pub(crate) fn build_custom_world_landmark_seed_batch_prompt(
|
||||
framework: &JsonValue,
|
||||
batch_count: usize,
|
||||
forbidden_names: &[String],
|
||||
is_opening_batch: bool,
|
||||
) -> String {
|
||||
let story_npc_names = names_from_entries(&array_field(framework, "storyNpcs"));
|
||||
[
|
||||
"请根据下面的世界核心信息,生成一批关键场景框架名单。".to_string(),
|
||||
"这一步必须一次性生成场景骨架、地点默认生图描述、逐幕背景描述、幕 NPC 分配和相连场景信息。".to_string(),
|
||||
"请根据下面的世界核心信息,批量生成场景框架名单。".to_string(),
|
||||
if is_opening_batch {
|
||||
"这一步必须一次性生成开局场景和普通关键场景的场景骨架、默认生图描述、逐幕背景描述、幕 NPC 分配和相连场景信息。".to_string()
|
||||
} else {
|
||||
"这一步必须一次性生成普通关键场景的场景骨架、默认生图描述、逐幕背景描述、幕 NPC 分配和相连场景信息。".to_string()
|
||||
},
|
||||
"你必须只输出一个能被 JSON.parse 直接解析的 JSON 对象,不要输出 Markdown、代码块、注释或解释。".to_string(),
|
||||
"世界核心信息:".to_string(),
|
||||
build_framework_summary_text(framework, 0),
|
||||
if story_npc_names.is_empty() { "".to_string() } else { format!("可用场景角色名单:{}", story_npc_names.join("、")) },
|
||||
if forbidden_names.is_empty() { "".to_string() } else { format!("这些地点已经生成,禁止重复:{}", forbidden_names.join("、")) },
|
||||
if is_opening_batch {
|
||||
"第一条场景必须是玩家进入世界时所在的开局场景,后续条目才是普通关键场景。".to_string()
|
||||
} else {
|
||||
"本批只生成普通关键场景,不要再生成开局场景。".to_string()
|
||||
},
|
||||
if forbidden_names.is_empty() { "".to_string() } else { format!("这些场景已经生成,禁止重复:{}", forbidden_names.join("、")) },
|
||||
"".to_string(),
|
||||
"输出 JSON 模板:".to_string(),
|
||||
"{".to_string(),
|
||||
@@ -183,16 +187,21 @@ pub(crate) fn build_custom_world_landmark_seed_batch_prompt(
|
||||
"}".to_string(),
|
||||
"".to_string(),
|
||||
"要求:".to_string(),
|
||||
format!("- 必须生成恰好 {batch_count} 个关键场景。"),
|
||||
"- 这是一个完全独立的自定义世界;地点名称必须直接服务玩家输入主题。".to_string(),
|
||||
"- 名称必须具体且互不重复,不要使用 地点1、场景1 之类的占位名。".to_string(),
|
||||
"- 每个地点只保留:name、description、visualDescription、sceneTaskDescription、actBackgroundPromptTexts、actEventDescriptions、actNPCNames、connectedLandmarkNames、entryHook。".to_string(),
|
||||
if is_opening_batch {
|
||||
format!("- 必须生成恰好 {batch_count} 个场景,第 1 个必须是开局场景。")
|
||||
} else {
|
||||
format!("- 必须生成恰好 {batch_count} 个普通关键场景,不能包含开局场景。")
|
||||
},
|
||||
if is_opening_batch { "- 开局场景也必须按普通场景同级规则生成完整字段,不能只给 camp 简介。".to_string() } else { "".to_string() },
|
||||
"- 这是一个完全独立的自定义世界;场景名称必须直接服务玩家输入主题。".to_string(),
|
||||
"- 名称必须具体且互不重复,不要使用 地点1、场景1、开局场景 之类的占位名。".to_string(),
|
||||
"- 每个场景只保留:name、description、visualDescription、sceneTaskDescription、actBackgroundPromptTexts、actEventDescriptions、actNPCNames、connectedLandmarkNames、entryHook。".to_string(),
|
||||
"- sceneTaskDescription 必须描述玩家首次进入该场景时要完成的核心任务,会作为游戏章节任务生成上下文,控制在 24 到 56 个汉字内。".to_string(),
|
||||
"- visualDescription 是打开场景背景图像生成面板时默认填入的场景描述,必须具体到画面主体、远近景层次、地面可站立区域和氛围识别点,控制在 32 到 80 个汉字内。".to_string(),
|
||||
"- actNPCNames 只能引用上方可用场景角色名单中的名字,表示第 1/2/3 幕各自的主场景角色;如果名单为空,输出空数组。".to_string(),
|
||||
"- 可用场景角色名单非空时,actNPCNames 必须恰好 3 个;可以重复使用同一角色,但每一项都必须服务对应幕事件。".to_string(),
|
||||
"- actNPCNames[n] 会成为第 n+1 幕对面主角色;三幕事件和幕背景必须围绕对应角色的行动、阻碍、试探或求助展开。".to_string(),
|
||||
"- connectedLandmarkNames 优先引用本批或已知关键场景名称,每个地点 1 到 3 个;只有 1 个地点时可以输出空数组。".to_string(),
|
||||
"- connectedLandmarkNames 优先引用本批或已知场景名称,每个场景 1 到 3 个;只有 1 个场景时可以输出空数组。".to_string(),
|
||||
"- entryHook 控制在 16 到 36 个汉字内。".to_string(),
|
||||
"- actEventDescriptions 必须恰好 3 条,分别描述每一幕发生的事件;第 1 幕负责铺垫,第 2 幕必须让冲突升级,第 3 幕必须形成高潮或关键抉择;事件必须和当前幕对面的角色强相关,控制在 24 到 56 个汉字内。".to_string(),
|
||||
"- actBackgroundPromptTexts 必须恰好 3 条,分别对应这个场景章节的第 1/2/3 幕背景图画面内容描述;每条都必须基于同序号 actEventDescriptions、当前地点和可出场角色直接写出画面主体、站位空间、冲突痕迹与氛围,控制在 40 到 90 个汉字内。".to_string(),
|
||||
@@ -207,14 +216,16 @@ pub(crate) fn build_custom_world_landmark_seed_batch_json_repair_prompt(
|
||||
response_text: &str,
|
||||
expected_count: usize,
|
||||
forbidden_names: &[String],
|
||||
is_opening_batch: bool,
|
||||
) -> String {
|
||||
[
|
||||
"下面这段文本本应是自定义世界关键场景框架名单批次的单个 JSON 对象,但当前不能被 JSON.parse 直接解析。".to_string(),
|
||||
"下面这段文本本应是自定义世界场景框架名单批次的单个 JSON 对象,但当前不能被 JSON.parse 直接解析。".to_string(),
|
||||
"请只输出修复后的 JSON 对象。".to_string(),
|
||||
"顶层必须只包含一个 landmarks 数组。".to_string(),
|
||||
format!("必须保留恰好 {expected_count} 个地点对象。"),
|
||||
format!("必须保留恰好 {expected_count} 个场景对象。"),
|
||||
if is_opening_batch { "第一项必须是开局场景,且字段粒度与普通场景一致。".to_string() } else { "本批只保留普通关键场景,不要包含开局场景。".to_string() },
|
||||
if forbidden_names.is_empty() { "".to_string() } else { format!("禁止使用这些重复名:{}。", forbidden_names.join("、")) },
|
||||
"每个地点只包含:name、description、visualDescription、sceneTaskDescription、actBackgroundPromptTexts、actEventDescriptions、actNPCNames、connectedLandmarkNames、entryHook。".to_string(),
|
||||
"每个场景只包含:name、description、visualDescription、sceneTaskDescription、actBackgroundPromptTexts、actEventDescriptions、actNPCNames、connectedLandmarkNames、entryHook。".to_string(),
|
||||
"如果缺少字段:字符串补空字符串,actBackgroundPromptTexts、actEventDescriptions、actNPCNames 和 connectedLandmarkNames 补空数组。".to_string(),
|
||||
"不要输出 items 或任何其他字段。".to_string(),
|
||||
"原始文本:".to_string(),
|
||||
|
||||
@@ -212,11 +212,10 @@ pub(super) async fn generate_reasoned_story_payload(
|
||||
}
|
||||
|
||||
pub(super) fn should_generate_reasoned_combat_story(
|
||||
battle: Option<&RuntimeBattlePresentation>,
|
||||
_battle: Option<&RuntimeBattlePresentation>,
|
||||
) -> bool {
|
||||
battle
|
||||
.and_then(|presentation| presentation.outcome.as_deref())
|
||||
.is_some_and(|outcome| matches!(outcome, "victory" | "spar_complete" | "escaped"))
|
||||
// 战斗动作、逃跑、胜利、切磋结束与死亡都只走确定性结算,避免战斗链路再次触发剧情推理。
|
||||
false
|
||||
}
|
||||
|
||||
pub(super) fn build_action_story_history(
|
||||
|
||||
@@ -1913,7 +1913,7 @@ fn runtime_story_quest_turn_in_marks_quest_rewards_and_affinity() {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn runtime_story_reasoned_combat_story_guard_only_targets_terminal_outcomes() {
|
||||
fn runtime_story_reasoned_combat_story_guard_blocks_all_battle_outcomes() {
|
||||
assert!(!should_generate_reasoned_combat_story(None));
|
||||
assert!(!should_generate_reasoned_combat_story(Some(
|
||||
&RuntimeBattlePresentation {
|
||||
@@ -1924,7 +1924,7 @@ fn runtime_story_reasoned_combat_story_guard_only_targets_terminal_outcomes() {
|
||||
outcome: Some("ongoing".to_string()),
|
||||
}
|
||||
)));
|
||||
assert!(should_generate_reasoned_combat_story(Some(
|
||||
assert!(!should_generate_reasoned_combat_story(Some(
|
||||
&RuntimeBattlePresentation {
|
||||
target_id: Some("npc_merchant_01".to_string()),
|
||||
target_name: Some("沈七".to_string()),
|
||||
@@ -1933,7 +1933,7 @@ fn runtime_story_reasoned_combat_story_guard_only_targets_terminal_outcomes() {
|
||||
outcome: Some("victory".to_string()),
|
||||
}
|
||||
)));
|
||||
assert!(should_generate_reasoned_combat_story(Some(
|
||||
assert!(!should_generate_reasoned_combat_story(Some(
|
||||
&RuntimeBattlePresentation {
|
||||
target_id: Some("npc_merchant_01".to_string()),
|
||||
target_name: Some("沈七".to_string()),
|
||||
|
||||
@@ -56,6 +56,34 @@ pub struct AssetObjectProcedureResult {
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AssetHistoryListInput {
|
||||
pub asset_kind: String,
|
||||
pub limit: u32,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AssetHistoryEntrySnapshot {
|
||||
pub asset_object_id: String,
|
||||
pub asset_kind: String,
|
||||
pub image_src: String,
|
||||
pub owner_user_id: Option<String>,
|
||||
pub profile_id: Option<String>,
|
||||
pub entity_id: Option<String>,
|
||||
pub created_at_micros: i64,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AssetHistoryListResult {
|
||||
pub ok: bool,
|
||||
pub entries: Vec<AssetHistoryEntrySnapshot>,
|
||||
pub error_message: Option<String>,
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "spacetime-types", derive(SpacetimeType))]
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
pub struct AssetEntityBindingProcedureResult {
|
||||
@@ -151,6 +179,18 @@ pub struct AssetObjectRecord {
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct AssetHistoryEntryRecord {
|
||||
pub asset_object_id: String,
|
||||
pub asset_kind: String,
|
||||
pub image_src: String,
|
||||
pub owner_user_id: Option<String>,
|
||||
pub profile_id: Option<String>,
|
||||
pub entity_id: Option<String>,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||
pub struct ConfirmAssetObjectResult {
|
||||
pub record: AssetObjectRecord,
|
||||
@@ -297,6 +337,21 @@ pub fn build_asset_object_record(snapshot: AssetObjectUpsertSnapshot) -> AssetOb
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build_asset_history_entry_record(
|
||||
snapshot: AssetHistoryEntrySnapshot,
|
||||
) -> AssetHistoryEntryRecord {
|
||||
AssetHistoryEntryRecord {
|
||||
asset_object_id: snapshot.asset_object_id,
|
||||
asset_kind: snapshot.asset_kind,
|
||||
image_src: snapshot.image_src,
|
||||
owner_user_id: snapshot.owner_user_id,
|
||||
profile_id: snapshot.profile_id,
|
||||
entity_id: snapshot.entity_id,
|
||||
created_at: format_timestamp_micros(snapshot.created_at_micros),
|
||||
updated_at: format_timestamp_micros(snapshot.updated_at_micros),
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
pub fn build_asset_entity_binding_input(
|
||||
binding_id: String,
|
||||
|
||||
@@ -5,12 +5,14 @@ mod asset_object_service;
|
||||
pub use asset_object_core::{
|
||||
ASSET_BINDING_ID_PREFIX, ASSET_OBJECT_ID_PREFIX, AssetEntityBindingInput,
|
||||
AssetEntityBindingProcedureResult, AssetEntityBindingRecord, AssetEntityBindingSnapshot,
|
||||
AssetObjectAccessPolicy, AssetObjectFieldError, AssetObjectProcedureResult, AssetObjectRecord,
|
||||
AssetObjectUpsertInput, AssetObjectUpsertSnapshot, ConfirmAssetObjectInput,
|
||||
ConfirmAssetObjectResult, INITIAL_ASSET_OBJECT_VERSION, build_asset_entity_binding_input,
|
||||
build_asset_entity_binding_record, build_asset_object_record, build_asset_object_upsert_input,
|
||||
generate_asset_binding_id, generate_asset_object_id, normalize_optional_value,
|
||||
validate_asset_entity_binding_fields, validate_asset_object_fields,
|
||||
AssetHistoryEntryRecord, AssetHistoryEntrySnapshot, AssetHistoryListInput,
|
||||
AssetHistoryListResult, AssetObjectAccessPolicy, AssetObjectFieldError,
|
||||
AssetObjectProcedureResult, AssetObjectRecord, AssetObjectUpsertInput,
|
||||
AssetObjectUpsertSnapshot, ConfirmAssetObjectInput, ConfirmAssetObjectResult,
|
||||
INITIAL_ASSET_OBJECT_VERSION, build_asset_entity_binding_input,
|
||||
build_asset_entity_binding_record, build_asset_history_entry_record, build_asset_object_record,
|
||||
build_asset_object_upsert_input, generate_asset_binding_id, generate_asset_object_id,
|
||||
normalize_optional_value, validate_asset_entity_binding_fields, validate_asset_object_fields,
|
||||
};
|
||||
#[cfg(feature = "server-service")]
|
||||
pub use asset_object_service::{
|
||||
|
||||
@@ -84,6 +84,34 @@ pub struct BindAssetObjectRequest {
|
||||
pub profile_id: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AssetHistoryQuery {
|
||||
pub kind: String,
|
||||
#[serde(default)]
|
||||
pub limit: Option<u32>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AssetHistoryEntryPayload {
|
||||
pub asset_object_id: String,
|
||||
pub asset_kind: String,
|
||||
pub image_src: String,
|
||||
pub owner_user_id: Option<String>,
|
||||
pub owner_label: String,
|
||||
pub profile_id: Option<String>,
|
||||
pub entity_id: Option<String>,
|
||||
pub created_at: String,
|
||||
pub updated_at: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct AssetHistoryListResponse {
|
||||
pub assets: Vec<AssetHistoryEntryPayload>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub enum CharacterVisualSourceMode {
|
||||
|
||||
@@ -1,6 +1,26 @@
|
||||
use super::*;
|
||||
|
||||
impl SpacetimeClient {
|
||||
pub async fn list_asset_history(
|
||||
&self,
|
||||
input: module_assets::AssetHistoryListInput,
|
||||
) -> Result<Vec<AssetHistoryEntryRecord>, SpacetimeClientError> {
|
||||
let procedure_input = input.into();
|
||||
|
||||
self.call_after_connect(move |connection, sender| {
|
||||
connection.procedures().list_asset_history_and_return_then(
|
||||
procedure_input,
|
||||
move |_, result| {
|
||||
let mapped = result
|
||||
.map_err(|error| SpacetimeClientError::Procedure(error.to_string()))
|
||||
.and_then(map_asset_history_list_result);
|
||||
send_once(&sender, mapped);
|
||||
},
|
||||
);
|
||||
})
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn confirm_asset_object(
|
||||
&self,
|
||||
input: module_assets::AssetObjectUpsertInput,
|
||||
|
||||
@@ -72,8 +72,8 @@ use module_ai::{
|
||||
AiTextChunkAppendInput as DomainAiTextChunkAppendInput,
|
||||
};
|
||||
use module_assets::{
|
||||
AssetEntityBindingRecord, AssetObjectAccessPolicy, AssetObjectRecord,
|
||||
build_asset_entity_binding_record, build_asset_object_record,
|
||||
AssetEntityBindingRecord, AssetHistoryEntryRecord, AssetObjectAccessPolicy, AssetObjectRecord,
|
||||
build_asset_entity_binding_record, build_asset_history_entry_record, build_asset_object_record,
|
||||
};
|
||||
use module_combat::{
|
||||
BattleMode as DomainBattleMode, BattleStateInput as DomainBattleStateInput,
|
||||
|
||||
@@ -37,6 +37,15 @@ impl From<module_assets::AssetObjectUpsertInput> for AssetObjectUpsertInput {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<module_assets::AssetHistoryListInput> for AssetHistoryListInput {
|
||||
fn from(input: module_assets::AssetHistoryListInput) -> Self {
|
||||
Self {
|
||||
asset_kind: input.asset_kind,
|
||||
limit: input.limit,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<module_runtime::RuntimeSettingGetInput> for RuntimeSettingGetInput {
|
||||
fn from(input: module_runtime::RuntimeSettingGetInput) -> Self {
|
||||
Self {
|
||||
@@ -500,6 +509,25 @@ pub(crate) fn map_entity_binding_procedure_result(
|
||||
))
|
||||
}
|
||||
|
||||
pub(crate) fn map_asset_history_list_result(
|
||||
result: AssetHistoryListResult,
|
||||
) -> Result<Vec<AssetHistoryEntryRecord>, SpacetimeClientError> {
|
||||
if !result.ok {
|
||||
return Err(SpacetimeClientError::Procedure(
|
||||
result
|
||||
.error_message
|
||||
.unwrap_or_else(|| "SpacetimeDB procedure 返回未知错误".to_string()),
|
||||
));
|
||||
}
|
||||
|
||||
Ok(result
|
||||
.entries
|
||||
.into_iter()
|
||||
.map(map_asset_history_entry_snapshot)
|
||||
.map(build_asset_history_entry_record)
|
||||
.collect())
|
||||
}
|
||||
|
||||
pub(crate) fn map_runtime_setting_procedure_result(
|
||||
result: RuntimeSettingProcedureResult,
|
||||
) -> Result<RuntimeSettingsRecord, SpacetimeClientError> {
|
||||
@@ -1430,6 +1458,21 @@ pub(crate) fn map_snapshot(
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn map_asset_history_entry_snapshot(
|
||||
snapshot: AssetHistoryEntrySnapshot,
|
||||
) -> module_assets::AssetHistoryEntrySnapshot {
|
||||
module_assets::AssetHistoryEntrySnapshot {
|
||||
asset_object_id: snapshot.asset_object_id,
|
||||
asset_kind: snapshot.asset_kind,
|
||||
image_src: snapshot.image_src,
|
||||
owner_user_id: snapshot.owner_user_id,
|
||||
profile_id: snapshot.profile_id,
|
||||
entity_id: snapshot.entity_id,
|
||||
created_at_micros: snapshot.created_at_micros,
|
||||
updated_at_micros: snapshot.updated_at_micros,
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn map_runtime_setting_snapshot(
|
||||
snapshot: RuntimeSettingSnapshot,
|
||||
) -> module_runtime::RuntimeSettingSnapshot {
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::ai_result_reference_type::AiResultReference;
|
||||
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::ai_task_stage_type::AiTaskStage;
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
use super::ai_task_stage_status_type::AiTaskStageStatus;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::ai_task_type::AiTask;
|
||||
use super::ai_task_kind_type::AiTaskKind;
|
||||
use super::ai_task_status_type::AiTaskStatus;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::ai_text_chunk_type::AiTextChunk;
|
||||
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// 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::asset_entity_binding_type::AssetEntityBinding;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// 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 AssetHistoryEntrySnapshot {
|
||||
pub asset_object_id: String,
|
||||
pub asset_kind: String,
|
||||
pub image_src: String,
|
||||
pub owner_user_id: Option::<String>,
|
||||
pub profile_id: Option::<String>,
|
||||
pub entity_id: Option::<String>,
|
||||
pub created_at_micros: i64,
|
||||
pub updated_at_micros: i64,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetHistoryEntrySnapshot {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -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)]
|
||||
pub struct AssetHistoryListInput {
|
||||
pub asset_kind: String,
|
||||
pub limit: u32,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetHistoryListInput {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
// 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::asset_history_entry_snapshot_type::AssetHistoryEntrySnapshot;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
pub struct AssetHistoryListResult {
|
||||
pub ok: bool,
|
||||
pub entries: Vec::<AssetHistoryEntrySnapshot>,
|
||||
pub error_message: Option::<String>,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for AssetHistoryListResult {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::asset_object_type::AssetObject;
|
||||
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// 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::auth_identity_type::AuthIdentity;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// 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::auth_store_snapshot_type::AuthStoreSnapshot;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
// 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::battle_state_type::BattleState;
|
||||
use super::battle_mode_type::BattleMode;
|
||||
use super::battle_status_type::BattleStatus;
|
||||
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||
use super::combat_outcome_type::CombatOutcome;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::big_fish_agent_message_type::BigFishAgentMessage;
|
||||
use super::big_fish_agent_message_role_type::BigFishAgentMessageRole;
|
||||
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::big_fish_asset_slot_type::BigFishAssetSlot;
|
||||
use super::big_fish_asset_kind_type::BigFishAssetKind;
|
||||
use super::big_fish_asset_status_type::BigFishAssetStatus;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::big_fish_creation_session_type::BigFishCreationSession;
|
||||
use super::big_fish_creation_stage_type::BigFishCreationStage;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::big_fish_runtime_run_type::BigFishRuntimeRun;
|
||||
use super::big_fish_run_status_type::BigFishRunStatus;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::chapter_progression_type::ChapterProgression;
|
||||
use super::chapter_pace_band_type::ChapterPaceBand;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::custom_world_agent_message_type::CustomWorldAgentMessage;
|
||||
use super::rpg_agent_message_role_type::RpgAgentMessageRole;
|
||||
use super::rpg_agent_message_kind_type::RpgAgentMessageKind;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::custom_world_agent_operation_type::CustomWorldAgentOperation;
|
||||
use super::rpg_agent_operation_type_type::RpgAgentOperationType;
|
||||
use super::rpg_agent_operation_status_type::RpgAgentOperationStatus;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::custom_world_agent_session_type::CustomWorldAgentSession;
|
||||
use super::rpg_agent_stage_type::RpgAgentStage;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,166 +0,0 @@
|
||||
// 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::custom_world_draft_card_type::CustomWorldDraftCard;
|
||||
use super::rpg_agent_draft_card_kind_type::RpgAgentDraftCardKind;
|
||||
use super::rpg_agent_draft_card_status_type::RpgAgentDraftCardStatus;
|
||||
use super::custom_world_role_asset_status_type::CustomWorldRoleAssetStatus;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::custom_world_profile_type::CustomWorldProfile;
|
||||
use super::custom_world_theme_mode_type::CustomWorldThemeMode;
|
||||
use super::custom_world_publication_status_type::CustomWorldPublicationStatus;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::custom_world_session_type::CustomWorldSession;
|
||||
use super::custom_world_generation_mode_type::CustomWorldGenerationMode;
|
||||
use super::custom_world_session_status_type::CustomWorldSessionStatus;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
// 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::inventory_slot_type::InventorySlot;
|
||||
use super::inventory_item_rarity_type::InventoryItemRarity;
|
||||
use super::inventory_equipment_slot_type::InventoryEquipmentSlot;
|
||||
use super::inventory_item_source_kind_type::InventoryItemSourceKind;
|
||||
use super::inventory_container_kind_type::InventoryContainerKind;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
// 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::asset_history_list_input_type::AssetHistoryListInput;
|
||||
use super::asset_history_list_result_type::AssetHistoryListResult;
|
||||
|
||||
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||
#[sats(crate = __lib)]
|
||||
struct ListAssetHistoryAndReturnArgs {
|
||||
pub input: AssetHistoryListInput,
|
||||
}
|
||||
|
||||
|
||||
impl __sdk::InModule for ListAssetHistoryAndReturnArgs {
|
||||
type Module = super::RemoteModule;
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the procedure `list_asset_history_and_return`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteProcedures`].
|
||||
pub trait list_asset_history_and_return {
|
||||
fn list_asset_history_and_return(&self, input: AssetHistoryListInput,
|
||||
) {
|
||||
self.list_asset_history_and_return_then(input, |_, _| {});
|
||||
}
|
||||
|
||||
fn list_asset_history_and_return_then(
|
||||
&self,
|
||||
input: AssetHistoryListInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AssetHistoryListResult, __sdk::InternalError>) + Send + 'static,
|
||||
);
|
||||
}
|
||||
|
||||
impl list_asset_history_and_return for super::RemoteProcedures {
|
||||
fn list_asset_history_and_return_then(
|
||||
&self,
|
||||
input: AssetHistoryListInput,
|
||||
|
||||
__callback: impl FnOnce(&super::ProcedureEventContext, Result<AssetHistoryListResult, __sdk::InternalError>) + Send + 'static,
|
||||
) {
|
||||
self.imp.invoke_procedure_with_callback::<_, AssetHistoryListResult>(
|
||||
"list_asset_history_and_return",
|
||||
ListAssetHistoryAndReturnArgs { input, },
|
||||
__callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@ pub mod asset_entity_binding_type;
|
||||
pub mod asset_entity_binding_input_type;
|
||||
pub mod asset_entity_binding_procedure_result_type;
|
||||
pub mod asset_entity_binding_snapshot_type;
|
||||
pub mod asset_history_entry_snapshot_type;
|
||||
pub mod asset_history_list_input_type;
|
||||
pub mod asset_history_list_result_type;
|
||||
pub mod asset_object_type;
|
||||
pub mod asset_object_access_policy_type;
|
||||
pub mod asset_object_procedure_result_type;
|
||||
@@ -367,52 +370,7 @@ pub mod unpublish_custom_world_profile_reducer;
|
||||
pub mod upsert_chapter_progression_reducer;
|
||||
pub mod upsert_custom_world_profile_reducer;
|
||||
pub mod upsert_npc_state_reducer;
|
||||
pub mod ai_result_reference_table;
|
||||
pub mod ai_task_table;
|
||||
pub mod ai_task_stage_table;
|
||||
pub mod ai_text_chunk_table;
|
||||
pub mod asset_entity_binding_table;
|
||||
pub mod asset_object_table;
|
||||
pub mod auth_identity_table;
|
||||
pub mod auth_store_snapshot_table;
|
||||
pub mod battle_state_table;
|
||||
pub mod big_fish_agent_message_table;
|
||||
pub mod big_fish_asset_slot_table;
|
||||
pub mod big_fish_creation_session_table;
|
||||
pub mod big_fish_runtime_run_table;
|
||||
pub mod chapter_progression_table;
|
||||
pub mod custom_world_agent_message_table;
|
||||
pub mod custom_world_agent_operation_table;
|
||||
pub mod custom_world_agent_session_table;
|
||||
pub mod custom_world_draft_card_table;
|
||||
pub mod custom_world_gallery_entry_table;
|
||||
pub mod custom_world_profile_table;
|
||||
pub mod custom_world_session_table;
|
||||
pub mod inventory_slot_table;
|
||||
pub mod npc_state_table;
|
||||
pub mod player_progression_table;
|
||||
pub mod profile_dashboard_state_table;
|
||||
pub mod profile_invite_code_table;
|
||||
pub mod profile_membership_table;
|
||||
pub mod profile_played_world_table;
|
||||
pub mod profile_recharge_order_table;
|
||||
pub mod profile_referral_relation_table;
|
||||
pub mod profile_save_archive_table;
|
||||
pub mod profile_wallet_ledger_table;
|
||||
pub mod puzzle_agent_message_table;
|
||||
pub mod puzzle_agent_session_table;
|
||||
pub mod puzzle_runtime_run_table;
|
||||
pub mod puzzle_work_profile_table;
|
||||
pub mod quest_log_table;
|
||||
pub mod quest_record_table;
|
||||
pub mod refresh_session_table;
|
||||
pub mod runtime_setting_table;
|
||||
pub mod runtime_snapshot_table;
|
||||
pub mod story_event_table;
|
||||
pub mod story_session_table;
|
||||
pub mod treasure_record_table;
|
||||
pub mod user_account_table;
|
||||
pub mod user_browse_history_table;
|
||||
pub mod advance_puzzle_next_level_procedure;
|
||||
pub mod append_ai_text_chunk_and_return_procedure;
|
||||
pub mod apply_chapter_progression_ledger_entry_and_return_procedure;
|
||||
@@ -473,6 +431,7 @@ pub mod get_runtime_snapshot_procedure;
|
||||
pub mod get_story_session_state_procedure;
|
||||
pub mod grant_player_progression_experience_and_return_procedure;
|
||||
pub mod import_auth_store_snapshot_procedure;
|
||||
pub mod list_asset_history_and_return_procedure;
|
||||
pub mod list_big_fish_works_procedure;
|
||||
pub mod list_custom_world_gallery_entries_procedure;
|
||||
pub mod list_custom_world_profiles_procedure;
|
||||
@@ -541,6 +500,9 @@ pub use asset_entity_binding_type::AssetEntityBinding;
|
||||
pub use asset_entity_binding_input_type::AssetEntityBindingInput;
|
||||
pub use asset_entity_binding_procedure_result_type::AssetEntityBindingProcedureResult;
|
||||
pub use asset_entity_binding_snapshot_type::AssetEntityBindingSnapshot;
|
||||
pub use asset_history_entry_snapshot_type::AssetHistoryEntrySnapshot;
|
||||
pub use asset_history_list_input_type::AssetHistoryListInput;
|
||||
pub use asset_history_list_result_type::AssetHistoryListResult;
|
||||
pub use asset_object_type::AssetObject;
|
||||
pub use asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||
pub use asset_object_procedure_result_type::AssetObjectProcedureResult;
|
||||
@@ -845,52 +807,7 @@ pub use treasure_resolve_input_type::TreasureResolveInput;
|
||||
pub use unequip_inventory_item_input_type::UnequipInventoryItemInput;
|
||||
pub use user_account_type::UserAccount;
|
||||
pub use user_browse_history_type::UserBrowseHistory;
|
||||
pub use ai_result_reference_table::*;
|
||||
pub use ai_task_table::*;
|
||||
pub use ai_task_stage_table::*;
|
||||
pub use ai_text_chunk_table::*;
|
||||
pub use asset_entity_binding_table::*;
|
||||
pub use asset_object_table::*;
|
||||
pub use auth_identity_table::*;
|
||||
pub use auth_store_snapshot_table::*;
|
||||
pub use battle_state_table::*;
|
||||
pub use big_fish_agent_message_table::*;
|
||||
pub use big_fish_asset_slot_table::*;
|
||||
pub use big_fish_creation_session_table::*;
|
||||
pub use big_fish_runtime_run_table::*;
|
||||
pub use chapter_progression_table::*;
|
||||
pub use custom_world_agent_message_table::*;
|
||||
pub use custom_world_agent_operation_table::*;
|
||||
pub use custom_world_agent_session_table::*;
|
||||
pub use custom_world_draft_card_table::*;
|
||||
pub use custom_world_gallery_entry_table::*;
|
||||
pub use custom_world_profile_table::*;
|
||||
pub use custom_world_session_table::*;
|
||||
pub use inventory_slot_table::*;
|
||||
pub use npc_state_table::*;
|
||||
pub use player_progression_table::*;
|
||||
pub use profile_dashboard_state_table::*;
|
||||
pub use profile_invite_code_table::*;
|
||||
pub use profile_membership_table::*;
|
||||
pub use profile_played_world_table::*;
|
||||
pub use profile_recharge_order_table::*;
|
||||
pub use profile_referral_relation_table::*;
|
||||
pub use profile_save_archive_table::*;
|
||||
pub use profile_wallet_ledger_table::*;
|
||||
pub use puzzle_agent_message_table::*;
|
||||
pub use puzzle_agent_session_table::*;
|
||||
pub use puzzle_runtime_run_table::*;
|
||||
pub use puzzle_work_profile_table::*;
|
||||
pub use quest_log_table::*;
|
||||
pub use quest_record_table::*;
|
||||
pub use refresh_session_table::*;
|
||||
pub use runtime_setting_table::*;
|
||||
pub use runtime_snapshot_table::*;
|
||||
pub use story_event_table::*;
|
||||
pub use story_session_table::*;
|
||||
pub use treasure_record_table::*;
|
||||
pub use user_account_table::*;
|
||||
pub use user_browse_history_table::*;
|
||||
pub use accept_quest_reducer::accept_quest;
|
||||
pub use acknowledge_quest_completion_reducer::acknowledge_quest_completion;
|
||||
pub use apply_chapter_progression_ledger_entry_reducer::apply_chapter_progression_ledger_entry;
|
||||
@@ -975,6 +892,7 @@ pub use get_runtime_snapshot_procedure::get_runtime_snapshot;
|
||||
pub use get_story_session_state_procedure::get_story_session_state;
|
||||
pub use grant_player_progression_experience_and_return_procedure::grant_player_progression_experience_and_return;
|
||||
pub use import_auth_store_snapshot_procedure::import_auth_store_snapshot;
|
||||
pub use list_asset_history_and_return_procedure::list_asset_history_and_return;
|
||||
pub use list_big_fish_works_procedure::list_big_fish_works;
|
||||
pub use list_custom_world_gallery_entries_procedure::list_custom_world_gallery_entries;
|
||||
pub use list_custom_world_profiles_procedure::list_custom_world_profiles;
|
||||
@@ -1264,52 +1182,7 @@ fn args_bsatn(&self) -> Result<Vec<u8>, __sats::bsatn::EncodeError> {
|
||||
#[allow(non_snake_case)]
|
||||
#[doc(hidden)]
|
||||
pub struct DbUpdate {
|
||||
ai_result_reference: __sdk::TableUpdate<AiResultReference>,
|
||||
ai_task: __sdk::TableUpdate<AiTask>,
|
||||
ai_task_stage: __sdk::TableUpdate<AiTaskStage>,
|
||||
ai_text_chunk: __sdk::TableUpdate<AiTextChunk>,
|
||||
asset_entity_binding: __sdk::TableUpdate<AssetEntityBinding>,
|
||||
asset_object: __sdk::TableUpdate<AssetObject>,
|
||||
auth_identity: __sdk::TableUpdate<AuthIdentity>,
|
||||
auth_store_snapshot: __sdk::TableUpdate<AuthStoreSnapshot>,
|
||||
battle_state: __sdk::TableUpdate<BattleState>,
|
||||
big_fish_agent_message: __sdk::TableUpdate<BigFishAgentMessage>,
|
||||
big_fish_asset_slot: __sdk::TableUpdate<BigFishAssetSlot>,
|
||||
big_fish_creation_session: __sdk::TableUpdate<BigFishCreationSession>,
|
||||
big_fish_runtime_run: __sdk::TableUpdate<BigFishRuntimeRun>,
|
||||
chapter_progression: __sdk::TableUpdate<ChapterProgression>,
|
||||
custom_world_agent_message: __sdk::TableUpdate<CustomWorldAgentMessage>,
|
||||
custom_world_agent_operation: __sdk::TableUpdate<CustomWorldAgentOperation>,
|
||||
custom_world_agent_session: __sdk::TableUpdate<CustomWorldAgentSession>,
|
||||
custom_world_draft_card: __sdk::TableUpdate<CustomWorldDraftCard>,
|
||||
custom_world_gallery_entry: __sdk::TableUpdate<CustomWorldGalleryEntry>,
|
||||
custom_world_profile: __sdk::TableUpdate<CustomWorldProfile>,
|
||||
custom_world_session: __sdk::TableUpdate<CustomWorldSession>,
|
||||
inventory_slot: __sdk::TableUpdate<InventorySlot>,
|
||||
npc_state: __sdk::TableUpdate<NpcState>,
|
||||
player_progression: __sdk::TableUpdate<PlayerProgression>,
|
||||
profile_dashboard_state: __sdk::TableUpdate<ProfileDashboardState>,
|
||||
profile_invite_code: __sdk::TableUpdate<ProfileInviteCode>,
|
||||
profile_membership: __sdk::TableUpdate<ProfileMembership>,
|
||||
profile_played_world: __sdk::TableUpdate<ProfilePlayedWorld>,
|
||||
profile_recharge_order: __sdk::TableUpdate<ProfileRechargeOrder>,
|
||||
profile_referral_relation: __sdk::TableUpdate<ProfileReferralRelation>,
|
||||
profile_save_archive: __sdk::TableUpdate<ProfileSaveArchive>,
|
||||
profile_wallet_ledger: __sdk::TableUpdate<ProfileWalletLedger>,
|
||||
puzzle_agent_message: __sdk::TableUpdate<PuzzleAgentMessageRow>,
|
||||
puzzle_agent_session: __sdk::TableUpdate<PuzzleAgentSessionRow>,
|
||||
puzzle_runtime_run: __sdk::TableUpdate<PuzzleRuntimeRunRow>,
|
||||
puzzle_work_profile: __sdk::TableUpdate<PuzzleWorkProfileRow>,
|
||||
quest_log: __sdk::TableUpdate<QuestLog>,
|
||||
quest_record: __sdk::TableUpdate<QuestRecord>,
|
||||
refresh_session: __sdk::TableUpdate<RefreshSession>,
|
||||
runtime_setting: __sdk::TableUpdate<RuntimeSetting>,
|
||||
runtime_snapshot: __sdk::TableUpdate<RuntimeSnapshotRow>,
|
||||
story_event: __sdk::TableUpdate<StoryEvent>,
|
||||
story_session: __sdk::TableUpdate<StorySession>,
|
||||
treasure_record: __sdk::TableUpdate<TreasureRecord>,
|
||||
user_account: __sdk::TableUpdate<UserAccount>,
|
||||
user_browse_history: __sdk::TableUpdate<UserBrowseHistory>,
|
||||
custom_world_gallery_entry: __sdk::TableUpdate<CustomWorldGalleryEntry>,
|
||||
}
|
||||
|
||||
|
||||
@@ -1320,52 +1193,7 @@ impl TryFrom<__ws::v2::TransactionUpdate> for DbUpdate {
|
||||
for table_update in __sdk::transaction_update_iter_table_updates(raw) {
|
||||
match &table_update.table_name[..] {
|
||||
|
||||
"ai_result_reference" => db_update.ai_result_reference.append(ai_result_reference_table::parse_table_update(table_update)?),
|
||||
"ai_task" => db_update.ai_task.append(ai_task_table::parse_table_update(table_update)?),
|
||||
"ai_task_stage" => db_update.ai_task_stage.append(ai_task_stage_table::parse_table_update(table_update)?),
|
||||
"ai_text_chunk" => db_update.ai_text_chunk.append(ai_text_chunk_table::parse_table_update(table_update)?),
|
||||
"asset_entity_binding" => db_update.asset_entity_binding.append(asset_entity_binding_table::parse_table_update(table_update)?),
|
||||
"asset_object" => db_update.asset_object.append(asset_object_table::parse_table_update(table_update)?),
|
||||
"auth_identity" => db_update.auth_identity.append(auth_identity_table::parse_table_update(table_update)?),
|
||||
"auth_store_snapshot" => db_update.auth_store_snapshot.append(auth_store_snapshot_table::parse_table_update(table_update)?),
|
||||
"battle_state" => db_update.battle_state.append(battle_state_table::parse_table_update(table_update)?),
|
||||
"big_fish_agent_message" => db_update.big_fish_agent_message.append(big_fish_agent_message_table::parse_table_update(table_update)?),
|
||||
"big_fish_asset_slot" => db_update.big_fish_asset_slot.append(big_fish_asset_slot_table::parse_table_update(table_update)?),
|
||||
"big_fish_creation_session" => db_update.big_fish_creation_session.append(big_fish_creation_session_table::parse_table_update(table_update)?),
|
||||
"big_fish_runtime_run" => db_update.big_fish_runtime_run.append(big_fish_runtime_run_table::parse_table_update(table_update)?),
|
||||
"chapter_progression" => db_update.chapter_progression.append(chapter_progression_table::parse_table_update(table_update)?),
|
||||
"custom_world_agent_message" => db_update.custom_world_agent_message.append(custom_world_agent_message_table::parse_table_update(table_update)?),
|
||||
"custom_world_agent_operation" => db_update.custom_world_agent_operation.append(custom_world_agent_operation_table::parse_table_update(table_update)?),
|
||||
"custom_world_agent_session" => db_update.custom_world_agent_session.append(custom_world_agent_session_table::parse_table_update(table_update)?),
|
||||
"custom_world_draft_card" => db_update.custom_world_draft_card.append(custom_world_draft_card_table::parse_table_update(table_update)?),
|
||||
"custom_world_gallery_entry" => db_update.custom_world_gallery_entry.append(custom_world_gallery_entry_table::parse_table_update(table_update)?),
|
||||
"custom_world_profile" => db_update.custom_world_profile.append(custom_world_profile_table::parse_table_update(table_update)?),
|
||||
"custom_world_session" => db_update.custom_world_session.append(custom_world_session_table::parse_table_update(table_update)?),
|
||||
"inventory_slot" => db_update.inventory_slot.append(inventory_slot_table::parse_table_update(table_update)?),
|
||||
"npc_state" => db_update.npc_state.append(npc_state_table::parse_table_update(table_update)?),
|
||||
"player_progression" => db_update.player_progression.append(player_progression_table::parse_table_update(table_update)?),
|
||||
"profile_dashboard_state" => db_update.profile_dashboard_state.append(profile_dashboard_state_table::parse_table_update(table_update)?),
|
||||
"profile_invite_code" => db_update.profile_invite_code.append(profile_invite_code_table::parse_table_update(table_update)?),
|
||||
"profile_membership" => db_update.profile_membership.append(profile_membership_table::parse_table_update(table_update)?),
|
||||
"profile_played_world" => db_update.profile_played_world.append(profile_played_world_table::parse_table_update(table_update)?),
|
||||
"profile_recharge_order" => db_update.profile_recharge_order.append(profile_recharge_order_table::parse_table_update(table_update)?),
|
||||
"profile_referral_relation" => db_update.profile_referral_relation.append(profile_referral_relation_table::parse_table_update(table_update)?),
|
||||
"profile_save_archive" => db_update.profile_save_archive.append(profile_save_archive_table::parse_table_update(table_update)?),
|
||||
"profile_wallet_ledger" => db_update.profile_wallet_ledger.append(profile_wallet_ledger_table::parse_table_update(table_update)?),
|
||||
"puzzle_agent_message" => db_update.puzzle_agent_message.append(puzzle_agent_message_table::parse_table_update(table_update)?),
|
||||
"puzzle_agent_session" => db_update.puzzle_agent_session.append(puzzle_agent_session_table::parse_table_update(table_update)?),
|
||||
"puzzle_runtime_run" => db_update.puzzle_runtime_run.append(puzzle_runtime_run_table::parse_table_update(table_update)?),
|
||||
"puzzle_work_profile" => db_update.puzzle_work_profile.append(puzzle_work_profile_table::parse_table_update(table_update)?),
|
||||
"quest_log" => db_update.quest_log.append(quest_log_table::parse_table_update(table_update)?),
|
||||
"quest_record" => db_update.quest_record.append(quest_record_table::parse_table_update(table_update)?),
|
||||
"refresh_session" => db_update.refresh_session.append(refresh_session_table::parse_table_update(table_update)?),
|
||||
"runtime_setting" => db_update.runtime_setting.append(runtime_setting_table::parse_table_update(table_update)?),
|
||||
"runtime_snapshot" => db_update.runtime_snapshot.append(runtime_snapshot_table::parse_table_update(table_update)?),
|
||||
"story_event" => db_update.story_event.append(story_event_table::parse_table_update(table_update)?),
|
||||
"story_session" => db_update.story_session.append(story_session_table::parse_table_update(table_update)?),
|
||||
"treasure_record" => db_update.treasure_record.append(treasure_record_table::parse_table_update(table_update)?),
|
||||
"user_account" => db_update.user_account.append(user_account_table::parse_table_update(table_update)?),
|
||||
"user_browse_history" => db_update.user_browse_history.append(user_browse_history_table::parse_table_update(table_update)?),
|
||||
"custom_world_gallery_entry" => db_update.custom_world_gallery_entry.append(custom_world_gallery_entry_table::parse_table_update(table_update)?),
|
||||
|
||||
unknown => {
|
||||
return Err(__sdk::InternalError::unknown_name(
|
||||
@@ -1388,52 +1216,7 @@ impl __sdk::DbUpdate for DbUpdate {
|
||||
fn apply_to_client_cache(&self, cache: &mut __sdk::ClientCache<RemoteModule>) -> AppliedDiff<'_> {
|
||||
let mut diff = AppliedDiff::default();
|
||||
|
||||
diff.ai_result_reference = cache.apply_diff_to_table::<AiResultReference>("ai_result_reference", &self.ai_result_reference).with_updates_by_pk(|row| &row.result_reference_row_id);
|
||||
diff.ai_task = cache.apply_diff_to_table::<AiTask>("ai_task", &self.ai_task).with_updates_by_pk(|row| &row.task_id);
|
||||
diff.ai_task_stage = cache.apply_diff_to_table::<AiTaskStage>("ai_task_stage", &self.ai_task_stage).with_updates_by_pk(|row| &row.task_stage_id);
|
||||
diff.ai_text_chunk = cache.apply_diff_to_table::<AiTextChunk>("ai_text_chunk", &self.ai_text_chunk).with_updates_by_pk(|row| &row.text_chunk_row_id);
|
||||
diff.asset_entity_binding = cache.apply_diff_to_table::<AssetEntityBinding>("asset_entity_binding", &self.asset_entity_binding).with_updates_by_pk(|row| &row.binding_id);
|
||||
diff.asset_object = cache.apply_diff_to_table::<AssetObject>("asset_object", &self.asset_object).with_updates_by_pk(|row| &row.asset_object_id);
|
||||
diff.auth_identity = cache.apply_diff_to_table::<AuthIdentity>("auth_identity", &self.auth_identity).with_updates_by_pk(|row| &row.identity_id);
|
||||
diff.auth_store_snapshot = cache.apply_diff_to_table::<AuthStoreSnapshot>("auth_store_snapshot", &self.auth_store_snapshot).with_updates_by_pk(|row| &row.snapshot_id);
|
||||
diff.battle_state = cache.apply_diff_to_table::<BattleState>("battle_state", &self.battle_state).with_updates_by_pk(|row| &row.battle_state_id);
|
||||
diff.big_fish_agent_message = cache.apply_diff_to_table::<BigFishAgentMessage>("big_fish_agent_message", &self.big_fish_agent_message).with_updates_by_pk(|row| &row.message_id);
|
||||
diff.big_fish_asset_slot = cache.apply_diff_to_table::<BigFishAssetSlot>("big_fish_asset_slot", &self.big_fish_asset_slot).with_updates_by_pk(|row| &row.slot_id);
|
||||
diff.big_fish_creation_session = cache.apply_diff_to_table::<BigFishCreationSession>("big_fish_creation_session", &self.big_fish_creation_session).with_updates_by_pk(|row| &row.session_id);
|
||||
diff.big_fish_runtime_run = cache.apply_diff_to_table::<BigFishRuntimeRun>("big_fish_runtime_run", &self.big_fish_runtime_run).with_updates_by_pk(|row| &row.run_id);
|
||||
diff.chapter_progression = cache.apply_diff_to_table::<ChapterProgression>("chapter_progression", &self.chapter_progression).with_updates_by_pk(|row| &row.chapter_progression_id);
|
||||
diff.custom_world_agent_message = cache.apply_diff_to_table::<CustomWorldAgentMessage>("custom_world_agent_message", &self.custom_world_agent_message).with_updates_by_pk(|row| &row.message_id);
|
||||
diff.custom_world_agent_operation = cache.apply_diff_to_table::<CustomWorldAgentOperation>("custom_world_agent_operation", &self.custom_world_agent_operation).with_updates_by_pk(|row| &row.operation_id);
|
||||
diff.custom_world_agent_session = cache.apply_diff_to_table::<CustomWorldAgentSession>("custom_world_agent_session", &self.custom_world_agent_session).with_updates_by_pk(|row| &row.session_id);
|
||||
diff.custom_world_draft_card = cache.apply_diff_to_table::<CustomWorldDraftCard>("custom_world_draft_card", &self.custom_world_draft_card).with_updates_by_pk(|row| &row.card_id);
|
||||
diff.custom_world_gallery_entry = cache.apply_diff_to_table::<CustomWorldGalleryEntry>("custom_world_gallery_entry", &self.custom_world_gallery_entry).with_updates_by_pk(|row| &row.profile_id);
|
||||
diff.custom_world_profile = cache.apply_diff_to_table::<CustomWorldProfile>("custom_world_profile", &self.custom_world_profile).with_updates_by_pk(|row| &row.profile_id);
|
||||
diff.custom_world_session = cache.apply_diff_to_table::<CustomWorldSession>("custom_world_session", &self.custom_world_session).with_updates_by_pk(|row| &row.session_id);
|
||||
diff.inventory_slot = cache.apply_diff_to_table::<InventorySlot>("inventory_slot", &self.inventory_slot).with_updates_by_pk(|row| &row.slot_id);
|
||||
diff.npc_state = cache.apply_diff_to_table::<NpcState>("npc_state", &self.npc_state).with_updates_by_pk(|row| &row.npc_state_id);
|
||||
diff.player_progression = cache.apply_diff_to_table::<PlayerProgression>("player_progression", &self.player_progression).with_updates_by_pk(|row| &row.user_id);
|
||||
diff.profile_dashboard_state = cache.apply_diff_to_table::<ProfileDashboardState>("profile_dashboard_state", &self.profile_dashboard_state).with_updates_by_pk(|row| &row.user_id);
|
||||
diff.profile_invite_code = cache.apply_diff_to_table::<ProfileInviteCode>("profile_invite_code", &self.profile_invite_code).with_updates_by_pk(|row| &row.user_id);
|
||||
diff.profile_membership = cache.apply_diff_to_table::<ProfileMembership>("profile_membership", &self.profile_membership).with_updates_by_pk(|row| &row.user_id);
|
||||
diff.profile_played_world = cache.apply_diff_to_table::<ProfilePlayedWorld>("profile_played_world", &self.profile_played_world).with_updates_by_pk(|row| &row.played_world_id);
|
||||
diff.profile_recharge_order = cache.apply_diff_to_table::<ProfileRechargeOrder>("profile_recharge_order", &self.profile_recharge_order).with_updates_by_pk(|row| &row.order_id);
|
||||
diff.profile_referral_relation = cache.apply_diff_to_table::<ProfileReferralRelation>("profile_referral_relation", &self.profile_referral_relation).with_updates_by_pk(|row| &row.invitee_user_id);
|
||||
diff.profile_save_archive = cache.apply_diff_to_table::<ProfileSaveArchive>("profile_save_archive", &self.profile_save_archive).with_updates_by_pk(|row| &row.archive_id);
|
||||
diff.profile_wallet_ledger = cache.apply_diff_to_table::<ProfileWalletLedger>("profile_wallet_ledger", &self.profile_wallet_ledger).with_updates_by_pk(|row| &row.wallet_ledger_id);
|
||||
diff.puzzle_agent_message = cache.apply_diff_to_table::<PuzzleAgentMessageRow>("puzzle_agent_message", &self.puzzle_agent_message).with_updates_by_pk(|row| &row.message_id);
|
||||
diff.puzzle_agent_session = cache.apply_diff_to_table::<PuzzleAgentSessionRow>("puzzle_agent_session", &self.puzzle_agent_session).with_updates_by_pk(|row| &row.session_id);
|
||||
diff.puzzle_runtime_run = cache.apply_diff_to_table::<PuzzleRuntimeRunRow>("puzzle_runtime_run", &self.puzzle_runtime_run).with_updates_by_pk(|row| &row.run_id);
|
||||
diff.puzzle_work_profile = cache.apply_diff_to_table::<PuzzleWorkProfileRow>("puzzle_work_profile", &self.puzzle_work_profile).with_updates_by_pk(|row| &row.profile_id);
|
||||
diff.quest_log = cache.apply_diff_to_table::<QuestLog>("quest_log", &self.quest_log).with_updates_by_pk(|row| &row.log_id);
|
||||
diff.quest_record = cache.apply_diff_to_table::<QuestRecord>("quest_record", &self.quest_record).with_updates_by_pk(|row| &row.quest_id);
|
||||
diff.refresh_session = cache.apply_diff_to_table::<RefreshSession>("refresh_session", &self.refresh_session).with_updates_by_pk(|row| &row.session_id);
|
||||
diff.runtime_setting = cache.apply_diff_to_table::<RuntimeSetting>("runtime_setting", &self.runtime_setting).with_updates_by_pk(|row| &row.user_id);
|
||||
diff.runtime_snapshot = cache.apply_diff_to_table::<RuntimeSnapshotRow>("runtime_snapshot", &self.runtime_snapshot).with_updates_by_pk(|row| &row.user_id);
|
||||
diff.story_event = cache.apply_diff_to_table::<StoryEvent>("story_event", &self.story_event).with_updates_by_pk(|row| &row.event_id);
|
||||
diff.story_session = cache.apply_diff_to_table::<StorySession>("story_session", &self.story_session).with_updates_by_pk(|row| &row.story_session_id);
|
||||
diff.treasure_record = cache.apply_diff_to_table::<TreasureRecord>("treasure_record", &self.treasure_record).with_updates_by_pk(|row| &row.treasure_record_id);
|
||||
diff.user_account = cache.apply_diff_to_table::<UserAccount>("user_account", &self.user_account).with_updates_by_pk(|row| &row.user_id);
|
||||
diff.user_browse_history = cache.apply_diff_to_table::<UserBrowseHistory>("user_browse_history", &self.user_browse_history).with_updates_by_pk(|row| &row.browse_history_id);
|
||||
diff.custom_world_gallery_entry = cache.apply_diff_to_table::<CustomWorldGalleryEntry>("custom_world_gallery_entry", &self.custom_world_gallery_entry).with_updates_by_pk(|row| &row.profile_id);
|
||||
|
||||
diff
|
||||
}
|
||||
@@ -1441,52 +1224,7 @@ fn parse_initial_rows(raw: __ws::v2::QueryRows) -> __sdk::Result<Self> {
|
||||
let mut db_update = DbUpdate::default();
|
||||
for table_rows in raw.tables {
|
||||
match &table_rows.table[..] {
|
||||
"ai_result_reference" => db_update.ai_result_reference.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"ai_task" => db_update.ai_task.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"ai_task_stage" => db_update.ai_task_stage.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"ai_text_chunk" => db_update.ai_text_chunk.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"asset_entity_binding" => db_update.asset_entity_binding.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"asset_object" => db_update.asset_object.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"auth_identity" => db_update.auth_identity.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"auth_store_snapshot" => db_update.auth_store_snapshot.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"battle_state" => db_update.battle_state.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"big_fish_agent_message" => db_update.big_fish_agent_message.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"big_fish_asset_slot" => db_update.big_fish_asset_slot.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"big_fish_creation_session" => db_update.big_fish_creation_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"big_fish_runtime_run" => db_update.big_fish_runtime_run.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"chapter_progression" => db_update.chapter_progression.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"custom_world_agent_message" => db_update.custom_world_agent_message.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"custom_world_agent_operation" => db_update.custom_world_agent_operation.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"custom_world_agent_session" => db_update.custom_world_agent_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"custom_world_draft_card" => db_update.custom_world_draft_card.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"custom_world_gallery_entry" => db_update.custom_world_gallery_entry.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"custom_world_profile" => db_update.custom_world_profile.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"custom_world_session" => db_update.custom_world_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"inventory_slot" => db_update.inventory_slot.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"npc_state" => db_update.npc_state.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"player_progression" => db_update.player_progression.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_dashboard_state" => db_update.profile_dashboard_state.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_invite_code" => db_update.profile_invite_code.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_membership" => db_update.profile_membership.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_played_world" => db_update.profile_played_world.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_recharge_order" => db_update.profile_recharge_order.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_referral_relation" => db_update.profile_referral_relation.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_save_archive" => db_update.profile_save_archive.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"profile_wallet_ledger" => db_update.profile_wallet_ledger.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"puzzle_agent_message" => db_update.puzzle_agent_message.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"puzzle_agent_session" => db_update.puzzle_agent_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"puzzle_runtime_run" => db_update.puzzle_runtime_run.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"puzzle_work_profile" => db_update.puzzle_work_profile.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"quest_log" => db_update.quest_log.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"quest_record" => db_update.quest_record.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"refresh_session" => db_update.refresh_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"runtime_setting" => db_update.runtime_setting.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"runtime_snapshot" => db_update.runtime_snapshot.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"story_event" => db_update.story_event.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"story_session" => db_update.story_session.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"treasure_record" => db_update.treasure_record.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"user_account" => db_update.user_account.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"user_browse_history" => db_update.user_browse_history.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
"custom_world_gallery_entry" => db_update.custom_world_gallery_entry.append(__sdk::parse_row_list_as_inserts(table_rows.rows)?),
|
||||
unknown => { return Err(__sdk::InternalError::unknown_name("table", unknown, "QueryRows").into()); }
|
||||
}} Ok(db_update)
|
||||
}
|
||||
@@ -1494,52 +1232,7 @@ fn parse_unsubscribe_rows(raw: __ws::v2::QueryRows) -> __sdk::Result<Self> {
|
||||
let mut db_update = DbUpdate::default();
|
||||
for table_rows in raw.tables {
|
||||
match &table_rows.table[..] {
|
||||
"ai_result_reference" => db_update.ai_result_reference.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"ai_task" => db_update.ai_task.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"ai_task_stage" => db_update.ai_task_stage.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"ai_text_chunk" => db_update.ai_text_chunk.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"asset_entity_binding" => db_update.asset_entity_binding.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"asset_object" => db_update.asset_object.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"auth_identity" => db_update.auth_identity.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"auth_store_snapshot" => db_update.auth_store_snapshot.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"battle_state" => db_update.battle_state.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"big_fish_agent_message" => db_update.big_fish_agent_message.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"big_fish_asset_slot" => db_update.big_fish_asset_slot.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"big_fish_creation_session" => db_update.big_fish_creation_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"big_fish_runtime_run" => db_update.big_fish_runtime_run.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"chapter_progression" => db_update.chapter_progression.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"custom_world_agent_message" => db_update.custom_world_agent_message.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"custom_world_agent_operation" => db_update.custom_world_agent_operation.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"custom_world_agent_session" => db_update.custom_world_agent_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"custom_world_draft_card" => db_update.custom_world_draft_card.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"custom_world_gallery_entry" => db_update.custom_world_gallery_entry.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"custom_world_profile" => db_update.custom_world_profile.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"custom_world_session" => db_update.custom_world_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"inventory_slot" => db_update.inventory_slot.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"npc_state" => db_update.npc_state.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"player_progression" => db_update.player_progression.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_dashboard_state" => db_update.profile_dashboard_state.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_invite_code" => db_update.profile_invite_code.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_membership" => db_update.profile_membership.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_played_world" => db_update.profile_played_world.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_recharge_order" => db_update.profile_recharge_order.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_referral_relation" => db_update.profile_referral_relation.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_save_archive" => db_update.profile_save_archive.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"profile_wallet_ledger" => db_update.profile_wallet_ledger.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"puzzle_agent_message" => db_update.puzzle_agent_message.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"puzzle_agent_session" => db_update.puzzle_agent_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"puzzle_runtime_run" => db_update.puzzle_runtime_run.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"puzzle_work_profile" => db_update.puzzle_work_profile.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"quest_log" => db_update.quest_log.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"quest_record" => db_update.quest_record.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"refresh_session" => db_update.refresh_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"runtime_setting" => db_update.runtime_setting.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"runtime_snapshot" => db_update.runtime_snapshot.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"story_event" => db_update.story_event.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"story_session" => db_update.story_session.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"treasure_record" => db_update.treasure_record.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"user_account" => db_update.user_account.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"user_browse_history" => db_update.user_browse_history.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
"custom_world_gallery_entry" => db_update.custom_world_gallery_entry.append(__sdk::parse_row_list_as_deletes(table_rows.rows)?),
|
||||
unknown => { return Err(__sdk::InternalError::unknown_name("table", unknown, "QueryRows").into()); }
|
||||
}} Ok(db_update)
|
||||
}
|
||||
@@ -1549,52 +1242,7 @@ for table_rows in raw.tables {
|
||||
#[allow(non_snake_case)]
|
||||
#[doc(hidden)]
|
||||
pub struct AppliedDiff<'r> {
|
||||
ai_result_reference: __sdk::TableAppliedDiff<'r, AiResultReference>,
|
||||
ai_task: __sdk::TableAppliedDiff<'r, AiTask>,
|
||||
ai_task_stage: __sdk::TableAppliedDiff<'r, AiTaskStage>,
|
||||
ai_text_chunk: __sdk::TableAppliedDiff<'r, AiTextChunk>,
|
||||
asset_entity_binding: __sdk::TableAppliedDiff<'r, AssetEntityBinding>,
|
||||
asset_object: __sdk::TableAppliedDiff<'r, AssetObject>,
|
||||
auth_identity: __sdk::TableAppliedDiff<'r, AuthIdentity>,
|
||||
auth_store_snapshot: __sdk::TableAppliedDiff<'r, AuthStoreSnapshot>,
|
||||
battle_state: __sdk::TableAppliedDiff<'r, BattleState>,
|
||||
big_fish_agent_message: __sdk::TableAppliedDiff<'r, BigFishAgentMessage>,
|
||||
big_fish_asset_slot: __sdk::TableAppliedDiff<'r, BigFishAssetSlot>,
|
||||
big_fish_creation_session: __sdk::TableAppliedDiff<'r, BigFishCreationSession>,
|
||||
big_fish_runtime_run: __sdk::TableAppliedDiff<'r, BigFishRuntimeRun>,
|
||||
chapter_progression: __sdk::TableAppliedDiff<'r, ChapterProgression>,
|
||||
custom_world_agent_message: __sdk::TableAppliedDiff<'r, CustomWorldAgentMessage>,
|
||||
custom_world_agent_operation: __sdk::TableAppliedDiff<'r, CustomWorldAgentOperation>,
|
||||
custom_world_agent_session: __sdk::TableAppliedDiff<'r, CustomWorldAgentSession>,
|
||||
custom_world_draft_card: __sdk::TableAppliedDiff<'r, CustomWorldDraftCard>,
|
||||
custom_world_gallery_entry: __sdk::TableAppliedDiff<'r, CustomWorldGalleryEntry>,
|
||||
custom_world_profile: __sdk::TableAppliedDiff<'r, CustomWorldProfile>,
|
||||
custom_world_session: __sdk::TableAppliedDiff<'r, CustomWorldSession>,
|
||||
inventory_slot: __sdk::TableAppliedDiff<'r, InventorySlot>,
|
||||
npc_state: __sdk::TableAppliedDiff<'r, NpcState>,
|
||||
player_progression: __sdk::TableAppliedDiff<'r, PlayerProgression>,
|
||||
profile_dashboard_state: __sdk::TableAppliedDiff<'r, ProfileDashboardState>,
|
||||
profile_invite_code: __sdk::TableAppliedDiff<'r, ProfileInviteCode>,
|
||||
profile_membership: __sdk::TableAppliedDiff<'r, ProfileMembership>,
|
||||
profile_played_world: __sdk::TableAppliedDiff<'r, ProfilePlayedWorld>,
|
||||
profile_recharge_order: __sdk::TableAppliedDiff<'r, ProfileRechargeOrder>,
|
||||
profile_referral_relation: __sdk::TableAppliedDiff<'r, ProfileReferralRelation>,
|
||||
profile_save_archive: __sdk::TableAppliedDiff<'r, ProfileSaveArchive>,
|
||||
profile_wallet_ledger: __sdk::TableAppliedDiff<'r, ProfileWalletLedger>,
|
||||
puzzle_agent_message: __sdk::TableAppliedDiff<'r, PuzzleAgentMessageRow>,
|
||||
puzzle_agent_session: __sdk::TableAppliedDiff<'r, PuzzleAgentSessionRow>,
|
||||
puzzle_runtime_run: __sdk::TableAppliedDiff<'r, PuzzleRuntimeRunRow>,
|
||||
puzzle_work_profile: __sdk::TableAppliedDiff<'r, PuzzleWorkProfileRow>,
|
||||
quest_log: __sdk::TableAppliedDiff<'r, QuestLog>,
|
||||
quest_record: __sdk::TableAppliedDiff<'r, QuestRecord>,
|
||||
refresh_session: __sdk::TableAppliedDiff<'r, RefreshSession>,
|
||||
runtime_setting: __sdk::TableAppliedDiff<'r, RuntimeSetting>,
|
||||
runtime_snapshot: __sdk::TableAppliedDiff<'r, RuntimeSnapshotRow>,
|
||||
story_event: __sdk::TableAppliedDiff<'r, StoryEvent>,
|
||||
story_session: __sdk::TableAppliedDiff<'r, StorySession>,
|
||||
treasure_record: __sdk::TableAppliedDiff<'r, TreasureRecord>,
|
||||
user_account: __sdk::TableAppliedDiff<'r, UserAccount>,
|
||||
user_browse_history: __sdk::TableAppliedDiff<'r, UserBrowseHistory>,
|
||||
custom_world_gallery_entry: __sdk::TableAppliedDiff<'r, CustomWorldGalleryEntry>,
|
||||
__unused: std::marker::PhantomData<&'r ()>,
|
||||
}
|
||||
|
||||
@@ -1605,52 +1253,7 @@ impl __sdk::InModule for AppliedDiff<'_> {
|
||||
|
||||
impl<'r> __sdk::AppliedDiff<'r> for AppliedDiff<'r> {
|
||||
fn invoke_row_callbacks(&self, event: &EventContext, callbacks: &mut __sdk::DbCallbacks<RemoteModule>) {
|
||||
callbacks.invoke_table_row_callbacks::<AiResultReference>("ai_result_reference", &self.ai_result_reference, event);
|
||||
callbacks.invoke_table_row_callbacks::<AiTask>("ai_task", &self.ai_task, event);
|
||||
callbacks.invoke_table_row_callbacks::<AiTaskStage>("ai_task_stage", &self.ai_task_stage, event);
|
||||
callbacks.invoke_table_row_callbacks::<AiTextChunk>("ai_text_chunk", &self.ai_text_chunk, event);
|
||||
callbacks.invoke_table_row_callbacks::<AssetEntityBinding>("asset_entity_binding", &self.asset_entity_binding, event);
|
||||
callbacks.invoke_table_row_callbacks::<AssetObject>("asset_object", &self.asset_object, event);
|
||||
callbacks.invoke_table_row_callbacks::<AuthIdentity>("auth_identity", &self.auth_identity, event);
|
||||
callbacks.invoke_table_row_callbacks::<AuthStoreSnapshot>("auth_store_snapshot", &self.auth_store_snapshot, event);
|
||||
callbacks.invoke_table_row_callbacks::<BattleState>("battle_state", &self.battle_state, event);
|
||||
callbacks.invoke_table_row_callbacks::<BigFishAgentMessage>("big_fish_agent_message", &self.big_fish_agent_message, event);
|
||||
callbacks.invoke_table_row_callbacks::<BigFishAssetSlot>("big_fish_asset_slot", &self.big_fish_asset_slot, event);
|
||||
callbacks.invoke_table_row_callbacks::<BigFishCreationSession>("big_fish_creation_session", &self.big_fish_creation_session, event);
|
||||
callbacks.invoke_table_row_callbacks::<BigFishRuntimeRun>("big_fish_runtime_run", &self.big_fish_runtime_run, event);
|
||||
callbacks.invoke_table_row_callbacks::<ChapterProgression>("chapter_progression", &self.chapter_progression, event);
|
||||
callbacks.invoke_table_row_callbacks::<CustomWorldAgentMessage>("custom_world_agent_message", &self.custom_world_agent_message, event);
|
||||
callbacks.invoke_table_row_callbacks::<CustomWorldAgentOperation>("custom_world_agent_operation", &self.custom_world_agent_operation, event);
|
||||
callbacks.invoke_table_row_callbacks::<CustomWorldAgentSession>("custom_world_agent_session", &self.custom_world_agent_session, event);
|
||||
callbacks.invoke_table_row_callbacks::<CustomWorldDraftCard>("custom_world_draft_card", &self.custom_world_draft_card, event);
|
||||
callbacks.invoke_table_row_callbacks::<CustomWorldGalleryEntry>("custom_world_gallery_entry", &self.custom_world_gallery_entry, event);
|
||||
callbacks.invoke_table_row_callbacks::<CustomWorldProfile>("custom_world_profile", &self.custom_world_profile, event);
|
||||
callbacks.invoke_table_row_callbacks::<CustomWorldSession>("custom_world_session", &self.custom_world_session, event);
|
||||
callbacks.invoke_table_row_callbacks::<InventorySlot>("inventory_slot", &self.inventory_slot, event);
|
||||
callbacks.invoke_table_row_callbacks::<NpcState>("npc_state", &self.npc_state, event);
|
||||
callbacks.invoke_table_row_callbacks::<PlayerProgression>("player_progression", &self.player_progression, event);
|
||||
callbacks.invoke_table_row_callbacks::<ProfileDashboardState>("profile_dashboard_state", &self.profile_dashboard_state, event);
|
||||
callbacks.invoke_table_row_callbacks::<ProfileInviteCode>("profile_invite_code", &self.profile_invite_code, event);
|
||||
callbacks.invoke_table_row_callbacks::<ProfileMembership>("profile_membership", &self.profile_membership, event);
|
||||
callbacks.invoke_table_row_callbacks::<ProfilePlayedWorld>("profile_played_world", &self.profile_played_world, event);
|
||||
callbacks.invoke_table_row_callbacks::<ProfileRechargeOrder>("profile_recharge_order", &self.profile_recharge_order, event);
|
||||
callbacks.invoke_table_row_callbacks::<ProfileReferralRelation>("profile_referral_relation", &self.profile_referral_relation, event);
|
||||
callbacks.invoke_table_row_callbacks::<ProfileSaveArchive>("profile_save_archive", &self.profile_save_archive, event);
|
||||
callbacks.invoke_table_row_callbacks::<ProfileWalletLedger>("profile_wallet_ledger", &self.profile_wallet_ledger, event);
|
||||
callbacks.invoke_table_row_callbacks::<PuzzleAgentMessageRow>("puzzle_agent_message", &self.puzzle_agent_message, event);
|
||||
callbacks.invoke_table_row_callbacks::<PuzzleAgentSessionRow>("puzzle_agent_session", &self.puzzle_agent_session, event);
|
||||
callbacks.invoke_table_row_callbacks::<PuzzleRuntimeRunRow>("puzzle_runtime_run", &self.puzzle_runtime_run, event);
|
||||
callbacks.invoke_table_row_callbacks::<PuzzleWorkProfileRow>("puzzle_work_profile", &self.puzzle_work_profile, event);
|
||||
callbacks.invoke_table_row_callbacks::<QuestLog>("quest_log", &self.quest_log, event);
|
||||
callbacks.invoke_table_row_callbacks::<QuestRecord>("quest_record", &self.quest_record, event);
|
||||
callbacks.invoke_table_row_callbacks::<RefreshSession>("refresh_session", &self.refresh_session, event);
|
||||
callbacks.invoke_table_row_callbacks::<RuntimeSetting>("runtime_setting", &self.runtime_setting, event);
|
||||
callbacks.invoke_table_row_callbacks::<RuntimeSnapshotRow>("runtime_snapshot", &self.runtime_snapshot, event);
|
||||
callbacks.invoke_table_row_callbacks::<StoryEvent>("story_event", &self.story_event, event);
|
||||
callbacks.invoke_table_row_callbacks::<StorySession>("story_session", &self.story_session, event);
|
||||
callbacks.invoke_table_row_callbacks::<TreasureRecord>("treasure_record", &self.treasure_record, event);
|
||||
callbacks.invoke_table_row_callbacks::<UserAccount>("user_account", &self.user_account, event);
|
||||
callbacks.invoke_table_row_callbacks::<UserBrowseHistory>("user_browse_history", &self.user_browse_history, event);
|
||||
callbacks.invoke_table_row_callbacks::<CustomWorldGalleryEntry>("custom_world_gallery_entry", &self.custom_world_gallery_entry, event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2302,99 +1905,9 @@ impl __sdk::SpacetimeModule for RemoteModule {
|
||||
type QueryBuilder = __sdk::QueryBuilder;
|
||||
|
||||
fn register_tables(client_cache: &mut __sdk::ClientCache<Self>) {
|
||||
ai_result_reference_table::register_table(client_cache);
|
||||
ai_task_table::register_table(client_cache);
|
||||
ai_task_stage_table::register_table(client_cache);
|
||||
ai_text_chunk_table::register_table(client_cache);
|
||||
asset_entity_binding_table::register_table(client_cache);
|
||||
asset_object_table::register_table(client_cache);
|
||||
auth_identity_table::register_table(client_cache);
|
||||
auth_store_snapshot_table::register_table(client_cache);
|
||||
battle_state_table::register_table(client_cache);
|
||||
big_fish_agent_message_table::register_table(client_cache);
|
||||
big_fish_asset_slot_table::register_table(client_cache);
|
||||
big_fish_creation_session_table::register_table(client_cache);
|
||||
big_fish_runtime_run_table::register_table(client_cache);
|
||||
chapter_progression_table::register_table(client_cache);
|
||||
custom_world_agent_message_table::register_table(client_cache);
|
||||
custom_world_agent_operation_table::register_table(client_cache);
|
||||
custom_world_agent_session_table::register_table(client_cache);
|
||||
custom_world_draft_card_table::register_table(client_cache);
|
||||
custom_world_gallery_entry_table::register_table(client_cache);
|
||||
custom_world_profile_table::register_table(client_cache);
|
||||
custom_world_session_table::register_table(client_cache);
|
||||
inventory_slot_table::register_table(client_cache);
|
||||
npc_state_table::register_table(client_cache);
|
||||
player_progression_table::register_table(client_cache);
|
||||
profile_dashboard_state_table::register_table(client_cache);
|
||||
profile_invite_code_table::register_table(client_cache);
|
||||
profile_membership_table::register_table(client_cache);
|
||||
profile_played_world_table::register_table(client_cache);
|
||||
profile_recharge_order_table::register_table(client_cache);
|
||||
profile_referral_relation_table::register_table(client_cache);
|
||||
profile_save_archive_table::register_table(client_cache);
|
||||
profile_wallet_ledger_table::register_table(client_cache);
|
||||
puzzle_agent_message_table::register_table(client_cache);
|
||||
puzzle_agent_session_table::register_table(client_cache);
|
||||
puzzle_runtime_run_table::register_table(client_cache);
|
||||
puzzle_work_profile_table::register_table(client_cache);
|
||||
quest_log_table::register_table(client_cache);
|
||||
quest_record_table::register_table(client_cache);
|
||||
refresh_session_table::register_table(client_cache);
|
||||
runtime_setting_table::register_table(client_cache);
|
||||
runtime_snapshot_table::register_table(client_cache);
|
||||
story_event_table::register_table(client_cache);
|
||||
story_session_table::register_table(client_cache);
|
||||
treasure_record_table::register_table(client_cache);
|
||||
user_account_table::register_table(client_cache);
|
||||
user_browse_history_table::register_table(client_cache);
|
||||
custom_world_gallery_entry_table::register_table(client_cache);
|
||||
}
|
||||
const ALL_TABLE_NAMES: &'static [&'static str] = &[
|
||||
"ai_result_reference",
|
||||
"ai_task",
|
||||
"ai_task_stage",
|
||||
"ai_text_chunk",
|
||||
"asset_entity_binding",
|
||||
"asset_object",
|
||||
"auth_identity",
|
||||
"auth_store_snapshot",
|
||||
"battle_state",
|
||||
"big_fish_agent_message",
|
||||
"big_fish_asset_slot",
|
||||
"big_fish_creation_session",
|
||||
"big_fish_runtime_run",
|
||||
"chapter_progression",
|
||||
"custom_world_agent_message",
|
||||
"custom_world_agent_operation",
|
||||
"custom_world_agent_session",
|
||||
"custom_world_draft_card",
|
||||
"custom_world_gallery_entry",
|
||||
"custom_world_profile",
|
||||
"custom_world_session",
|
||||
"inventory_slot",
|
||||
"npc_state",
|
||||
"player_progression",
|
||||
"profile_dashboard_state",
|
||||
"profile_invite_code",
|
||||
"profile_membership",
|
||||
"profile_played_world",
|
||||
"profile_recharge_order",
|
||||
"profile_referral_relation",
|
||||
"profile_save_archive",
|
||||
"profile_wallet_ledger",
|
||||
"puzzle_agent_message",
|
||||
"puzzle_agent_session",
|
||||
"puzzle_runtime_run",
|
||||
"puzzle_work_profile",
|
||||
"quest_log",
|
||||
"quest_record",
|
||||
"refresh_session",
|
||||
"runtime_setting",
|
||||
"runtime_snapshot",
|
||||
"story_event",
|
||||
"story_session",
|
||||
"treasure_record",
|
||||
"user_account",
|
||||
"user_browse_history",
|
||||
"custom_world_gallery_entry",
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::npc_state_type::NpcState;
|
||||
use super::npc_relation_state_type::NpcRelationState;
|
||||
use super::npc_stance_profile_type::NpcStanceProfile;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::player_progression_type::PlayerProgression;
|
||||
use super::player_progression_grant_source_type::PlayerProgressionGrantSource;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// 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::profile_dashboard_state_type::ProfileDashboardState;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,194 +0,0 @@
|
||||
// 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::profile_invite_code_type::ProfileInviteCode;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::profile_membership_type::ProfileMembership;
|
||||
use super::runtime_profile_membership_status_type::RuntimeProfileMembershipStatus;
|
||||
use super::runtime_profile_membership_tier_type::RuntimeProfileMembershipTier;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// 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::profile_played_world_type::ProfilePlayedWorld;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::profile_recharge_order_type::ProfileRechargeOrder;
|
||||
use super::runtime_profile_recharge_product_kind_type::RuntimeProfileRechargeProductKind;
|
||||
use super::runtime_profile_recharge_order_status_type::RuntimeProfileRechargeOrderStatus;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// 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::profile_referral_relation_type::ProfileReferralRelation;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// 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::profile_save_archive_type::ProfileSaveArchive;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::profile_wallet_ledger_type::ProfileWalletLedger;
|
||||
use super::runtime_profile_wallet_ledger_source_type_type::RuntimeProfileWalletLedgerSourceType;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::puzzle_agent_message_row_type::PuzzleAgentMessageRow;
|
||||
use super::puzzle_agent_message_role_type::PuzzleAgentMessageRole;
|
||||
use super::puzzle_agent_message_kind_type::PuzzleAgentMessageKind;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::puzzle_agent_session_row_type::PuzzleAgentSessionRow;
|
||||
use super::puzzle_agent_stage_type::PuzzleAgentStage;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// 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::puzzle_runtime_run_row_type::PuzzleRuntimeRunRow;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::puzzle_work_profile_row_type::PuzzleWorkProfileRow;
|
||||
use super::puzzle_publication_status_type::PuzzlePublicationStatus;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,167 +0,0 @@
|
||||
// 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::quest_log_type::QuestLog;
|
||||
use super::quest_status_type::QuestStatus;
|
||||
use super::quest_progress_signal_type::QuestProgressSignal;
|
||||
use super::quest_log_event_kind_type::QuestLogEventKind;
|
||||
use super::quest_signal_kind_type::QuestSignalKind;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,168 +0,0 @@
|
||||
// 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::quest_record_type::QuestRecord;
|
||||
use super::quest_status_type::QuestStatus;
|
||||
use super::quest_reward_snapshot_type::QuestRewardSnapshot;
|
||||
use super::quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot;
|
||||
use super::quest_step_snapshot_type::QuestStepSnapshot;
|
||||
use super::quest_objective_snapshot_type::QuestObjectiveSnapshot;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// 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::refresh_session_type::RefreshSession;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::runtime_setting_type::RuntimeSetting;
|
||||
use super::runtime_platform_theme_type::RuntimePlatformTheme;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// 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::runtime_snapshot_row_type::RuntimeSnapshotRow;
|
||||
|
||||
/// 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")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::story_event_type::StoryEvent;
|
||||
use super::story_event_kind_type::StoryEventKind;
|
||||
|
||||
/// Table handle for the table `story_event`.
|
||||
///
|
||||
/// Obtain a handle from the [`StoryEventTableAccess::story_event`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.story_event()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.story_event().on_insert(...)`.
|
||||
pub struct StoryEventTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<StoryEvent>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `story_event`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait StoryEventTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`StoryEventTableHandle`], which mediates access to the table `story_event`.
|
||||
fn story_event(&self) -> StoryEventTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl StoryEventTableAccess for super::RemoteTables {
|
||||
fn story_event(&self) -> StoryEventTableHandle<'_> {
|
||||
StoryEventTableHandle {
|
||||
imp: self.imp.get_table::<StoryEvent>("story_event"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct StoryEventInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct StoryEventDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for StoryEventTableHandle<'ctx> {
|
||||
type Row = StoryEvent;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = StoryEvent> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = StoryEventInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> StoryEventInsertCallbackId {
|
||||
StoryEventInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: StoryEventInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = StoryEventDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> StoryEventDeleteCallbackId {
|
||||
StoryEventDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: StoryEventDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct StoryEventUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for StoryEventTableHandle<'ctx> {
|
||||
type UpdateCallbackId = StoryEventUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> StoryEventUpdateCallbackId {
|
||||
StoryEventUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: StoryEventUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `event_id` unique index on the table `story_event`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`StoryEventEventIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.story_event().event_id().find(...)`.
|
||||
pub struct StoryEventEventIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<StoryEvent, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> StoryEventTableHandle<'ctx> {
|
||||
/// Get a handle on the `event_id` unique index on the table `story_event`.
|
||||
pub fn event_id(&self) -> StoryEventEventIdUnique<'ctx> {
|
||||
StoryEventEventIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("event_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> StoryEventEventIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `event_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<StoryEvent> {
|
||||
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::<StoryEvent>("story_event");
|
||||
_table.add_unique_constraint::<String>("event_id", |row| &row.event_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<StoryEvent>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<StoryEvent>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `StoryEvent`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait story_eventQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `StoryEvent`.
|
||||
fn story_event(&self) -> __sdk::__query_builder::Table<StoryEvent>;
|
||||
}
|
||||
|
||||
impl story_eventQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn story_event(&self) -> __sdk::__query_builder::Table<StoryEvent> {
|
||||
__sdk::__query_builder::Table::new("story_event")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::story_session_type::StorySession;
|
||||
use super::story_session_status_type::StorySessionStatus;
|
||||
|
||||
/// Table handle for the table `story_session`.
|
||||
///
|
||||
/// Obtain a handle from the [`StorySessionTableAccess::story_session`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.story_session()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.story_session().on_insert(...)`.
|
||||
pub struct StorySessionTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<StorySession>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `story_session`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait StorySessionTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`StorySessionTableHandle`], which mediates access to the table `story_session`.
|
||||
fn story_session(&self) -> StorySessionTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl StorySessionTableAccess for super::RemoteTables {
|
||||
fn story_session(&self) -> StorySessionTableHandle<'_> {
|
||||
StorySessionTableHandle {
|
||||
imp: self.imp.get_table::<StorySession>("story_session"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct StorySessionInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct StorySessionDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for StorySessionTableHandle<'ctx> {
|
||||
type Row = StorySession;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = StorySession> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = StorySessionInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> StorySessionInsertCallbackId {
|
||||
StorySessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: StorySessionInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = StorySessionDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> StorySessionDeleteCallbackId {
|
||||
StorySessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: StorySessionDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct StorySessionUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for StorySessionTableHandle<'ctx> {
|
||||
type UpdateCallbackId = StorySessionUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> StorySessionUpdateCallbackId {
|
||||
StorySessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: StorySessionUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `story_session_id` unique index on the table `story_session`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`StorySessionStorySessionIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.story_session().story_session_id().find(...)`.
|
||||
pub struct StorySessionStorySessionIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<StorySession, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> StorySessionTableHandle<'ctx> {
|
||||
/// Get a handle on the `story_session_id` unique index on the table `story_session`.
|
||||
pub fn story_session_id(&self) -> StorySessionStorySessionIdUnique<'ctx> {
|
||||
StorySessionStorySessionIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("story_session_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> StorySessionStorySessionIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `story_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<StorySession> {
|
||||
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::<StorySession>("story_session");
|
||||
_table.add_unique_constraint::<String>("story_session_id", |row| &row.story_session_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<StorySession>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<StorySession>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `StorySession`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait story_sessionQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `StorySession`.
|
||||
fn story_session(&self) -> __sdk::__query_builder::Table<StorySession>;
|
||||
}
|
||||
|
||||
impl story_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn story_session(&self) -> __sdk::__query_builder::Table<StorySession> {
|
||||
__sdk::__query_builder::Table::new("story_session")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
// 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::treasure_record_type::TreasureRecord;
|
||||
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||
use super::treasure_interaction_action_type::TreasureInteractionAction;
|
||||
|
||||
/// Table handle for the table `treasure_record`.
|
||||
///
|
||||
/// Obtain a handle from the [`TreasureRecordTableAccess::treasure_record`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.treasure_record()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.treasure_record().on_insert(...)`.
|
||||
pub struct TreasureRecordTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<TreasureRecord>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `treasure_record`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait TreasureRecordTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`TreasureRecordTableHandle`], which mediates access to the table `treasure_record`.
|
||||
fn treasure_record(&self) -> TreasureRecordTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl TreasureRecordTableAccess for super::RemoteTables {
|
||||
fn treasure_record(&self) -> TreasureRecordTableHandle<'_> {
|
||||
TreasureRecordTableHandle {
|
||||
imp: self.imp.get_table::<TreasureRecord>("treasure_record"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TreasureRecordInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct TreasureRecordDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for TreasureRecordTableHandle<'ctx> {
|
||||
type Row = TreasureRecord;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = TreasureRecord> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = TreasureRecordInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> TreasureRecordInsertCallbackId {
|
||||
TreasureRecordInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: TreasureRecordInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = TreasureRecordDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> TreasureRecordDeleteCallbackId {
|
||||
TreasureRecordDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: TreasureRecordDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct TreasureRecordUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for TreasureRecordTableHandle<'ctx> {
|
||||
type UpdateCallbackId = TreasureRecordUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> TreasureRecordUpdateCallbackId {
|
||||
TreasureRecordUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: TreasureRecordUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `treasure_record_id` unique index on the table `treasure_record`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`TreasureRecordTreasureRecordIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.treasure_record().treasure_record_id().find(...)`.
|
||||
pub struct TreasureRecordTreasureRecordIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<TreasureRecord, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> TreasureRecordTableHandle<'ctx> {
|
||||
/// Get a handle on the `treasure_record_id` unique index on the table `treasure_record`.
|
||||
pub fn treasure_record_id(&self) -> TreasureRecordTreasureRecordIdUnique<'ctx> {
|
||||
TreasureRecordTreasureRecordIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("treasure_record_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> TreasureRecordTreasureRecordIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `treasure_record_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<TreasureRecord> {
|
||||
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::<TreasureRecord>("treasure_record");
|
||||
_table.add_unique_constraint::<String>("treasure_record_id", |row| &row.treasure_record_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<TreasureRecord>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<TreasureRecord>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `TreasureRecord`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait treasure_recordQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `TreasureRecord`.
|
||||
fn treasure_record(&self) -> __sdk::__query_builder::Table<TreasureRecord>;
|
||||
}
|
||||
|
||||
impl treasure_recordQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn treasure_record(&self) -> __sdk::__query_builder::Table<TreasureRecord> {
|
||||
__sdk::__query_builder::Table::new("treasure_record")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,163 +0,0 @@
|
||||
// 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::user_account_type::UserAccount;
|
||||
|
||||
/// Table handle for the table `user_account`.
|
||||
///
|
||||
/// Obtain a handle from the [`UserAccountTableAccess::user_account`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.user_account()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.user_account().on_insert(...)`.
|
||||
pub struct UserAccountTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<UserAccount>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `user_account`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait UserAccountTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`UserAccountTableHandle`], which mediates access to the table `user_account`.
|
||||
fn user_account(&self) -> UserAccountTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl UserAccountTableAccess for super::RemoteTables {
|
||||
fn user_account(&self) -> UserAccountTableHandle<'_> {
|
||||
UserAccountTableHandle {
|
||||
imp: self.imp.get_table::<UserAccount>("user_account"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct UserAccountInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct UserAccountDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for UserAccountTableHandle<'ctx> {
|
||||
type Row = UserAccount;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = UserAccount> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = UserAccountInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> UserAccountInsertCallbackId {
|
||||
UserAccountInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: UserAccountInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = UserAccountDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> UserAccountDeleteCallbackId {
|
||||
UserAccountDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: UserAccountDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct UserAccountUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for UserAccountTableHandle<'ctx> {
|
||||
type UpdateCallbackId = UserAccountUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> UserAccountUpdateCallbackId {
|
||||
UserAccountUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: UserAccountUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `user_id` unique index on the table `user_account`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`UserAccountUserIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.user_account().user_id().find(...)`.
|
||||
pub struct UserAccountUserIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<UserAccount, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> UserAccountTableHandle<'ctx> {
|
||||
/// Get a handle on the `user_id` unique index on the table `user_account`.
|
||||
pub fn user_id(&self) -> UserAccountUserIdUnique<'ctx> {
|
||||
UserAccountUserIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("user_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> UserAccountUserIdUnique<'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<UserAccount> {
|
||||
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::<UserAccount>("user_account");
|
||||
_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<UserAccount>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<UserAccount>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `UserAccount`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait user_accountQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `UserAccount`.
|
||||
fn user_account(&self) -> __sdk::__query_builder::Table<UserAccount>;
|
||||
}
|
||||
|
||||
impl user_accountQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn user_account(&self) -> __sdk::__query_builder::Table<UserAccount> {
|
||||
__sdk::__query_builder::Table::new("user_account")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,164 +0,0 @@
|
||||
// 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::user_browse_history_type::UserBrowseHistory;
|
||||
use super::runtime_browse_history_theme_mode_type::RuntimeBrowseHistoryThemeMode;
|
||||
|
||||
/// Table handle for the table `user_browse_history`.
|
||||
///
|
||||
/// Obtain a handle from the [`UserBrowseHistoryTableAccess::user_browse_history`] method on [`super::RemoteTables`],
|
||||
/// like `ctx.db.user_browse_history()`.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.user_browse_history().on_insert(...)`.
|
||||
pub struct UserBrowseHistoryTableHandle<'ctx> {
|
||||
imp: __sdk::TableHandle<UserBrowseHistory>,
|
||||
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for access to the table `user_browse_history`.
|
||||
///
|
||||
/// Implemented for [`super::RemoteTables`].
|
||||
pub trait UserBrowseHistoryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Obtain a [`UserBrowseHistoryTableHandle`], which mediates access to the table `user_browse_history`.
|
||||
fn user_browse_history(&self) -> UserBrowseHistoryTableHandle<'_>;
|
||||
}
|
||||
|
||||
impl UserBrowseHistoryTableAccess for super::RemoteTables {
|
||||
fn user_browse_history(&self) -> UserBrowseHistoryTableHandle<'_> {
|
||||
UserBrowseHistoryTableHandle {
|
||||
imp: self.imp.get_table::<UserBrowseHistory>("user_browse_history"),
|
||||
ctx: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct UserBrowseHistoryInsertCallbackId(__sdk::CallbackId);
|
||||
pub struct UserBrowseHistoryDeleteCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::Table for UserBrowseHistoryTableHandle<'ctx> {
|
||||
type Row = UserBrowseHistory;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = UserBrowseHistory> + '_ { self.imp.iter() }
|
||||
|
||||
type InsertCallbackId = UserBrowseHistoryInsertCallbackId;
|
||||
|
||||
fn on_insert(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> UserBrowseHistoryInsertCallbackId {
|
||||
UserBrowseHistoryInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_insert(&self, callback: UserBrowseHistoryInsertCallbackId) {
|
||||
self.imp.remove_on_insert(callback.0)
|
||||
}
|
||||
|
||||
type DeleteCallbackId = UserBrowseHistoryDeleteCallbackId;
|
||||
|
||||
fn on_delete(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||
) -> UserBrowseHistoryDeleteCallbackId {
|
||||
UserBrowseHistoryDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_delete(&self, callback: UserBrowseHistoryDeleteCallbackId) {
|
||||
self.imp.remove_on_delete(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
pub struct UserBrowseHistoryUpdateCallbackId(__sdk::CallbackId);
|
||||
|
||||
impl<'ctx> __sdk::TableWithPrimaryKey for UserBrowseHistoryTableHandle<'ctx> {
|
||||
type UpdateCallbackId = UserBrowseHistoryUpdateCallbackId;
|
||||
|
||||
fn on_update(
|
||||
&self,
|
||||
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||
) -> UserBrowseHistoryUpdateCallbackId {
|
||||
UserBrowseHistoryUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||
}
|
||||
|
||||
fn remove_on_update(&self, callback: UserBrowseHistoryUpdateCallbackId) {
|
||||
self.imp.remove_on_update(callback.0)
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `browse_history_id` unique index on the table `user_browse_history`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`UserBrowseHistoryBrowseHistoryIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.user_browse_history().browse_history_id().find(...)`.
|
||||
pub struct UserBrowseHistoryBrowseHistoryIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<UserBrowseHistory, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> UserBrowseHistoryTableHandle<'ctx> {
|
||||
/// Get a handle on the `browse_history_id` unique index on the table `user_browse_history`.
|
||||
pub fn browse_history_id(&self) -> UserBrowseHistoryBrowseHistoryIdUnique<'ctx> {
|
||||
UserBrowseHistoryBrowseHistoryIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("browse_history_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> UserBrowseHistoryBrowseHistoryIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `browse_history_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<UserBrowseHistory> {
|
||||
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::<UserBrowseHistory>("user_browse_history");
|
||||
_table.add_unique_constraint::<String>("browse_history_id", |row| &row.browse_history_id);
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<UserBrowseHistory>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<UserBrowseHistory>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `UserBrowseHistory`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait user_browse_historyQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `UserBrowseHistory`.
|
||||
fn user_browse_history(&self) -> __sdk::__query_builder::Table<UserBrowseHistory>;
|
||||
}
|
||||
|
||||
impl user_browse_historyQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn user_browse_history(&self) -> __sdk::__query_builder::Table<UserBrowseHistory> {
|
||||
__sdk::__query_builder::Table::new("user_browse_history")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
use crate::*;
|
||||
|
||||
const ASSET_HISTORY_MAX_LIMIT: usize = 120;
|
||||
const ASSET_HISTORY_CHARACTER_VISUAL_KIND: &str = "character_visual";
|
||||
const ASSET_HISTORY_SCENE_IMAGE_KIND: &str = "scene_image";
|
||||
|
||||
#[spacetimedb::table(
|
||||
accessor = asset_object,
|
||||
index(accessor = by_bucket_object_key, btree(columns = [bucket, object_key]))
|
||||
@@ -54,6 +58,26 @@ pub fn confirm_asset_object_and_return(
|
||||
}
|
||||
}
|
||||
|
||||
// 历史素材只返回编辑器复用所需的脱敏字段,asset_object 本表继续保持 private。
|
||||
#[spacetimedb::procedure]
|
||||
pub fn list_asset_history_and_return(
|
||||
ctx: &mut ProcedureContext,
|
||||
input: AssetHistoryListInput,
|
||||
) -> AssetHistoryListResult {
|
||||
match ctx.try_with_tx(|tx| list_asset_history(tx, input.clone())) {
|
||||
Ok(entries) => AssetHistoryListResult {
|
||||
ok: true,
|
||||
entries,
|
||||
error_message: None,
|
||||
},
|
||||
Err(message) => AssetHistoryListResult {
|
||||
ok: false,
|
||||
entries: Vec::new(),
|
||||
error_message: Some(message),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn upsert_asset_object(
|
||||
ctx: &ReducerContext,
|
||||
input: AssetObjectUpsertInput,
|
||||
@@ -167,3 +191,52 @@ pub(crate) fn has_asset_object(ctx: &ReducerContext, asset_object_id: &str) -> b
|
||||
.iter()
|
||||
.any(|row| row.asset_object_id == asset_object_id)
|
||||
}
|
||||
|
||||
fn list_asset_history(
|
||||
ctx: &ReducerContext,
|
||||
input: AssetHistoryListInput,
|
||||
) -> Result<Vec<AssetHistoryEntrySnapshot>, String> {
|
||||
let asset_kind = input.asset_kind.trim();
|
||||
if asset_kind != ASSET_HISTORY_CHARACTER_VISUAL_KIND
|
||||
&& asset_kind != ASSET_HISTORY_SCENE_IMAGE_KIND
|
||||
{
|
||||
return Err("历史素材类型只支持 character_visual 或 scene_image".to_string());
|
||||
}
|
||||
|
||||
let limit = usize::try_from(input.limit)
|
||||
.unwrap_or(ASSET_HISTORY_MAX_LIMIT)
|
||||
.clamp(1, ASSET_HISTORY_MAX_LIMIT);
|
||||
let mut entries = ctx
|
||||
.db
|
||||
.asset_object()
|
||||
.iter()
|
||||
.filter(|row| row.asset_kind == asset_kind)
|
||||
.map(|row| AssetHistoryEntrySnapshot {
|
||||
asset_object_id: row.asset_object_id,
|
||||
asset_kind: row.asset_kind,
|
||||
image_src: object_key_to_legacy_image_src(row.object_key.as_str()),
|
||||
owner_user_id: row.owner_user_id,
|
||||
profile_id: row.profile_id,
|
||||
entity_id: row.entity_id,
|
||||
created_at_micros: row.created_at.to_micros_since_unix_epoch(),
|
||||
updated_at_micros: row.updated_at.to_micros_since_unix_epoch(),
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
entries.sort_by(|left, right| {
|
||||
right
|
||||
.created_at_micros
|
||||
.cmp(&left.created_at_micros)
|
||||
.then_with(|| right.asset_object_id.cmp(&left.asset_object_id))
|
||||
});
|
||||
entries.truncate(limit);
|
||||
Ok(entries)
|
||||
}
|
||||
|
||||
fn object_key_to_legacy_image_src(object_key: &str) -> String {
|
||||
let normalized = object_key.trim().trim_start_matches('/');
|
||||
if normalized.is_empty() {
|
||||
return String::new();
|
||||
}
|
||||
format!("/{normalized}")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user