From a7d492eea6f599e135a74713c724ee01d87ebfb6 Mon Sep 17 00:00:00 2001 From: kdletters Date: Thu, 23 Jul 2026 13:47:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=20SpacetimeDB=20=E8=87=B3=20?= =?UTF-8?q?2.7.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 统一 Rust 依赖、CLI、容器与部署产物到 2.7.0 hotfix3 重新生成 Rust bindings 并接入 2.7 capability traits 补齐本地 dev 与生产 provision 的 hotfix3 commit 门禁 更新 SpacetimeDB skills、运维文档与 MCP 验证口径 --- .codex/skills/spacetimedb-cli/SKILL.md | 35 +++++- .codex/skills/spacetimedb-concepts/SKILL.md | 28 +++-- .codex/skills/spacetimedb-rust/SKILL.md | 8 +- deploy/container/README.md | 4 +- deploy/container/docker-compose.loadtest.yml | 2 +- .../shared-memory/decision-log.md | 8 ++ .../shared-memory/project-overview.md | 4 +- ...】server-rs与SpacetimeDB数据契约-2026-05-15.md | 4 +- ...发运维】本地开发验证与生产运维-2026-05-15.md | 8 +- .../Jenkinsfile.production-server-provision | 9 +- scripts/check-admin-account-procedures.mjs | 2 +- scripts/check-server-provision-tools.sh | 87 +++++++++++++- scripts/container-worker-smoke.mjs | 2 +- scripts/dev.mjs | 113 ++++++++++++------ scripts/dev.test.ts | 57 ++++++++- scripts/prepare-server-provision-tools.sh | 21 +++- server-rs/Cargo.lock | 56 ++++----- server-rs/Cargo.toml | 6 +- .../spacetime-client/src/module_bindings.rs | 2 +- .../module_bindings/admin_account_table.rs | 69 +++++++++++ .../ai_result_reference_table.rs | 69 +++++++++++ .../module_bindings/ai_task_event_table.rs | 39 ++++++ .../module_bindings/ai_task_stage_table.rs | 69 +++++++++++ .../src/module_bindings/ai_task_table.rs | 69 +++++++++++ .../module_bindings/ai_text_chunk_table.rs | 69 +++++++++++ .../analytics_date_dimension_table.rs | 69 +++++++++++ .../asset_entity_binding_table.rs | 69 +++++++++++ .../src/module_bindings/asset_event_table.rs | 39 ++++++ .../src/module_bindings/asset_object_table.rs | 69 +++++++++++ ...asset_operation_wallet_settlement_table.rs | 69 +++++++++++ .../module_bindings/auth_identity_table.rs | 69 +++++++++++ .../auth_store_projection_meta_table.rs | 69 +++++++++++ .../bark_battle_draft_config_table.rs | 69 +++++++++++ .../bark_battle_leaderboard_entry_table.rs | 69 +++++++++++ ...k_battle_personal_best_projection_table.rs | 69 +++++++++++ .../bark_battle_published_config_table.rs | 69 +++++++++++ .../bark_battle_runtime_run_table.rs | 69 +++++++++++ .../bark_battle_score_record_table.rs | 69 +++++++++++ ...bark_battle_work_stats_projection_table.rs | 69 +++++++++++ .../src/module_bindings/battle_state_table.rs | 69 +++++++++++ .../big_fish_agent_message_table.rs | 69 +++++++++++ .../big_fish_asset_slot_table.rs | 69 +++++++++++ .../big_fish_creation_session_table.rs | 69 +++++++++++ .../module_bindings/big_fish_event_table.rs | 39 ++++++ .../big_fish_runtime_run_table.rs | 69 +++++++++++ .../chapter_progression_table.rs | 69 +++++++++++ .../creation_entry_config_table.rs | 69 +++++++++++ .../creation_entry_type_config_table.rs | 69 +++++++++++ .../custom_world_agent_message_table.rs | 69 +++++++++++ .../custom_world_agent_operation_table.rs | 69 +++++++++++ .../custom_world_agent_session_table.rs | 69 +++++++++++ .../custom_world_draft_card_table.rs | 69 +++++++++++ .../custom_world_gallery_entry_table.rs | 69 +++++++++++ .../custom_world_profile_table.rs | 69 +++++++++++ .../custom_world_session_table.rs | 69 +++++++++++ .../database_migration_import_chunk_table.rs | 69 +++++++++++ .../database_migration_operator_table.rs | 69 +++++++++++ .../editor_agent_conversation_table.rs | 69 +++++++++++ .../editor_asset_folder_table.rs | 69 +++++++++++ .../editor_asset_group_cohort_table.rs | 69 +++++++++++ ...tor_asset_group_source_provenance_table.rs | 69 +++++++++++ .../src/module_bindings/editor_asset_table.rs | 69 +++++++++++ .../editor_canvas_generation_dialog_table.rs | 69 +++++++++++ .../editor_canvas_layer_table.rs | 69 +++++++++++ .../editor_canvas_layout_migration_table.rs | 69 +++++++++++ .../module_bindings/editor_canvas_table.rs | 69 +++++++++++ .../editor_generation_pricing_config_table.rs | 69 +++++++++++ ...eration_runtime_identity_rotation_table.rs | 77 ++++++++++++ .../editor_project_resource_table.rs | 69 +++++++++++ .../module_bindings/editor_project_table.rs | 69 +++++++++++ .../editor_showcase_asset_like_table.rs | 69 +++++++++++ .../editor_showcase_asset_table.rs | 69 +++++++++++ .../editor_showcase_campaign_config_table.rs | 69 +++++++++++ .../module_bindings/external_api_key_table.rs | 69 +++++++++++ .../external_generation_job_event_table.rs | 69 +++++++++++ .../external_generation_job_summary_table.rs | 69 +++++++++++ .../external_generation_job_table.rs | 69 +++++++++++ .../feature_gate_config_table.rs | 69 +++++++++++ .../module_bindings/inventory_slot_table.rs | 69 +++++++++++ .../jump_hop_agent_session_table.rs | 69 +++++++++++ .../module_bindings/jump_hop_event_table.rs | 69 +++++++++++ .../jump_hop_leaderboard_entry_table.rs | 69 +++++++++++ .../jump_hop_runtime_run_table.rs | 69 +++++++++++ .../jump_hop_work_profile_table.rs | 69 +++++++++++ .../match_3_d_agent_message_table.rs | 69 +++++++++++ .../match_3_d_agent_session_table.rs | 69 +++++++++++ .../match_3_d_runtime_run_table.rs | 69 +++++++++++ .../match_3_d_work_profile_table.rs | 69 +++++++++++ .../src/module_bindings/npc_state_table.rs | 69 +++++++++++ .../player_progression_table.rs | 69 +++++++++++ .../profile_code_operation_table.rs | 69 +++++++++++ .../profile_daily_free_points_table.rs | 69 +++++++++++ .../profile_dashboard_state_table.rs | 69 +++++++++++ .../profile_feedback_submission_table.rs | 69 +++++++++++ .../profile_invite_code_table.rs | 69 +++++++++++ .../profile_membership_table.rs | 69 +++++++++++ .../profile_played_world_table.rs | 69 +++++++++++ ...echarge_order_expiration_schedule_table.rs | 77 ++++++++++++ ...e_recharge_order_expiration_timer_table.rs | 71 +++++++++++ ..._recharge_order_refund_settlement_table.rs | 71 +++++++++++ .../profile_recharge_order_table.rs | 69 +++++++++++ .../profile_recharge_product_config_table.rs | 69 +++++++++++ ...e_recharge_refund_bill_checkpoint_table.rs | 71 +++++++++++ .../profile_recharge_refund_hold_table.rs | 69 +++++++++++ ...ofile_recharge_refund_observation_table.rs | 69 +++++++++++ .../profile_recharge_refund_table.rs | 69 +++++++++++ .../profile_redeem_code_table.rs | 69 +++++++++++ .../profile_redeem_code_usage_table.rs | 69 +++++++++++ .../profile_referral_relation_table.rs | 69 +++++++++++ .../profile_save_archive_table.rs | 69 +++++++++++ .../profile_task_config_table.rs | 69 +++++++++++ .../profile_task_progress_table.rs | 69 +++++++++++ .../profile_task_reward_claim_table.rs | 69 +++++++++++ .../profile_wallet_config_table.rs | 69 +++++++++++ .../profile_wallet_ledger_table.rs | 69 +++++++++++ ...profile_wallet_manual_restriction_table.rs | 69 +++++++++++ .../module_bindings/public_work_like_table.rs | 69 +++++++++++ .../public_work_play_daily_stat_table.rs | 69 +++++++++++ .../puzzle_agent_message_table.rs | 69 +++++++++++ .../puzzle_agent_session_table.rs | 69 +++++++++++ .../puzzle_background_compile_task_table.rs | 69 +++++++++++ .../puzzle_clear_agent_session_table.rs | 69 +++++++++++ .../puzzle_clear_event_table.rs | 69 +++++++++++ .../puzzle_clear_runtime_run_table.rs | 69 +++++++++++ .../puzzle_clear_work_profile_table.rs | 69 +++++++++++ .../src/module_bindings/puzzle_event_table.rs | 39 ++++++ .../puzzle_leaderboard_entry_table.rs | 69 +++++++++++ .../puzzle_runtime_run_table.rs | 69 +++++++++++ .../puzzle_work_profile_table.rs | 69 +++++++++++ .../src/module_bindings/quest_log_table.rs | 69 +++++++++++ .../src/module_bindings/quest_record_table.rs | 69 +++++++++++ .../module_bindings/refresh_session_table.rs | 69 +++++++++++ .../module_bindings/runtime_setting_table.rs | 69 +++++++++++ .../module_bindings/runtime_snapshot_table.rs | 69 +++++++++++ .../square_hole_agent_message_table.rs | 69 +++++++++++ .../square_hole_agent_session_table.rs | 69 +++++++++++ .../square_hole_runtime_run_table.rs | 69 +++++++++++ .../square_hole_work_profile_table.rs | 69 +++++++++++ .../src/module_bindings/story_event_table.rs | 69 +++++++++++ .../module_bindings/story_session_table.rs | 69 +++++++++++ .../tracking_daily_stat_table.rs | 69 +++++++++++ .../module_bindings/tracking_event_table.rs | 69 +++++++++++ .../module_bindings/treasure_record_table.rs | 69 +++++++++++ .../src/module_bindings/user_account_table.rs | 69 +++++++++++ .../user_browse_history_table.rs | 69 +++++++++++ .../visual_novel_agent_message_table.rs | 69 +++++++++++ .../visual_novel_agent_session_table.rs | 69 +++++++++++ .../visual_novel_runtime_event_table.rs | 39 ++++++ ...isual_novel_runtime_history_entry_table.rs | 69 +++++++++++ .../visual_novel_runtime_run_table.rs | 69 +++++++++++ .../visual_novel_work_profile_table.rs | 69 +++++++++++ .../wooden_fish_agent_session_table.rs | 69 +++++++++++ .../wooden_fish_event_table.rs | 69 +++++++++++ .../wooden_fish_runtime_run_table.rs | 69 +++++++++++ .../wooden_fish_work_profile_table.rs | 69 +++++++++++ 155 files changed, 9602 insertions(+), 110 deletions(-) diff --git a/.codex/skills/spacetimedb-cli/SKILL.md b/.codex/skills/spacetimedb-cli/SKILL.md index a3d892458..73dac7168 100644 --- a/.codex/skills/spacetimedb-cli/SKILL.md +++ b/.codex/skills/spacetimedb-cli/SKILL.md @@ -1,6 +1,6 @@ --- name: spacetimedb-cli -description: SpacetimeDB 2.6 CLI reference for Genarrative. Use for spacetime build, publish, generate, call, sql, logs, server management, local dev, explicit server targeting, version checks, and remote runtime verification. +description: SpacetimeDB 2.7 CLI reference for Genarrative. Use for spacetime build, publish, generate, call, sql, logs, server management, local dev, explicit server targeting, version checks, and remote runtime verification. --- # SpacetimeDB CLI @@ -68,6 +68,31 @@ spacetime call --server http://127.0.0.1:3101 my-db reducer_needing_identity 0xa spacetime subscribe my-db "SELECT * FROM users" --num-updates 10 --server http://127.0.0.1:3101 ``` +## Standalone MCP Endpoint (2.7) + +SpacetimeDB 2.7 standalone exposes an authenticated JSON-RPC MCP endpoint at +`POST /v1/database/{name_or_identity}/mcp`. It advertises `ping`, `get_schema`, +`sql`, and `call`. The SQL and reducer tools execute with the bearer token's +identity, so keep routine smoke checks read-only. + +```bash +curl -fsS \ + -H "Authorization: Bearer ${SPACETIME_TOKEN}" \ + -H 'Content-Type: application/json' \ + --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"genarrative-smoke","version":"1.0.0"}}}' \ + http://127.0.0.1:3101/v1/database/my-db/mcp + +curl -fsS \ + -H "Authorization: Bearer ${SPACETIME_TOKEN}" \ + -H 'Content-Type: application/json' \ + --data '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"ping","arguments":{"message":"genarrative"}}}' \ + http://127.0.0.1:3101/v1/database/my-db/mcp +``` + +For repository upgrade validation, also call `tools/list` and the read-only +`get_schema` tool against an isolated local database. Do not use `sql` or `call` +for writes unless that mutation is explicitly in scope. + ## Server & Auth ```bash @@ -102,7 +127,7 @@ curl -fsS http://127.0.0.1:3101/v1/ping | Flag | Description | |------|-------------| | `--server`, `-s` | Target server nickname, host, or URL | -| `--yes`, `-y` | Non-interactive prompt skipping; in 2.6 use scoped values | +| `--yes`, `-y` | Non-interactive prompt skipping; in 2.6+ use scoped values | | `--delete-data`, `-c` | Publish data policy: `always`, `on-conflict`, or `never` | | `--module-path`, `-p` | Module project path | | `--bin-path`, `-b` | Publish/generate from compiled wasm | @@ -146,6 +171,8 @@ pid="$(systemctl show spacetimedb.service -p MainPID --value)" ## Notes -- Procedure calls remain stable in 2.6; module HTTP handlers/webhooks and RLS capabilities still require their documented gates. -- 2.5 fixed `publish --delete-data` config fallback; 2.6 keeps that behavior and improves CLI binary distribution. +- Procedure calls remain stable in 2.7; module HTTP handlers/webhooks and RLS capabilities still require their documented gates. +- 2.5 fixed `publish --delete-data` config fallback; 2.6 kept that behavior and improved CLI binary distribution; 2.7 adds `spacetime sql --format json` and database `lock` / `unlock`. +- The official 2.7.0 Linux release archives and container image currently use the `v2.7.0-hotfix3` asset tag while binaries report `2.7.0`; keep the asset tag distinct from the runtime version check. +- Do not assume `spacetime version install 2.7.0` selected hotfix3: stale updater metadata can install bare-tag commit `a08663c7...`. For the current release, verify CLI commit `d220349a...` and use the official hotfix3 archive or repository provision flow when it differs. - Genarrative scripts should pass `--server` or `--server-url` explicitly instead of relying on CLI defaults. diff --git a/.codex/skills/spacetimedb-concepts/SKILL.md b/.codex/skills/spacetimedb-concepts/SKILL.md index c17575687..e671603dd 100644 --- a/.codex/skills/spacetimedb-concepts/SKILL.md +++ b/.codex/skills/spacetimedb-concepts/SKILL.md @@ -1,6 +1,6 @@ --- name: spacetimedb-concepts -description: Understand SpacetimeDB 2.6 architecture, reducer/procedure/table/view semantics, schema evolution, subscriptions, identity, and Genarrative-specific backend boundaries. Use when designing or reviewing SpacetimeDB-backed features. +description: Understand SpacetimeDB 2.7 architecture, reducer/procedure/table/view semantics, schema evolution, subscriptions, identity, and Genarrative-specific backend boundaries. Use when designing or reviewing SpacetimeDB-backed features. --- # SpacetimeDB Core Concepts @@ -20,7 +20,7 @@ SpacetimeDB is a relational database that also executes application logic in upl 1. **Reducers are transactional**: they do not return data to callers. Read through subscriptions, read models, views, or BFF endpoints. 2. **Reducers are deterministic**: no filesystem, network, wall-clock, or external RNG. Use `ctx.timestamp`, `ctx.rng()` / `ctx.random()`, and tables. -3. **Procedures are stable in 2.6**: they can use explicit transactions and outgoing HTTP via `ctx.http`. +3. **Procedures are stable in 2.7**: they can use explicit transactions and outgoing HTTP via `ctx.http`. 4. **Identity comes from context**: use `ctx.sender()` or language equivalent for authorization. Never trust identity passed as an argument. 5. **Auto-increment IDs are not ordering guarantees**: gaps are normal. Use timestamps or explicit sequence columns for ordering. 6. **Schema changes need migration discipline**: existing Genarrative table fields must be appended with defaults; update migration code, table catalog, generated bindings, and run `npm run check:spacetime-schema`. @@ -44,25 +44,25 @@ Reducers are deterministic transactional functions. They are the primary client- ## Procedures -Procedures are stable in 2.6. They can be scheduled, can open explicit transactions with `with_tx` / `try_with_tx`, and can use outgoing HTTP (`ctx.http`). +Procedures are stable in 2.7. They can be scheduled, can open explicit transactions with `with_tx` / `try_with_tx`, and can use outgoing HTTP (`ctx.http`). Genarrative default: keep external provider protocols in `platform-*` and orchestration in `api-server` unless a task explicitly moves a workflow into a module procedure. -Module HTTP handlers/webhooks and RLS `client_visibility_filter` remain subject to their documented gates in 2.6. +Module HTTP handlers/webhooks and RLS `client_visibility_filter` remain subject to their documented gates in 2.7. ## Views -Views expose computed read-only data. SpacetimeDB 2.6 supports primary keys on procedural views in Rust, TypeScript, and C#. Clients can receive `OnUpdate` events when subscribed to such views with primary keys. Ensure the view never returns duplicate primary keys, because that can fail view refresh and roll back the triggering transaction. +Views expose computed read-only data. SpacetimeDB 2.7 supports primary keys on procedural views in Rust, TypeScript, C#, and C++. Clients can receive update events when subscribed to such views with primary keys. Ensure the view never returns duplicate primary keys, because that can fail view refresh and roll back the triggering transaction. ## Event Tables Event tables broadcast reducer/procedure-specific facts to subscribers and must be subscribed explicitly. They are excluded from `subscribe_to_all_tables()`. -2.6 supports broader layout-altering automigrations for event tables, including column removal, reordering, and type changes that regular tables reject. This relaxed migration behavior is for event-only tables, not persistent tables. +Since 2.6, event tables support broader layout-altering automigrations, including column removal, reordering, and type changes that regular tables reject. This relaxed migration behavior is for event-only tables, not persistent tables. Event-table primary keys and constraints are transaction-scoped. They can reject duplicate event rows within one transaction, but event rows are not retained in client cache, so clients observe event tables through insert callbacks only. Do not design Genarrative event tables around `OnUpdate` / `on_update` / `onUpdate`; use a persistent table or a primary-keyed procedural view when update callbacks are required. -Official 2.4.1 through 2.6 release notes document primary-key-backed update callbacks for procedural views, not event tables. +Official 2.4.1 through 2.7 release notes document primary-key-backed update callbacks for procedural views, not event tables. ## Subscriptions @@ -78,7 +78,18 @@ Best practices: - Avoid overlapping queries that duplicate row delivery. - Use indexes for subscribed filters. -## 2.2.0 to 2.6.1 Delta +## Standalone MCP + +SpacetimeDB 2.7 standalone exposes `POST /v1/database/{name_or_identity}/mcp` +using MCP JSON-RPC protocol `2025-06-18`. Its tools are `ping`, `get_schema`, +`sql`, and `call`; SQL and reducer calls run with the authenticated caller's +identity. In Genarrative this is an operator/developer integration surface, not +a replacement for `api-server` BFF routes, `spacetime-client` facades, or public +read models. Upgrade smoke should use an isolated local database and restrict +itself to `initialize`, `tools/list`, `ping`, and `get_schema` unless writes are +explicitly intended. + +## 2.2.0 to 2.7.0 Delta Genarrative introduced SpacetimeDB around 2.2.0. Important changes since then: @@ -89,6 +100,7 @@ Genarrative introduced SpacetimeDB around 2.2.0. Important changes since then: - **2.5.0**: procedures are stable, C# procedural views gain primary keys, event tables allow broader layout-altering automigrations, BTreeSet storage makes row insertion deterministic and avoids accidentally quadratic bulk insert behavior, `wasm_memory_bytes` billing metric semantics changed, template version constraints unified, `publish --delete-data` config fallback fixed, CLI `call` accepts hex Identity arguments. - **2.6.0**: procedural-view primary keys are available across Rust, TypeScript, and C#, commitlog gains `max_segment_size` / `write_buffer_size` / `preallocate_segments`, the default write buffer increases for throughput, event-table automigrations improve, and CLI binary distribution expands. - **2.6.1**: procedure contexts again receive the caller `Identity` and `ConnectionId`; generated TypeScript `Option` fields use optional keys; `spacetime init --template` lists available templates when no template argument is supplied. +- **2.7.0**: existing tables can add unique or primary-key constraints when current data satisfies them; standalone exposes an authenticated database MCP endpoint; Rust adds context-capability and table-accessor traits; `spacetime sql --format json` and database locking are available; view cleanup, backing-table migration, connection metrics, and memory metrics improve. Official current release assets use the `v2.7.0-hotfix3` tag while binaries report `2.7.0`. ## Debugging Checklist diff --git a/.codex/skills/spacetimedb-rust/SKILL.md b/.codex/skills/spacetimedb-rust/SKILL.md index 5750ada65..ef0a239d6 100644 --- a/.codex/skills/spacetimedb-rust/SKILL.md +++ b/.codex/skills/spacetimedb-rust/SKILL.md @@ -1,6 +1,6 @@ --- name: spacetimedb-rust -description: Develop SpacetimeDB 2.6 server modules in Rust for Genarrative. Use when writing or reviewing tables, reducers, procedures, views, migrations, row mappers, schema changes, and module logic. +description: Develop SpacetimeDB 2.7 server modules in Rust for Genarrative. Use when writing or reviewing tables, reducers, procedures, views, migrations, row mappers, schema changes, and module logic. --- # SpacetimeDB Rust Module Development @@ -181,11 +181,11 @@ fn deal_damage(ctx: &ReducerContext, target: Identity, amount: u32) { Event tables must be subscribed explicitly and are excluded from `subscribe_to_all_tables()`. -In 2.6, event tables support broader layout-altering automigrations than regular tables, including column removal, reordering, and type changes. This relaxed migration policy does not apply to persistent tables. +Since 2.6, event tables support broader layout-altering automigrations than regular tables, including column removal, reordering, and type changes. This relaxed migration policy does not apply to persistent tables. Event-table primary keys and constraints are enforced only within the current transaction. They do not make event rows persistent, and client SDKs expose event tables as insert-only event streams. Do not rely on `OnUpdate` / `on_update` / `onUpdate` for event tables; use a persistent table or a primary-keyed procedural view when update callbacks are required. -Official 2.4.1 through 2.6 release notes tie primary-key-backed update callbacks to procedural views, not event tables. +Official 2.4.1 through 2.7 release notes tie primary-key-backed update callbacks to procedural views, not event tables. ## Views @@ -228,7 +228,7 @@ For scheduled reducers, check `ctx.sender_auth().is_internal()` when the reducer ## Procedures -Procedures remain stable in 2.6 and no longer require the `unstable` feature. +Procedures remain stable in 2.7 and no longer require the `unstable` feature. ```rust use spacetimedb::{procedure, ProcedureContext}; diff --git a/deploy/container/README.md b/deploy/container/README.md index 6517b9ab6..0b246dc5e 100644 --- a/deploy/container/README.md +++ b/deploy/container/README.md @@ -56,7 +56,7 @@ Linux Docker Engine 若要从宿主机 CLI 连到容器内服务,直接用 `ht ## 构建工具链 -`api-server` 容器镜像只构建 Linux release API 二进制,不构建 `spacetime-module`。当前 `api-server -> spacetime-client -> spacetimedb-sdk 2.6.1` 依赖链要求 Rust 1.93,因此 `deploy/container/api-server.Dockerfile` 的 Rust builder 固定为 `rust:1.93-bookworm`。镜像构建阶段会同时复制 `public/`,用于满足 API 二进制里 `include_bytes!` 引用的内置素材;不要把 `public/generated-*` 放入镜像上下文。如果本机 Docker Hub 拉取失败,可以先在本机准备同名本地 builder 镜像,但不要把临时 bootstrap 容器或私有 registry 凭据写入仓库。 +`api-server` 容器镜像只构建 Linux release API 二进制,不构建 `spacetime-module`。当前 `api-server -> spacetime-client -> spacetimedb-sdk 2.7.0` 依赖链继续兼容 Rust 1.93,因此 `deploy/container/api-server.Dockerfile` 的 Rust builder 固定为 `rust:1.93-bookworm`。镜像构建阶段会同时复制 `public/`,用于满足 API 二进制里 `include_bytes!` 引用的内置素材;不要把 `public/generated-*` 放入镜像上下文。如果本机 Docker Hub 拉取失败,可以先在本机准备同名本地 builder 镜像,但不要把临时 bootstrap 容器或私有 registry 凭据写入仓库。 ### Gitea CI 预构建 Job 镜像 @@ -156,7 +156,7 @@ npm run container:worker-smoke -- status npm run container:worker-smoke -- smoke --force ``` -`container:worker-smoke` 默认会把本机 `spacetime` 2.6.1 CLI 打成轻量 SpacetimeDB 镜像,避免首次 smoke 必须拉取官方大镜像;普通 `npm run container:*` 压测默认使用 `clockworklabs/spacetime:v2.6.1`。如果 Docker build 阶段在容器内拉取 crates.io 依赖不稳定,可让容器内 Cargo 复用本机 Cargo 缓存构建当前二进制,再打入临时 smoke 镜像。该模式默认使用 `rust:1.93-bookworm` 作为 builder、Debian bookworm smoke runtime 承载构建产物;需要换 builder 镜像时设置 `GENARRATIVE_WORKER_SMOKE_CARGO_IMAGE`,需要换运行时基础镜像时设置 `GENARRATIVE_WORKER_SMOKE_LOCAL_BASE_IMAGE`: +`container:worker-smoke` 默认会把本机 `spacetime` 2.7.0 CLI 打成轻量 SpacetimeDB 镜像,避免首次 smoke 必须拉取官方大镜像;普通 `npm run container:*` 压测默认使用 `clockworklabs/spacetime:v2.7.0-hotfix3`(容器内二进制报告 2.7.0)。如果 Docker build 阶段在容器内拉取 crates.io 依赖不稳定,可让容器内 Cargo 复用本机 Cargo 缓存构建当前二进制,再打入临时 smoke 镜像。该模式默认使用 `rust:1.93-bookworm` 作为 builder、Debian bookworm smoke runtime 承载构建产物;需要换 builder 镜像时设置 `GENARRATIVE_WORKER_SMOKE_CARGO_IMAGE`,需要换运行时基础镜像时设置 `GENARRATIVE_WORKER_SMOKE_LOCAL_BASE_IMAGE`: ```bash npm run container:worker-smoke -- smoke --local-binary diff --git a/deploy/container/docker-compose.loadtest.yml b/deploy/container/docker-compose.loadtest.yml index 4b3b30032..1268bc485 100644 --- a/deploy/container/docker-compose.loadtest.yml +++ b/deploy/container/docker-compose.loadtest.yml @@ -2,7 +2,7 @@ name: genarrative-container-loadtest services: spacetimedb: - image: ${GENARRATIVE_CONTAINER_SPACETIME_IMAGE:-clockworklabs/spacetime:v2.6.1} + image: ${GENARRATIVE_CONTAINER_SPACETIME_IMAGE:-clockworklabs/spacetime:v2.7.0-hotfix3} user: root command: [ diff --git a/docs/project-memory/shared-memory/decision-log.md b/docs/project-memory/shared-memory/decision-log.md index 913bfcf94..af571d627 100644 --- a/docs/project-memory/shared-memory/decision-log.md +++ b/docs/project-memory/shared-memory/decision-log.md @@ -253,6 +253,14 @@ - 验证方式:核对 `spacetime --version`,运行 `npm run spacetime:generate`、`npm run check:spacetime-schema`、`cargo check` / 定向测试、server provision 工具测试、encoding / diff 门禁。 - 关联文档:`docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md`、`docs/【开发运维】本地开发验证与生产运维-2026-05-15.md`。 +## 2026-07-23 SpacetimeDB 工具链统一升级到 2.7.0 + +- 背景:SpacetimeDB 2.7.0 增加满足数据约束时的 unique / primary-key 非破坏迁移、Rust SDK capability traits、standalone MCP endpoint、SQL JSON 输出和更多连接/视图/内存指标,并修复旧 procedural-view backing table 的自动迁移。官方当前发行资产位于 `v2.7.0-hotfix3` 标签,二进制和 Rust crates 版本仍为 2.7.0。 +- 决策:`server-rs/Cargo.toml` 的 `spacetimedb`、`spacetimedb-sdk`、`spacetimedb-lib` 精确锁定 2.7.0;本地 CLI / standalone 与 Rust bindings 使用官方 2.7.0 hotfix3 构建,worker smoke 本地镜像按运行版本标记 2.7.0,官方容器和生产 provision 下载根固定到 `v2.7.0-hotfix3`。provision 从 hotfix 资产标签解析运行版本时必须得到 2.7.0,并同时核对 CLI commit 为 `d220349a...`;裸 tag `a08663c7...` 不得因版本号相同而被复用,下载 / 安装结果也必须通过同一 commit 门禁。 +- 影响范围:Rust workspace lockfile、SpacetimeDB bindings、本地 dev 版本门禁、容器 smoke / loadtest、server provision Jenkins 与项目 SpacetimeDB skills / 文档;现役 module 没有 procedural view,本次不修改 schema 或 migration。 +- 验证方式:核对 CLI 版本和 commit,重新生成 Rust bindings,运行 `npm run check:spacetime-schema`、相关 Cargo check、server provision 工具测试、容器配置、Rust 1.93 兼容检查、standalone `/v1/ping`、encoding 和 diff 门禁。 +- 关联文档:`docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md`、`docs/【开发运维】本地开发验证与生产运维-2026-05-15.md`。 + ## 2026-07-10 外部生成任务只持久化轻量媒体引用并独立维护摘要投影 - 背景:编辑器 worker 化后直接把同步接口 payload 序列化进 `external_generation_job.request_payload_json`;前端又把已有 OSS `objectKey` 下载成 Data URL 再提交,导致单个任务 JSON 膨胀到数 MB,正式任务列表读取 20 条任务时同时搬运约 65 MB payload,并放大为 SpacetimeDB 与 api-server 的瞬时内存峰值。此前“禁止 Data URL 持久化”只覆盖工程、素材、图层和元数据,遗漏了正式生成任务表。 diff --git a/docs/project-memory/shared-memory/project-overview.md b/docs/project-memory/shared-memory/project-overview.md index ce0e69c86..75bc6edb5 100644 --- a/docs/project-memory/shared-memory/project-overview.md +++ b/docs/project-memory/shared-memory/project-overview.md @@ -1,6 +1,6 @@ # Genarrative 项目共享概览 -更新时间:`2026-07-18` +更新时间:`2026-07-23` ## 一句话定位 @@ -31,7 +31,7 @@ Genarrative / 陶泥儿是一个 AI 原生互动内容与小游戏平台,把 A server-rs + Axum + SpacetimeDB ``` -当前 SpacetimeDB crate、SDK、CLI / standalone、生成 bindings 和容器压测镜像统一按 `2.6.1` 对齐;遇到版本不匹配时先升级到 `server-rs/Cargo.toml` 锁定版本,升级后重启对应 SpacetimeDB 进程再重试。 +当前 SpacetimeDB crate、SDK、CLI / standalone 和生成 bindings 统一按 `2.7.0` 对齐;官方 CLI / standalone 发行包与容器镜像使用 `v2.7.0-hotfix3` 资产标签,二进制仍报告 `2.7.0`。遇到版本不匹配时先升级到 `server-rs/Cargo.toml` 锁定版本,升级后重启对应 SpacetimeDB 进程再重试。 职责边界: diff --git a/docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md b/docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md index 53a328cc5..7d98b96cf 100644 --- a/docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md +++ b/docs/【后端架构】server-rs与SpacetimeDB数据契约-2026-05-15.md @@ -2,7 +2,7 @@ > 2026-07-18 状态更新:旧创作入口、全部模板业务 API/worker/运行态及 SpacetimeDB 业务逻辑已退役。本文逐玩法路由、流程和 DTO 章节仅作为历史设计记录;相关持久化表仍按原结构作为最小 schema 数据壳编译,当前编译与运行边界以 `server-rs/Cargo.toml`、`server-rs/crates/api-server/src/app.rs` 和 `docs/technical/【架构下线】旧创作模板业务退役方案-2026-07-17.md` 为准。 -更新时间:`2026-07-21` +更新时间:`2026-07-23` ## 后端主线 @@ -18,7 +18,7 @@ server-rs + Axum + SpacetimeDB `server-rs/Cargo.toml` 是 workspace 事实源。默认构建成员为 `crates/api-server`;第三方依赖版本和 workspace 内 crate path 统一放在 `[workspace.dependencies]`。 -SpacetimeDB 版本口径:当前 Rust crate `spacetimedb`、`spacetimedb-sdk`、`spacetimedb-lib` 统一锁定 `2.6.1`;本地 `spacetime` CLI / standalone、生成的 `spacetime-client` bindings 和容器压测镜像也必须与 `server-rs/Cargo.toml` 锁定版本对齐,避免 BSATN / procedure result 反序列化错配。遇到版本不匹配时,不继续沿着业务超时排查,先把 CLI / standalone 直接升级到锁定版本并重启后再重试。2.6.1 还修复了 procedure context 中调用者 `Identity` / `ConnectionId` 丢失问题,因此依赖调用者身份的 procedure 不得继续运行在 2.6.0 standalone 上。 +SpacetimeDB 版本口径:当前 Rust crate `spacetimedb`、`spacetimedb-sdk`、`spacetimedb-lib` 统一锁定 `2.7.0`;本地 `spacetime` CLI / standalone、生成的 `spacetime-client` bindings 和容器压测镜像也必须与 `server-rs/Cargo.toml` 锁定版本对齐,避免 BSATN / procedure result 反序列化错配。2.7.0 官方 CLI / standalone 发行包与容器镜像使用 `v2.7.0-hotfix3` 资产标签,二进制版本仍为 `2.7.0`;不得回退使用缺少后续 backing-view 迁移修复的裸 tag 构建。遇到版本不匹配时,不继续沿着业务超时排查,先把 CLI / standalone 直接升级到锁定版本并重启后再重试。2.6.1 还修复了 procedure context 中调用者 `Identity` / `ConnectionId` 丢失问题,因此依赖调用者身份的 procedure 不得继续运行在 2.6.0 standalone 上。 当前主要 crate: diff --git a/docs/【开发运维】本地开发验证与生产运维-2026-05-15.md b/docs/【开发运维】本地开发验证与生产运维-2026-05-15.md index d111c8100..e2e89ea99 100644 --- a/docs/【开发运维】本地开发验证与生产运维-2026-05-15.md +++ b/docs/【开发运维】本地开发验证与生产运维-2026-05-15.md @@ -1,6 +1,6 @@ # 本地开发验证与生产运维 -更新时间:`2026-07-21` +更新时间:`2026-07-23` ## 标准开发流程 @@ -151,7 +151,7 @@ spacetime sql "SELECT * FROM runtime_setting LIMIT 1" --server http:/ 本地 `npm run dev:spacetime` 发布模块时必须显式忽略仓库根目录的 `spacetime.json`,由脚本固定追加 `--no-config` 并使用命令参数里传入的数据库名和 `--server http://127.0.0.1:3101`。否则 CLI 可能把发布目标改写到配置文件里的其他数据库,导致 `dev:spacetime` 启动后又因发布失败自动退出,浏览器随后会在 `ws://127.0.0.1:3101/v1/database/.../subscribe` 看到连接拒绝。 -本地 `spacetime` CLI / standalone 版本必须和 `server-rs/Cargo.toml` 里锁定的 `spacetimedb` 版本一致;当前统一版本为 `2.6.1`。若版本错配,procedure 返回值可能在宿主侧触发 `Failed to BSATN deserialize procedure return value`,api-server 最终表现为现役 settings、editor project 或 profile procedure 超时。排障时先运行 `spacetime --version`,再对照 `server-rs/Cargo.toml` 的 `spacetimedb = "..."`;遇到版本不匹配时直接执行 `spacetime version install && spacetime version use `,或在目标就是最新版本时执行 `spacetime version upgrade`,升级后重启 `npm run dev:spacetime` 再重试。当前 `scripts/dev.mjs` 会在启动和复用本地 SpacetimeDB 前写入并校验 `dev-spacetime-tool-version`。2.6.1 修复了 procedure context 中调用者 `Identity` / `ConnectionId` 始终为空的回归,依赖 `ctx.sender` 鉴权时必须同时确认宿主已升级。 +本地 `spacetime` CLI / standalone 版本必须和 `server-rs/Cargo.toml` 里锁定的 `spacetimedb` 版本一致;当前统一版本为 `2.7.0`。官方发行包位于 `v2.7.0-hotfix3` 资产标签,二进制仍报告 `2.7.0`;运行态和 provision 必须使用该 hotfix 构建,不得只按裸 `v2.7.0` tag 下载。当前 updater 元数据可能让 `spacetime version install 2.7.0` 装到裸 tag commit `a08663c7...`,所以 2.7.0 安装后必须核对 `spacetime --version` 的 commit 为 hotfix3 `d220349a...`;不一致时改用官方 hotfix3 archive 或仓库 provision 流程。若版本错配,procedure 返回值可能在宿主侧触发 `Failed to BSATN deserialize procedure return value`,api-server 最终表现为现役 settings、editor project 或 profile procedure 超时。排障时先运行 `spacetime --version`,再对照 `server-rs/Cargo.toml` 的 `spacetimedb = "..."`;其它版本可执行 `spacetime version install && spacetime version use `,升级后重启 `npm run dev:spacetime` 再重试。当前 `scripts/dev.mjs` 会把 tool version 和 commit 一起写入 `dev-spacetime-tool-version`,启动新 standalone 与复用已有本地进程时都要求 `2.7.0 + d220349a...` 同时匹配;旧单行版本记录会拒绝复用并要求重启。2.6.1 修复了 procedure context 中调用者 `Identity` / `ConnectionId` 始终为空的回归,依赖 `ctx.sender` 鉴权时必须同时确认宿主已升级。 本地 `.env`、`.env.local` 或 `.env.secrets.local` 修改后必须重启 `api-server` 才会生效;若已经通过 `npm run dev` 启动完整联调,可在该终端输入 `rs api-server`。排查图片编辑器 VectorEngine 生成链路时,确认 `VECTOR_ENGINE_BASE_URL`、`VECTOR_ENGINE_API_KEY` 和 `VECTOR_ENGINE_IMAGE_REQUEST_TIMEOUT_MS` 只在本地或服务器密钥文件中配置,不能写入 Git。`VECTOR_ENGINE_IMAGE_REQUEST_TIMEOUT_MS` 是单次 attempt 的配置上限,默认 `1000000`;配置加载层允许显式值低于该默认值,不再在读取环境变量时强制抬高。业务模型和 VectorEngine provider 首选请求都使用 `gpt-image-2`,符合条件时才回退到兜底模型 `gpt-image-2-c`;图片协议、URL / base64 响应解析、远端图片下载和 provider 侧结构化日志在 `server-rs/crates/platform-image`,`api-server` 只做编辑器请求编排、OSS / asset 持久化、计费和失败审计落库。`platform-image` 会在 JSON 生成和 multipart 编辑请求发送前按同一 GPT-image-2 family 规则归一显式像素尺寸;若请求发送失败,先按同一 `request_id` 查看 provider 日志与 `external_api_call_failure.metadata_json.errorSource`,当前 multipart `/v1/images/edits` 单独强制 HTTP/1.1。 @@ -247,7 +247,7 @@ SpacetimeDB bindings: npm run spacetime:generate ``` -后台账号 procedure 的 identity、唯一索引和版本事务使用隔离 smoke 验证;脚本会在随机本机端口启动临时 SpacetimeDB 2.6、发布当前 module,结束后自动关闭并清理临时数据: +后台账号 procedure 的 identity、唯一索引和版本事务使用隔离 smoke 验证;脚本会在随机本机端口启动仓库锁定版本的临时 SpacetimeDB、发布当前 module,结束后自动关闭并清理临时数据: ```bash npm run check:admin-account-procedures @@ -609,7 +609,7 @@ worker 被硬杀或断电后,lease 过期任务只有尚未耗尽 `max_attempt - `api-server` 正常运行时 `/healthz` 只返回进程存活状态,`/readyz` 会同时检查进程是否仍接收新流量和 SpacetimeDB 连接租约是否健康;收到 `SIGINT` / `SIGTERM` 后会先把 readiness 标记为不可用,再让 Axum 停止接新连接并等待已有 HTTP 请求排空。systemd 仍以 `KillSignal=SIGINT` 停服务,`TimeoutStopSec=90` 作为长请求排空上限。 - SpacetimeDB 健康检查默认使用 `GENARRATIVE_SPACETIME_HEALTH_CHECK_TIMEOUT_SECONDS=2` 的短等待窗口,和业务 procedure 的 `GENARRATIVE_SPACETIME_PROCEDURE_TIMEOUT_SECONDS` 分开。`/readyz` 失败时 `details.spacetime.stage` 会标出当前卡住阶段:`pool_acquire`、`connect_build`、`connect_handshake`、`read_model_subscribe`、`procedure_result`、`reducer_result` 或 `read_cache`;`elapsedMs` / `timeoutMs` 用于确认是否命中健康检查窗口。业务请求日志也会写入 `operation_kind`、`operation_name`、`spacetime_stage` 和 `elapsed_ms`,后续 45 秒超时不再只靠 Nginx `request_time=45s` 推断。 - `genarrative-api.service` 设置 `LimitNOFILE=65535`、`TasksMax=2048`;上线后用 `systemctl show genarrative-api.service -p LimitNOFILE -p TasksMax -p TimeoutStopUSec` 和 `cat /proc/$(pidof api-server)/limits` 核对。 -- Server provision 不再通过 Windows helper 下载,也不再通过 Linux build 节点中转 SpacetimeDB / otelcol 工具包;Linux build 节点只负责从内网 Git 源准备 provision 脚本和配置并上传给目标 agent。`Prepare Provision Tools` 在目标 dev / release agent 工作区内先检查 `/usr/local/bin/otelcol-contrib` 与 `${SPACETIME_ROOT}/bin/current`:版本已满足时直接复用目标机现有文件生成 `provision-tools/`,只有缺失或版本不匹配时才使用 `PROVISION_DOWNLOADS_DIR` 里的本地包或从配置的下载源准备 SpacetimeDB `2.6.1` / `otelcol-contrib 0.151.0`;如果目标服务器下载需要代理,在 `PROVISION_DOWNLOAD_PROXY` 配置目标机可访问的 HTTP 代理。 +- Server provision 不再通过 Windows helper 下载,也不再通过 Linux build 节点中转 SpacetimeDB / otelcol 工具包;Linux build 节点只负责从内网 Git 源准备 provision 脚本和配置并上传给目标 agent。`Prepare Provision Tools` 在目标 dev / release agent 工作区内先检查 `/usr/local/bin/otelcol-contrib` 与 `${SPACETIME_ROOT}/bin/current`:SpacetimeDB 必须同时匹配运行版本 `2.7.0` 和 hotfix3 commit `d220349a...` 才能复用,裸 tag `a08663c7...` 即使版本号相同也必须拒绝;只有缺失或版本 / commit 不匹配时才使用 `PROVISION_DOWNLOADS_DIR` 里的本地包或从配置的下载源准备官方 `v2.7.0-hotfix3` 资产。`SPACETIME_EXPECTED_COMMIT` 与下载根必须成对调整,安装结果也执行同一 commit 门禁。otelcol-contrib 当前锁定 `0.151.0`;如果目标服务器下载需要代理,在 `PROVISION_DOWNLOAD_PROXY` 配置目标机可访问的 HTTP 代理。 - 除 `Genarrative-Server-Provision` 外,`Genarrative-Stdb-Module-Build`、`Genarrative-Web-Build`、`Genarrative-Api-Build`、`Genarrative-*Deploy`、`Genarrative-Database-Import/Export`、`Genarrative-Full-Build-And-Deploy` 和 `Genarrative-Notify-Email` 的生产流水线现都以 Linux agent 为主,仍按各自 Jenkinsfile 的 checkout 口径执行。Server provision 不使用公网备用 Git 源,目标部署 agent 也不再需要访问源码 Git remote。 - `otelcol-contrib.service` 作为可选系统服务加入 provision,默认监听 `127.0.0.1:4317/4318` 并使用 `deploy/otelcol/genarrative-debug.yaml`。api-server 是否发送 OTLP 仍由 `GENARRATIVE_OTEL_ENABLED` 控制,服务 unit 见 `deploy/systemd/otelcol-contrib.service`。该服务必须存在系统用户 / 组 `otelcol`,并且 `/etc/otelcol/genarrative-debug.yaml` 已安装到目标机;若看到 `status=217/USER` 或 `Failed to determine user credentials`,优先检查 `getent passwd otelcol`,再补齐 `/etc/otelcol` 配置目录并重启服务。 - Nginx `/api/` 与 `/admin/api/` 通过 `genarrative_api` upstream 代理到 `127.0.0.1:8082`,upstream keepalive 为 64;通用 API 使用 `genarrative_api_rps`,后台 API 使用 `genarrative_admin_rps`。通用 `/api` location 保留 `client_max_body_size 64m` 作为编辑器图片、视频和文档请求的反代兜底,真实大小仍由路由与业务校验负责。若线上出现 `413 Request Entity Too Large` 且 access log 中 `request_time=0.000`、`upstream_status=-`,说明请求在 Nginx 层被拦截,先核对 release 模板与实际媒体大小。`limit_conn_status 429` 和 `limit_req_status 429` 必须在 HTTP 与 HTTPS server 中同时生效。 diff --git a/jenkins/Jenkinsfile.production-server-provision b/jenkins/Jenkinsfile.production-server-provision index 4163a132b..69ea81c22 100644 --- a/jenkins/Jenkinsfile.production-server-provision +++ b/jenkins/Jenkinsfile.production-server-provision @@ -25,7 +25,8 @@ pipeline { string(name: 'PROVISION_DOWNLOADS_DIR', defaultValue: 'provision-tool-downloads', description: '目标服务器工作区内暂存 SpacetimeDB/otelcol 安装包的相对目录') string(name: 'PROVISION_TOOLS_DIR', defaultValue: 'provision-tools', description: '目标机工作区内由已下载安装包生成的工具包目录') string(name: 'PROVISION_DOWNLOAD_PROXY', defaultValue: '', description: '可选,目标服务器下载 SpacetimeDB 和 otelcol-contrib 时使用的代理地址,例如 http://127.0.0.1:7890;留空不设置代理') - string(name: 'SPACETIME_DOWNLOAD_ROOT', defaultValue: 'https://github.com/clockworklabs/SpacetimeDB/releases/download/v2.6.1', description: '目标服务器使用的 SpacetimeDB Linux release tarball 根地址;默认固定到项目锁定版本') + string(name: 'SPACETIME_DOWNLOAD_ROOT', defaultValue: 'https://github.com/clockworklabs/SpacetimeDB/releases/download/v2.7.0-hotfix3', description: '目标服务器使用的 SpacetimeDB Linux release tarball 根地址;默认固定到项目锁定版本的官方 hotfix 资产标签') + string(name: 'SPACETIME_EXPECTED_COMMIT', defaultValue: 'd220349adb7af7eefa810eb08a185609356b83f6', description: 'SpacetimeDB CLI 预期构建 commit;用于拒绝同版本号但缺少 hotfix 的旧二进制') string(name: 'SPACETIME_TARGET_HOST', defaultValue: 'x86_64-unknown-linux-gnu', description: 'SpacetimeDB 预编译包 host triple,development/release Linux amd64 使用默认值') string(name: 'SPACETIME_ROOT', defaultValue: '/stdb', description: 'SpacetimeDB root-dir') string(name: 'RELEASE_ROOT', defaultValue: '/opt/genarrative/releases', description: 'release 根目录') @@ -95,6 +96,9 @@ pipeline { if (!(params.SPACETIME_DOWNLOAD_ROOT?.trim() ==~ /^https?:\/\/\S+$/)) { error('SPACETIME_DOWNLOAD_ROOT 不能为空。') } + if (!(params.SPACETIME_EXPECTED_COMMIT?.trim() ==~ /^[0-9a-f]{40}$/)) { + error('SPACETIME_EXPECTED_COMMIT 必须是 40 位小写十六进制 commit。') + } if (!(params.SPACETIME_TARGET_HOST?.trim() ==~ /^[0-9A-Za-z._-]+$/)) { error("SPACETIME_TARGET_HOST 只能包含字母、数字、点号、下划线和短横线: ${params.SPACETIME_TARGET_HOST}") } @@ -209,7 +213,8 @@ BASH OTELCOL_VERSION="${OTELCOL_VERSION:-0.151.0}" \ PREPARE_OTELCOL="${ENABLE_OTELCOL:-true}" \ PROVISION_DOWNLOAD_PROXY="${PROVISION_DOWNLOAD_PROXY:-}" \ - SPACETIME_DOWNLOAD_ROOT="${SPACETIME_DOWNLOAD_ROOT:-https://github.com/clockworklabs/SpacetimeDB/releases/download/v2.6.1}" \ + SPACETIME_DOWNLOAD_ROOT="${SPACETIME_DOWNLOAD_ROOT:-https://github.com/clockworklabs/SpacetimeDB/releases/download/v2.7.0-hotfix3}" \ + SPACETIME_EXPECTED_COMMIT="${SPACETIME_EXPECTED_COMMIT:-d220349adb7af7eefa810eb08a185609356b83f6}" \ SPACETIME_TARGET_HOST="${SPACETIME_TARGET_HOST:-x86_64-unknown-linux-gnu}" \ SPACETIME_ROOT="${SPACETIME_ROOT:-/stdb}" \ scripts/prepare-server-provision-tools.sh diff --git a/scripts/check-admin-account-procedures.mjs b/scripts/check-admin-account-procedures.mjs index ea49c7f26..bec911d7d 100644 --- a/scripts/check-admin-account-procedures.mjs +++ b/scripts/check-admin-account-procedures.mjs @@ -20,7 +20,7 @@ const repoRoot = path.resolve( '..', ); const database = 'admin-account-smoke'; -const expectedSpacetimeVersion = '2.6.1'; +const expectedSpacetimeVersion = '2.7.0'; const commandTimeoutMs = 5 * 60 * 1000; function assert(condition, message) { diff --git a/scripts/check-server-provision-tools.sh b/scripts/check-server-provision-tools.sh index f8805debb..69ab5c4aa 100755 --- a/scripts/check-server-provision-tools.sh +++ b/scripts/check-server-provision-tools.sh @@ -37,11 +37,15 @@ chmod +x "${TARGET_BIN_DIR}/otelcol-contrib" cat >"${SPACETIME_ROOT_DIR}/bin/current/spacetimedb-cli" <<'EOF' #!/usr/bin/env bash -echo "spacetimedb-cli 2.6.1" +cat <<'VERSION' +spacetime Path: /tmp/spacetimedb-cli +Commit: d220349adb7af7eefa810eb08a185609356b83f6 +spacetimedb tool version 2.7.0; spacetimedb-lib version 2.7.0; +VERSION EOF cat >"${SPACETIME_ROOT_DIR}/bin/current/spacetimedb-standalone" <<'EOF' #!/usr/bin/env bash -echo "spacetimedb-standalone 2.6.1" +echo "spacetimedb-standalone 2.7.0" EOF chmod +x \ "${SPACETIME_ROOT_DIR}/bin/current/spacetimedb-cli" \ @@ -58,7 +62,6 @@ if ! ( OTELCOL_TARGET_BIN="${TARGET_BIN_DIR}/otelcol-contrib" \ OTELCOL_VERSION="0.151.0" \ SPACETIME_ROOT="${SPACETIME_ROOT_DIR}" \ - SPACETIME_EXPECTED_VERSION="2.6.1" \ "${REPO_ROOT}/scripts/prepare-server-provision-tools.sh" \ >"${OUTPUT_LOG}" 2>&1 ); then @@ -83,4 +86,82 @@ if grep -q "下载 " "${OUTPUT_LOG}"; then exit 1 fi +BARE_TAG_ROOT_DIR="${TMP_ROOT}/bare-tag-stdb" +BARE_TAG_WORK_DIR="${TMP_ROOT}/bare-tag-workspace" +BARE_TAG_LOG="${TMP_ROOT}/bare-tag.log" +mkdir -p "${BARE_TAG_ROOT_DIR}/bin/current" "${BARE_TAG_WORK_DIR}" +cat >"${BARE_TAG_ROOT_DIR}/bin/current/spacetimedb-cli" <<'EOF' +#!/usr/bin/env bash +cat <<'VERSION' +spacetime Path: /tmp/spacetimedb-cli +Commit: a08663c7b94688a2542577532d472f751e641f5b +spacetimedb tool version 2.7.0; spacetimedb-lib version 2.7.0; +VERSION +EOF +cat >"${BARE_TAG_ROOT_DIR}/bin/current/spacetimedb-standalone" <<'EOF' +#!/usr/bin/env bash +echo "spacetimedb-standalone 2.7.0" +EOF +chmod +x \ + "${BARE_TAG_ROOT_DIR}/bin/current/spacetimedb-cli" \ + "${BARE_TAG_ROOT_DIR}/bin/current/spacetimedb-standalone" + +if ( + cd "${BARE_TAG_WORK_DIR}" + PATH="${FAKE_BIN_DIR}:${PATH}" \ + WORKSPACE="${BARE_TAG_WORK_DIR}" \ + PROVISION_TOOLS_DIR="provision-tools" \ + PROVISION_DOWNLOADS_DIR="downloads" \ + PROVISION_TOOLS_TMP_PARENT="${BARE_TAG_WORK_DIR}/.tmp/server-provision-tools" \ + PROVISION_REQUIRE_LOCAL_DOWNLOADS="true" \ + PREPARE_OTELCOL="false" \ + SPACETIME_ROOT="${BARE_TAG_ROOT_DIR}" \ + "${REPO_ROOT}/scripts/prepare-server-provision-tools.sh" \ + >"${BARE_TAG_LOG}" 2>&1 +); then + echo "[check-server-provision-tools] 裸 v2.7.0 tag 不应通过 hotfix3 复用门禁。" >&2 + cat "${BARE_TAG_LOG}" >&2 + exit 1 +fi + +grep -q "SpacetimeDB commit 不匹配" "${BARE_TAG_LOG}" +if grep -q "复用目标机已有 SpacetimeDB 安装" "${BARE_TAG_LOG}"; then + echo "[check-server-provision-tools] 裸 v2.7.0 tag 被错误复用。" >&2 + cat "${BARE_TAG_LOG}" >&2 + exit 1 +fi + +BARE_ARCHIVE_DIR="${TMP_ROOT}/bare-archive" +BARE_ARCHIVE_PATH="${TMP_ROOT}/bare-spacetime.tar.gz" +BARE_ARCHIVE_WORK_DIR="${TMP_ROOT}/bare-archive-workspace" +BARE_ARCHIVE_LOG="${TMP_ROOT}/bare-archive.log" +mkdir -p "${BARE_ARCHIVE_DIR}" "${BARE_ARCHIVE_WORK_DIR}" +cp \ + "${BARE_TAG_ROOT_DIR}/bin/current/spacetimedb-cli" \ + "${BARE_TAG_ROOT_DIR}/bin/current/spacetimedb-standalone" \ + "${BARE_ARCHIVE_DIR}/" +tar -czf "${BARE_ARCHIVE_PATH}" -C "${BARE_ARCHIVE_DIR}" \ + spacetimedb-cli spacetimedb-standalone + +if ( + cd "${BARE_ARCHIVE_WORK_DIR}" + PATH="${FAKE_BIN_DIR}:${PATH}" \ + WORKSPACE="${BARE_ARCHIVE_WORK_DIR}" \ + PROVISION_TOOLS_DIR="provision-tools" \ + PROVISION_DOWNLOADS_DIR="downloads" \ + PROVISION_TOOLS_TMP_PARENT="${BARE_ARCHIVE_WORK_DIR}/.tmp/server-provision-tools" \ + PROVISION_REQUIRE_LOCAL_DOWNLOADS="true" \ + PREPARE_OTELCOL="false" \ + SPACETIME_ROOT="${TMP_ROOT}/missing-target-stdb" \ + SPACETIME_ARCHIVE_PATH="${BARE_ARCHIVE_PATH}" \ + "${REPO_ROOT}/scripts/prepare-server-provision-tools.sh" \ + >"${BARE_ARCHIVE_LOG}" 2>&1 +); then + echo "[check-server-provision-tools] 裸 v2.7.0 archive 不应通过 hotfix3 安装结果门禁。" >&2 + cat "${BARE_ARCHIVE_LOG}" >&2 + exit 1 +fi + +grep -q "安装结果 commit 不匹配" "${BARE_ARCHIVE_LOG}" + echo "[check-server-provision-tools] OK" diff --git a/scripts/container-worker-smoke.mjs b/scripts/container-worker-smoke.mjs index 3c93cec23..59715e5f8 100644 --- a/scripts/container-worker-smoke.mjs +++ b/scripts/container-worker-smoke.mjs @@ -759,7 +759,7 @@ function composeEnv() { } function localSpacetimeImageName() { - return `${projectName}-spacetimedb:2.6.1`; + return `${projectName}-spacetimedb:2.7.0`; } function spacetimeServerUrl(state) { diff --git a/scripts/dev.mjs b/scripts/dev.mjs index 5bdf33f72..e05287657 100644 --- a/scripts/dev.mjs +++ b/scripts/dev.mjs @@ -569,7 +569,27 @@ function parseSpacetimeToolVersion(output) { return match?.[1] ?? ''; } -function readSpacetimeToolVersion() { +function parseSpacetimeToolCommit(output) { + const match = /^Commit:\s*([0-9a-f]{40})\s*$/imu.exec(output); + return match?.[1]?.toLowerCase() ?? ''; +} + +function expectedSpacetimeToolCommit(workspaceVersion) { + if (workspaceVersion === '2.7.0') { + return 'd220349adb7af7eefa810eb08a185609356b83f6'; + } + return ''; +} + +function buildSpacetimeUpgradeInstruction(workspaceVersion) { + const expectedCommit = expectedSpacetimeToolCommit(workspaceVersion); + if (expectedCommit) { + return `请安装官方 v${workspaceVersion}-hotfix3 发行包并确认 spacetime --version 的 Commit 为 ${expectedCommit},然后重新运行本命令。`; + } + return `请先直接升级并切换到锁定版本: spacetime version install ${workspaceVersion} && spacetime version use ${workspaceVersion},然后重新运行本命令。`; +} + +function readSpacetimeToolProvenance() { const result = spawnSync('spacetime', ['--version'], { cwd: repoRoot, encoding: 'utf8', @@ -585,33 +605,43 @@ function readSpacetimeToolVersion() { if (!version) { throw new Error(`无法解析 spacetime 版本输出: ${trimPreview(output)}`); } - return version; + return { version, commit: parseSpacetimeToolCommit(output) }; } function assertSpacetimeToolVersionMatchesWorkspace({ toolVersion, + toolCommit = '', workspaceVersion, }) { - if (toolVersion === workspaceVersion) { - return; + if (toolVersion !== workspaceVersion) { + throw new Error( + [ + `本机 spacetime CLI/standalone 版本 ${toolVersion} 与 server-rs 锁定的 SpacetimeDB ${workspaceVersion} 不一致。`, + '版本错位会导致 procedure 返回值 BSATN 反序列化失败,前端表现为 SpacetimeDB procedure 调用超时。', + buildSpacetimeUpgradeInstruction(workspaceVersion), + ].join(''), + ); } - throw new Error( - [ - `本机 spacetime CLI/standalone 版本 ${toolVersion} 与 server-rs 锁定的 SpacetimeDB ${workspaceVersion} 不一致。`, - '版本错位会导致 procedure 返回值 BSATN 反序列化失败,前端表现为 SpacetimeDB procedure 调用超时。', - `请先直接升级并切换到锁定版本: spacetime version install ${workspaceVersion} && spacetime version use ${workspaceVersion},然后重新运行本命令。`, - ].join(''), - ); + const expectedCommit = expectedSpacetimeToolCommit(workspaceVersion); + if (expectedCommit && toolCommit.toLowerCase() !== expectedCommit) { + throw new Error( + [ + `本机 spacetime CLI/standalone 虽报告 ${toolVersion},但构建 commit ${toolCommit || 'unknown'} 不是项目锁定的 ${expectedCommit}。`, + '同版本号的裸 tag 缺少后续 hotfix,不能用于本地 SpacetimeDB。', + buildSpacetimeUpgradeInstruction(workspaceVersion), + ].join(''), + ); + } } function assertReusableSpacetimeProcessVersionMatchesWorkspace({ dataDir, serverUrl, }) { - const recordedVersion = readRecordedSpacetimeToolVersion(dataDir); + const recordedProvenance = readRecordedSpacetimeToolProvenance(dataDir); const workspaceVersion = readWorkspaceSpacetimeVersion(); - if (!recordedVersion) { + if (!recordedProvenance.version) { throw new Error( [ `检测到正在运行的本地 SpacetimeDB: ${serverUrl},但缺少 SpacetimeDB 版本记录。`, @@ -620,26 +650,25 @@ function assertReusableSpacetimeProcessVersionMatchesWorkspace({ ); } - if (recordedVersion === workspaceVersion) { - return; + try { + assertSpacetimeToolVersionMatchesWorkspace({ + toolVersion: recordedProvenance.version, + toolCommit: recordedProvenance.commit, + workspaceVersion, + }); + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + throw new Error( + `正在运行的本地 SpacetimeDB standalone provenance 不符合项目锁定要求: ${message}请停止当前 SpacetimeDB 进程后重新运行 npm run dev:spacetime。`, + ); } - - throw new Error( - [ - `正在运行的本地 SpacetimeDB standalone 版本 ${recordedVersion} 与 server-rs 锁定的 SpacetimeDB ${workspaceVersion} 不一致。`, - '版本错位会导致 procedure 返回值 BSATN 反序列化失败,前端表现为 SpacetimeDB procedure 调用超时。', - '请停止当前 SpacetimeDB 进程,先直接升级并切换到锁定版本: spacetime version install ', - workspaceVersion, - ' && spacetime version use ', - workspaceVersion, - ',然后重新运行 npm run dev:spacetime。', - ].join(''), - ); } function ensureSpacetimeToolVersionMatchesWorkspace() { + const toolProvenance = readSpacetimeToolProvenance(); assertSpacetimeToolVersionMatchesWorkspace({ - toolVersion: readSpacetimeToolVersion(), + toolVersion: toolProvenance.version, + toolCommit: toolProvenance.commit, workspaceVersion: readWorkspaceSpacetimeVersion(), }); } @@ -1530,12 +1559,16 @@ class DevRunner { encoding: 'utf8', }); service.logStream = logStream; - const spacetimeToolVersion = readSpacetimeToolVersion(); + const spacetimeToolProvenance = readSpacetimeToolProvenance(); assertSpacetimeToolVersionMatchesWorkspace({ - toolVersion: spacetimeToolVersion, + toolVersion: spacetimeToolProvenance.version, + toolCommit: spacetimeToolProvenance.commit, workspaceVersion: readWorkspaceSpacetimeVersion(), }); - recordSpacetimeToolVersion(options.spacetimeDataDir, spacetimeToolVersion); + recordSpacetimeToolVersion( + options.spacetimeDataDir, + spacetimeToolProvenance, + ); console.log(`[dev:spacetime] log: ${logFile}`); service.updateRuntimeState({ @@ -2380,13 +2413,16 @@ function readRecordedSpacetimeUrl(dataDir) { return ''; } -function readRecordedSpacetimeToolVersion(dataDir) { +function readRecordedSpacetimeToolProvenance(dataDir) { const versionPath = resolve(dataDir, 'dev-spacetime-tool-version'); if (!existsSync(versionPath)) { - return ''; + return { version: '', commit: '' }; } - return readFileSync(versionPath, 'utf8').split(/\r?\n/u)[0]?.trim() ?? ''; + const [version = '', commit = ''] = readFileSync(versionPath, 'utf8').split( + /\r?\n/u, + ); + return { version: version.trim(), commit: commit.trim().toLowerCase() }; } function readRecordedSpacetimePidState(dataDir) { @@ -2661,11 +2697,15 @@ function writeLocalSpacetimeApiIdentity({ } } -function recordSpacetimeToolVersion(dataDir, version) { +function recordSpacetimeToolVersion(dataDir, provenance) { const versionPath = resolve(dataDir, 'dev-spacetime-tool-version'); ensureParentDir(versionPath); try { - writeFileSync(versionPath, `${version}\n`, 'utf8'); + writeFileSync( + versionPath, + `${provenance.version}\n${provenance.commit}\n`, + 'utf8', + ); } catch (error) { console.warn( `[dev:spacetime] 写入版本记录失败 ${versionPath}: ${error.message}`, @@ -2977,6 +3017,7 @@ export { normalizeCargoVersionRequirement, parseArgs, parseProcessEnvBlock, + parseSpacetimeToolCommit, parseSpacetimeToolVersion, resolveCurrentSpacetimeCliToken, resolveDevStackStatePath, diff --git a/scripts/dev.test.ts b/scripts/dev.test.ts index b6ebbac90..772312894 100644 --- a/scripts/dev.test.ts +++ b/scripts/dev.test.ts @@ -32,6 +32,7 @@ import { normalizeCargoVersionRequirement, parseArgs, parseProcessEnvBlock, + parseSpacetimeToolCommit, parseSpacetimeToolVersion, resolveDevStackStatePath, resolveLocalSpacetimeApiIdentityPath, @@ -569,7 +570,7 @@ describe('dev scheduler spacetime reuse guard', () => { writeFileSync(join(tempDir, 'spacetime.pid'), `${process.pid}\n`, 'utf8'); writeFileSync( join(tempDir, 'dev-spacetime-tool-version'), - `${workspaceSpacetimeVersionForTest()}\n`, + `${workspaceSpacetimeVersionForTest()}\nd220349adb7af7eefa810eb08a185609356b83f6\n`, 'utf8', ); globalThis.fetch = vi.fn(async () => ({ @@ -598,7 +599,7 @@ describe('dev scheduler spacetime reuse guard', () => { writeFileSync(join(tempDir, 'spacetime.pid'), `${process.pid}\n`, 'utf8'); writeFileSync( join(tempDir, 'dev-spacetime-tool-version'), - `${workspaceSpacetimeVersionForTest()}\n`, + `${workspaceSpacetimeVersionForTest()}\nd220349adb7af7eefa810eb08a185609356b83f6\n`, 'utf8', ); globalThis.fetch = vi.fn(async () => ({ @@ -709,12 +710,34 @@ describe('dev scheduler spacetime refresh', () => { }); test('解析 spacetime --version 输出里的 tool version', () => { - const version = parseSpacetimeToolVersion(` + const output = ` A new version of SpacetimeDB is available: v2.6.1 (current: v2.5.0) -spacetimedb tool version 2.6.0; spacetimedb-lib version 2.6.0; -`); +Commit: d220349adb7af7eefa810eb08a185609356b83f6 +spacetimedb tool version 2.7.0; spacetimedb-lib version 2.7.0; +`; - expect(version).toBe('2.6.0'); + expect(parseSpacetimeToolVersion(output)).toBe('2.7.0'); + expect(parseSpacetimeToolCommit(output)).toBe( + 'd220349adb7af7eefa810eb08a185609356b83f6', + ); + }); + + test('同为 2.7.0 时拒绝裸 tag 并接受 hotfix3 commit', () => { + expect(() => + assertSpacetimeToolVersionMatchesWorkspace({ + toolVersion: '2.7.0', + toolCommit: 'a08663c7b94688a2542577532d472f751e641f5b', + workspaceVersion: '2.7.0', + }), + ).toThrow('裸 tag'); + + expect(() => + assertSpacetimeToolVersionMatchesWorkspace({ + toolVersion: '2.7.0', + toolCommit: 'd220349adb7af7eefa810eb08a185609356b83f6', + workspaceVersion: '2.7.0', + }), + ).not.toThrow(); }); test('本机 spacetime 版本和 workspace 锁定版本不一致时直接报清楚', () => { @@ -748,6 +771,28 @@ spacetimedb tool version 2.6.0; spacetimedb-lib version 2.6.0; } }); + test('复用本地 SpacetimeDB standalone 时拒绝同版本裸 tag 记录', () => { + const tempDir = mkdtempSync( + join(tmpdir(), 'genarrative-spacetime-commit-'), + ); + try { + writeFileSync( + join(tempDir, 'dev-spacetime-tool-version'), + '2.7.0\na08663c7b94688a2542577532d472f751e641f5b\n', + 'utf8', + ); + + expect(() => + assertReusableSpacetimeProcessVersionMatchesWorkspace({ + dataDir: tempDir, + serverUrl: 'http://127.0.0.1:3101', + }), + ).toThrow('裸 tag'); + } finally { + rmSync(tempDir, { recursive: true, force: true }); + } + }); + test('本地发布 403 时识别为身份权限问题,避免误杀 standalone', () => { const error = new Error( 'Pre-publish check failed with status 403 Forbidden: c200... is not authorized to perform action on database c200...: update database', diff --git a/scripts/prepare-server-provision-tools.sh b/scripts/prepare-server-provision-tools.sh index 8a8ff3a9b..fcef281ac 100755 --- a/scripts/prepare-server-provision-tools.sh +++ b/scripts/prepare-server-provision-tools.sh @@ -9,10 +9,11 @@ OTELCOL_DOWNLOAD_ROOT="${OTELCOL_DOWNLOAD_ROOT:-https://github.com/open-telemetr OTELCOL_ARCHIVE_PATH="${OTELCOL_ARCHIVE_PATH:-}" OTELCOL_TARGET_BIN="${OTELCOL_TARGET_BIN:-/usr/local/bin/otelcol-contrib}" SPACETIME_INSTALLER_URL="${SPACETIME_INSTALLER_URL:-https://install.spacetimedb.com}" -SPACETIME_DOWNLOAD_ROOT="${SPACETIME_DOWNLOAD_ROOT:-https://github.com/clockworklabs/SpacetimeDB/releases/download/v2.6.1}" +SPACETIME_DOWNLOAD_ROOT="${SPACETIME_DOWNLOAD_ROOT:-https://github.com/clockworklabs/SpacetimeDB/releases/download/v2.7.0-hotfix3}" SPACETIME_TARGET_HOST="${SPACETIME_TARGET_HOST:-x86_64-unknown-linux-gnu}" SPACETIME_ROOT="${SPACETIME_ROOT:-/stdb}" SPACETIME_EXPECTED_VERSION="${SPACETIME_EXPECTED_VERSION:-}" +SPACETIME_EXPECTED_COMMIT="${SPACETIME_EXPECTED_COMMIT:-d220349adb7af7eefa810eb08a185609356b83f6}" SPACETIME_ARCHIVE_PATH="${SPACETIME_ARCHIVE_PATH:-}" SPACETIME_INSTALLER_PATH="${SPACETIME_INSTALLER_PATH:-}" SPACETIME_UPDATE_INSTALLER_PATH="${SPACETIME_UPDATE_INSTALLER_PATH:-}" @@ -76,7 +77,7 @@ resolve_spacetime_expected_version() { return fi - if [[ "${download_root}" =~ /v([0-9]+(\.[0-9]+){1,2})$ ]]; then + if [[ "${download_root}" =~ /v([0-9]+(\.[0-9]+){1,2})(-hotfix[0-9]+)?$ ]]; then printf "%s" "${BASH_REMATCH[1]}" fi } @@ -117,6 +118,10 @@ target_spacetime_ready() { echo "[prepare-provision-tools] 目标机 SpacetimeDB 版本不匹配,期望 ${expected_version},当前: ${version_output:-unknown}" return 1 fi + if [[ -n "${SPACETIME_EXPECTED_COMMIT}" && "${version_output}" != *"Commit: ${SPACETIME_EXPECTED_COMMIT}"* ]]; then + echo "[prepare-provision-tools] 目标机 SpacetimeDB commit 不匹配,期望 ${SPACETIME_EXPECTED_COMMIT},当前: ${version_output:-unknown}" + return 1 + fi echo "[prepare-provision-tools] 目标机 SpacetimeDB 已满足要求: ${version_output:-version unknown}" return 0 @@ -284,6 +289,18 @@ prepare_spacetime() { exit 1 fi + local installed_version_output expected_version + expected_version="$(resolve_spacetime_expected_version)" + installed_version_output="$("${install_root}/bin/current/spacetimedb-cli" --version 2>/dev/null || true)" + if [[ -n "${expected_version}" && "${installed_version_output}" != *"${expected_version}"* ]]; then + echo "[prepare-provision-tools] SpacetimeDB 安装结果版本不匹配,期望 ${expected_version},当前: ${installed_version_output:-unknown}" >&2 + exit 1 + fi + if [[ -n "${SPACETIME_EXPECTED_COMMIT}" && "${installed_version_output}" != *"Commit: ${SPACETIME_EXPECTED_COMMIT}"* ]]; then + echo "[prepare-provision-tools] SpacetimeDB 安装结果 commit 不匹配,期望 ${SPACETIME_EXPECTED_COMMIT},当前: ${installed_version_output:-unknown}" >&2 + exit 1 + fi + mkdir -p "${target_dir}" cp -a "${install_root}/bin" "${target_dir}/bin" make_spacetime_wrapper "${target_dir}/spacetime" diff --git a/server-rs/Cargo.lock b/server-rs/Cargo.lock index 0dc45c3b1..45fa7934e 100644 --- a/server-rs/Cargo.lock +++ b/server-rs/Cargo.lock @@ -5348,9 +5348,9 @@ dependencies = [ [[package]] name = "spacetimedb" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6eff5017248ff2e35e03564df947fdf3e963f7198be6ae1d9e894c2efb2ea15" +checksum = "f8ba4d29856a75aafc3c66fd47d39e11e20c5001ee323d90549ffe19980ef9ff" dependencies = [ "anyhow", "bytemuck", @@ -5371,9 +5371,9 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-macro" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fce86c7657dcb42a33ce55f0100f98964dc15b64e79f06803a478676b74d6c82" +checksum = "4a9c2548accd66ba0444caf12916e60ca282054fe5701298f633aa6a2a90c38b" dependencies = [ "heck 0.4.1", "humantime", @@ -5385,18 +5385,18 @@ dependencies = [ [[package]] name = "spacetimedb-bindings-sys" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe5f9d71d59bdb93d81a7a61eee75ac2f1f88f91e139a7e263261f9dbf316de" +checksum = "2fc1790a7705a2d83ee601c9b14e4fd543ee8fe777d5b6117d4c5d33fc6566d7" dependencies = [ "spacetimedb-primitives", ] [[package]] name = "spacetimedb-client-api-messages" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1642404553853b56e521a12aa9849807d8e003433934c73eeebbc8671f1254f8" +checksum = "e2ef1840b2157a9487618ad360a078d7b5d86de5eb27494efa5bbbb2ca76b247" dependencies = [ "bytes", "bytestring", @@ -5416,9 +5416,9 @@ dependencies = [ [[package]] name = "spacetimedb-data-structures" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3407c90a3da48b1c421bbad6a2ee6de3855a77d73fae98773bcc058426f1318f" +checksum = "20df758e7067fb085e9393786b3b12289838eac9fd78601cb1aaf7e059904ccb" dependencies = [ "ahash", "crossbeam-queue", @@ -5431,9 +5431,9 @@ dependencies = [ [[package]] name = "spacetimedb-lib" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bceaf72bdbf1a624d55d17ebaa38f8cf78a4972e43641c6cbf94f82318b5581d" +checksum = "7a6b0417d7db37d991fd927a21298e09ad61cd5dc298eb9e1ac2433fe4a958a7" dependencies = [ "anyhow", "bitflags 2.13.0", @@ -5456,9 +5456,9 @@ dependencies = [ [[package]] name = "spacetimedb-memory-usage" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cc1e19f664b47f4b3b82fb69b2fc096c3d82dc659ea705d62bbbec2fa9c2e83" +checksum = "892d4ef38414498d687d765c4b0a9f6390f786c6fc5ca640a09c42f5da902f99" dependencies = [ "decorum", "ethnum", @@ -5466,9 +5466,9 @@ dependencies = [ [[package]] name = "spacetimedb-metrics" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c794455ed96245d52d837c8bbc3493d1c17d9f6382e6c5fee1c88926c9aa04a" +checksum = "de1ef3c1d55ec819953211e5ae645f1152e2b894ea770d59b039a7133b2ebf5f" dependencies = [ "arrayvec", "itertools 0.12.1", @@ -5478,9 +5478,9 @@ dependencies = [ [[package]] name = "spacetimedb-primitives" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7525fda46b21fffdc62805099dee853a79000e0673ff6df4b8355cb0b8dabe8" +checksum = "2adee8bd225009feb67ab329aa4eae6b7fe6c4c0165d9d65814c07a4252b2d20" dependencies = [ "bitflags 2.13.0", "either", @@ -5492,18 +5492,18 @@ dependencies = [ [[package]] name = "spacetimedb-query-builder" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f283c4797961d9a94f623ee4c66e6a94d30861b6380a49a27ac2d9568e17125" +checksum = "1d8476efc6c3c1d9def4499bbeedcc015d5f13c75565dd7136180265dd45708c" dependencies = [ "spacetimedb-lib", ] [[package]] name = "spacetimedb-sats" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cefb87b7d5e760d43cb65855591e25af772bdcca19562e5796ae797240d1998" +checksum = "a6cfd92de752a8fd711ad2138ae79a80313be34061da6112fd46df1dd6365200" dependencies = [ "anyhow", "arrayvec", @@ -5534,9 +5534,9 @@ dependencies = [ [[package]] name = "spacetimedb-schema" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775cfdeb406e5628bf78b2221b0e0fd2fcba583f691bb89ba1c9338790ecaf7d" +checksum = "444649a34ca14d1535d03a375deacb8ad4668f692576bff7091b6d4160b1d346" dependencies = [ "anyhow", "convert_case 0.6.0", @@ -5565,9 +5565,9 @@ dependencies = [ [[package]] name = "spacetimedb-sdk" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "074a6d8828638176eb8e9bba7a3e6fb75dc659b260717306eb966c7e10575cd7" +checksum = "ed0e49e45ab4828e9bf51d1c93db553f496c2836f1b49174f4019dc8c42e6525" dependencies = [ "anymap3", "base64 0.21.7", @@ -5597,9 +5597,9 @@ dependencies = [ [[package]] name = "spacetimedb-sql-parser" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b978b6d76cfbe5782a7f0dae7e25f6be4e7e13cfad26c9211d4eb4cdf8c22da" +checksum = "2b9908b30e69222970fd955e30235fe977c8fa12010d630949c77f603abf54a2" dependencies = [ "derive_more", "spacetimedb-lib", diff --git a/server-rs/Cargo.toml b/server-rs/Cargo.toml index 296430d4d..3c68a1d50 100644 --- a/server-rs/Cargo.toml +++ b/server-rs/Cargo.toml @@ -116,9 +116,9 @@ serde_urlencoded = "0.7" sha1 = "0.10" sha2 = "0.10" socket2 = "0.6" -spacetimedb = "=2.6.1" -spacetimedb-sdk = "=2.6.1" -spacetimedb-lib = { version = "=2.6.1", default-features = false } +spacetimedb = "=2.7.0" +spacetimedb-sdk = "=2.7.0" +spacetimedb-lib = { version = "=2.7.0", default-features = false } time = "0.3" tokio = "1" tokio-stream = "0.1" diff --git a/server-rs/crates/spacetime-client/src/module_bindings.rs b/server-rs/crates/spacetime-client/src/module_bindings.rs index 538b3eafa..e10af7466 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings.rs @@ -1,7 +1,7 @@ // THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE // WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD. -// This was generated using spacetimedb cli version 2.6.1 (commit 052c83fe984a4c4eb7bb4f9afa5c6b1903891d87). +// This was generated using spacetimedb cli version 2.7.0 (commit d220349adb7af7eefa810eb08a185609356b83f6). #![allow(unused, clippy::all)] use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws}; diff --git a/server-rs/crates/spacetime-client/src/module_bindings/admin_account_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/admin_account_table.rs index 6b0ebcdff..85f58f625 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/admin_account_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/admin_account_table.rs @@ -18,6 +18,18 @@ pub struct AdminAccountTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `admin_account`. +pub struct AdminAccountTableAccessor; + +impl __sdk::TableAccessor for AdminAccountTableAccessor { + type Row = AdminAccount; + type Handle<'db> = AdminAccountTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.admin_account() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `admin_account`. /// @@ -40,6 +52,18 @@ impl AdminAccountTableAccess for super::RemoteTables { pub struct AdminAccountInsertCallbackId(__sdk::CallbackId); pub struct AdminAccountDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AdminAccountTableHandle<'ctx> { + type Row = AdminAccount; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for AdminAccountTableHandle<'ctx> { type Row = AdminAccount; type EventContext = super::EventContext; @@ -78,6 +102,36 @@ impl<'ctx> __sdk::Table for AdminAccountTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AdminAccountTableHandle<'ctx> { + type InsertCallbackId = AdminAccountInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AdminAccountInsertCallbackId { + AdminAccountInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AdminAccountInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for AdminAccountTableHandle<'ctx> { + type DeleteCallbackId = AdminAccountDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AdminAccountDeleteCallbackId { + AdminAccountDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AdminAccountDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct AdminAccountUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for AdminAccountTableHandle<'ctx> { @@ -95,6 +149,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AdminAccountTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for AdminAccountTableHandle<'ctx> { + type UpdateCallbackId = AdminAccountUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AdminAccountUpdateCallbackId { + AdminAccountUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AdminAccountUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `account_id` unique index on the table `admin_account`, /// which allows point queries on the field of the same name /// via the [`AdminAccountAccountIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_table.rs index 09b7c4922..d42f92c9b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_result_reference_table.rs @@ -19,6 +19,18 @@ pub struct AiResultReferenceTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `ai_result_reference`. +pub struct AiResultReferenceTableAccessor; + +impl __sdk::TableAccessor for AiResultReferenceTableAccessor { + type Row = AiResultReference; + type Handle<'db> = AiResultReferenceTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.ai_result_reference() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `ai_result_reference`. /// @@ -43,6 +55,18 @@ impl AiResultReferenceTableAccess for super::RemoteTables { pub struct AiResultReferenceInsertCallbackId(__sdk::CallbackId); pub struct AiResultReferenceDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AiResultReferenceTableHandle<'ctx> { + type Row = AiResultReference; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for AiResultReferenceTableHandle<'ctx> { type Row = AiResultReference; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for AiResultReferenceTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AiResultReferenceTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for AiResultReferenceTableHandle<'ctx> { + 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> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiResultReferenceTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_event_table.rs index ffb780d9d..4f151bba5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_event_table.rs @@ -21,6 +21,18 @@ pub struct AiTaskEventTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `ai_task_event`. +pub struct AiTaskEventTableAccessor; + +impl __sdk::TableAccessor for AiTaskEventTableAccessor { + type Row = AiTaskEvent; + type Handle<'db> = AiTaskEventTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.ai_task_event() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `ai_task_event`. /// @@ -42,6 +54,18 @@ impl AiTaskEventTableAccess for super::RemoteTables { pub struct AiTaskEventInsertCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AiTaskEventTableHandle<'ctx> { + type Row = AiTaskEvent; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::EventTable for AiTaskEventTableHandle<'ctx> { type Row = AiTaskEvent; type EventContext = super::EventContext; @@ -67,6 +91,21 @@ impl<'ctx> __sdk::EventTable for AiTaskEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AiTaskEventTableHandle<'ctx> { + type InsertCallbackId = AiTaskEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AiTaskEventInsertCallbackId { + AiTaskEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AiTaskEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("ai_task_event"); diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_table.rs index 0bd84f770..4a1cf9205 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_stage_table.rs @@ -20,6 +20,18 @@ pub struct AiTaskStageTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `ai_task_stage`. +pub struct AiTaskStageTableAccessor; + +impl __sdk::TableAccessor for AiTaskStageTableAccessor { + type Row = AiTaskStage; + type Handle<'db> = AiTaskStageTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.ai_task_stage() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `ai_task_stage`. /// @@ -42,6 +54,18 @@ impl AiTaskStageTableAccess for super::RemoteTables { pub struct AiTaskStageInsertCallbackId(__sdk::CallbackId); pub struct AiTaskStageDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AiTaskStageTableHandle<'ctx> { + type Row = AiTaskStage; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for AiTaskStageTableHandle<'ctx> { type Row = AiTaskStage; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for AiTaskStageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AiTaskStageTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for AiTaskStageTableHandle<'ctx> { + 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> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskStageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_table.rs index 83c04b8a0..939a6c22f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_task_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_task_table.rs @@ -20,6 +20,18 @@ pub struct AiTaskTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `ai_task`. +pub struct AiTaskTableAccessor; + +impl __sdk::TableAccessor for AiTaskTableAccessor { + type Row = AiTask; + type Handle<'db> = AiTaskTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.ai_task() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `ai_task`. /// @@ -42,6 +54,18 @@ impl AiTaskTableAccess for super::RemoteTables { pub struct AiTaskInsertCallbackId(__sdk::CallbackId); pub struct AiTaskDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AiTaskTableHandle<'ctx> { + type Row = AiTask; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for AiTaskTableHandle<'ctx> { type Row = AiTask; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for AiTaskTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AiTaskTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for AiTaskTableHandle<'ctx> { + 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> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_table.rs index 7311d79f6..26783f2c5 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/ai_text_chunk_table.rs @@ -19,6 +19,18 @@ pub struct AiTextChunkTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `ai_text_chunk`. +pub struct AiTextChunkTableAccessor; + +impl __sdk::TableAccessor for AiTextChunkTableAccessor { + type Row = AiTextChunk; + type Handle<'db> = AiTextChunkTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.ai_text_chunk() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `ai_text_chunk`. /// @@ -41,6 +53,18 @@ impl AiTextChunkTableAccess for super::RemoteTables { pub struct AiTextChunkInsertCallbackId(__sdk::CallbackId); pub struct AiTextChunkDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AiTextChunkTableHandle<'ctx> { + type Row = AiTextChunk; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for AiTextChunkTableHandle<'ctx> { type Row = AiTextChunk; type EventContext = super::EventContext; @@ -79,6 +103,36 @@ impl<'ctx> __sdk::Table for AiTextChunkTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AiTextChunkTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for AiTextChunkTableHandle<'ctx> { + 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> { @@ -96,6 +150,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AiTextChunkTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_table.rs index a7c6515e6..f824db305 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_table.rs @@ -18,6 +18,18 @@ pub struct AnalyticsDateDimensionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `analytics_date_dimension`. +pub struct AnalyticsDateDimensionTableAccessor; + +impl __sdk::TableAccessor for AnalyticsDateDimensionTableAccessor { + type Row = AnalyticsDateDimension; + type Handle<'db> = AnalyticsDateDimensionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.analytics_date_dimension() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `analytics_date_dimension`. /// @@ -42,6 +54,18 @@ impl AnalyticsDateDimensionTableAccess for super::RemoteTables { pub struct AnalyticsDateDimensionInsertCallbackId(__sdk::CallbackId); pub struct AnalyticsDateDimensionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AnalyticsDateDimensionTableHandle<'ctx> { + type Row = AnalyticsDateDimension; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for AnalyticsDateDimensionTableHandle<'ctx> { type Row = AnalyticsDateDimension; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for AnalyticsDateDimensionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AnalyticsDateDimensionTableHandle<'ctx> { + type InsertCallbackId = AnalyticsDateDimensionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AnalyticsDateDimensionInsertCallbackId { + AnalyticsDateDimensionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AnalyticsDateDimensionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for AnalyticsDateDimensionTableHandle<'ctx> { + type DeleteCallbackId = AnalyticsDateDimensionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AnalyticsDateDimensionDeleteCallbackId { + AnalyticsDateDimensionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AnalyticsDateDimensionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct AnalyticsDateDimensionUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for AnalyticsDateDimensionTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AnalyticsDateDimensionTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate for AnalyticsDateDimensionTableHandle<'ctx> { + type UpdateCallbackId = AnalyticsDateDimensionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AnalyticsDateDimensionUpdateCallbackId { + AnalyticsDateDimensionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AnalyticsDateDimensionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `date_key` unique index on the table `analytics_date_dimension`, /// which allows point queries on the field of the same name /// via the [`AnalyticsDateDimensionDateKeyUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_table.rs index 971704aea..b6b2d34e7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_entity_binding_table.rs @@ -18,6 +18,18 @@ pub struct AssetEntityBindingTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `asset_entity_binding`. +pub struct AssetEntityBindingTableAccessor; + +impl __sdk::TableAccessor for AssetEntityBindingTableAccessor { + type Row = AssetEntityBinding; + type Handle<'db> = AssetEntityBindingTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.asset_entity_binding() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `asset_entity_binding`. /// @@ -42,6 +54,18 @@ impl AssetEntityBindingTableAccess for super::RemoteTables { pub struct AssetEntityBindingInsertCallbackId(__sdk::CallbackId); pub struct AssetEntityBindingDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AssetEntityBindingTableHandle<'ctx> { + type Row = AssetEntityBinding; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for AssetEntityBindingTableHandle<'ctx> { type Row = AssetEntityBinding; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for AssetEntityBindingTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AssetEntityBindingTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for AssetEntityBindingTableHandle<'ctx> { + 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> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AssetEntityBindingTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_event_table.rs index 08ed440a9..b41a503ba 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_event_table.rs @@ -19,6 +19,18 @@ pub struct AssetEventTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `asset_event`. +pub struct AssetEventTableAccessor; + +impl __sdk::TableAccessor for AssetEventTableAccessor { + type Row = AssetEvent; + type Handle<'db> = AssetEventTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.asset_event() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `asset_event`. /// @@ -40,6 +52,18 @@ impl AssetEventTableAccess for super::RemoteTables { pub struct AssetEventInsertCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AssetEventTableHandle<'ctx> { + type Row = AssetEvent; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::EventTable for AssetEventTableHandle<'ctx> { type Row = AssetEvent; type EventContext = super::EventContext; @@ -65,6 +89,21 @@ impl<'ctx> __sdk::EventTable for AssetEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AssetEventTableHandle<'ctx> { + type InsertCallbackId = AssetEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AssetEventInsertCallbackId { + AssetEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AssetEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("asset_event"); diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_table.rs index 526fa287d..a1f9cd39a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_object_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_object_table.rs @@ -19,6 +19,18 @@ pub struct AssetObjectTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `asset_object`. +pub struct AssetObjectTableAccessor; + +impl __sdk::TableAccessor for AssetObjectTableAccessor { + type Row = AssetObject; + type Handle<'db> = AssetObjectTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.asset_object() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `asset_object`. /// @@ -41,6 +53,18 @@ impl AssetObjectTableAccess for super::RemoteTables { pub struct AssetObjectInsertCallbackId(__sdk::CallbackId); pub struct AssetObjectDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AssetObjectTableHandle<'ctx> { + type Row = AssetObject; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for AssetObjectTableHandle<'ctx> { type Row = AssetObject; type EventContext = super::EventContext; @@ -79,6 +103,36 @@ impl<'ctx> __sdk::Table for AssetObjectTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AssetObjectTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for AssetObjectTableHandle<'ctx> { + 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> { @@ -96,6 +150,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AssetObjectTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/asset_operation_wallet_settlement_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/asset_operation_wallet_settlement_table.rs index ca9888dda..d0a97d4fc 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/asset_operation_wallet_settlement_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/asset_operation_wallet_settlement_table.rs @@ -18,6 +18,18 @@ pub struct AssetOperationWalletSettlementTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `asset_operation_wallet_settlement`. +pub struct AssetOperationWalletSettlementTableAccessor; + +impl __sdk::TableAccessor for AssetOperationWalletSettlementTableAccessor { + type Row = AssetOperationWalletSettlement; + type Handle<'db> = AssetOperationWalletSettlementTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.asset_operation_wallet_settlement() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `asset_operation_wallet_settlement`. /// @@ -42,6 +54,18 @@ impl AssetOperationWalletSettlementTableAccess for super::RemoteTables { pub struct AssetOperationWalletSettlementInsertCallbackId(__sdk::CallbackId); pub struct AssetOperationWalletSettlementDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AssetOperationWalletSettlementTableHandle<'ctx> { + type Row = AssetOperationWalletSettlement; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for AssetOperationWalletSettlementTableHandle<'ctx> { type Row = AssetOperationWalletSettlement; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for AssetOperationWalletSettlementTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AssetOperationWalletSettlementTableHandle<'ctx> { + type InsertCallbackId = AssetOperationWalletSettlementInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AssetOperationWalletSettlementInsertCallbackId { + AssetOperationWalletSettlementInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AssetOperationWalletSettlementInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for AssetOperationWalletSettlementTableHandle<'ctx> { + type DeleteCallbackId = AssetOperationWalletSettlementDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AssetOperationWalletSettlementDeleteCallbackId { + AssetOperationWalletSettlementDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AssetOperationWalletSettlementDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct AssetOperationWalletSettlementUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for AssetOperationWalletSettlementTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AssetOperationWalletSettlementTableHan } } +impl<'ctx> __sdk::WithUpdate for AssetOperationWalletSettlementTableHandle<'ctx> { + type UpdateCallbackId = AssetOperationWalletSettlementUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AssetOperationWalletSettlementUpdateCallbackId { + AssetOperationWalletSettlementUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AssetOperationWalletSettlementUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `consume_ledger_id` unique index on the table `asset_operation_wallet_settlement`, /// which allows point queries on the field of the same name /// via the [`AssetOperationWalletSettlementConsumeLedgerIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/auth_identity_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/auth_identity_table.rs index 5f4a76227..c52ec5f3d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/auth_identity_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/auth_identity_table.rs @@ -18,6 +18,18 @@ pub struct AuthIdentityTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `auth_identity`. +pub struct AuthIdentityTableAccessor; + +impl __sdk::TableAccessor for AuthIdentityTableAccessor { + type Row = AuthIdentity; + type Handle<'db> = AuthIdentityTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.auth_identity() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `auth_identity`. /// @@ -40,6 +52,18 @@ impl AuthIdentityTableAccess for super::RemoteTables { pub struct AuthIdentityInsertCallbackId(__sdk::CallbackId); pub struct AuthIdentityDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AuthIdentityTableHandle<'ctx> { + type Row = AuthIdentity; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for AuthIdentityTableHandle<'ctx> { type Row = AuthIdentity; type EventContext = super::EventContext; @@ -78,6 +102,36 @@ impl<'ctx> __sdk::Table for AuthIdentityTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AuthIdentityTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for AuthIdentityTableHandle<'ctx> { + 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> { @@ -95,6 +149,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AuthIdentityTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/auth_store_projection_meta_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/auth_store_projection_meta_table.rs index d0bbb6f4c..6de2f8b1f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/auth_store_projection_meta_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/auth_store_projection_meta_table.rs @@ -18,6 +18,18 @@ pub struct AuthStoreProjectionMetaTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `auth_store_projection_meta`. +pub struct AuthStoreProjectionMetaTableAccessor; + +impl __sdk::TableAccessor for AuthStoreProjectionMetaTableAccessor { + type Row = AuthStoreProjectionMeta; + type Handle<'db> = AuthStoreProjectionMetaTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.auth_store_projection_meta() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `auth_store_projection_meta`. /// @@ -42,6 +54,18 @@ impl AuthStoreProjectionMetaTableAccess for super::RemoteTables { pub struct AuthStoreProjectionMetaInsertCallbackId(__sdk::CallbackId); pub struct AuthStoreProjectionMetaDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for AuthStoreProjectionMetaTableHandle<'ctx> { + type Row = AuthStoreProjectionMeta; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for AuthStoreProjectionMetaTableHandle<'ctx> { type Row = AuthStoreProjectionMeta; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for AuthStoreProjectionMetaTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for AuthStoreProjectionMetaTableHandle<'ctx> { + type InsertCallbackId = AuthStoreProjectionMetaInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AuthStoreProjectionMetaInsertCallbackId { + AuthStoreProjectionMetaInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: AuthStoreProjectionMetaInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for AuthStoreProjectionMetaTableHandle<'ctx> { + type DeleteCallbackId = AuthStoreProjectionMetaDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> AuthStoreProjectionMetaDeleteCallbackId { + AuthStoreProjectionMetaDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: AuthStoreProjectionMetaDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct AuthStoreProjectionMetaUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for AuthStoreProjectionMetaTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for AuthStoreProjectionMetaTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate for AuthStoreProjectionMetaTableHandle<'ctx> { + type UpdateCallbackId = AuthStoreProjectionMetaUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> AuthStoreProjectionMetaUpdateCallbackId { + AuthStoreProjectionMetaUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: AuthStoreProjectionMetaUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `meta_id` unique index on the table `auth_store_projection_meta`, /// which allows point queries on the field of the same name /// via the [`AuthStoreProjectionMetaMetaIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_draft_config_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_draft_config_table.rs index b9e28c143..4675aace0 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_draft_config_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_draft_config_table.rs @@ -18,6 +18,18 @@ pub struct BarkBattleDraftConfigTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `bark_battle_draft_config`. +pub struct BarkBattleDraftConfigTableAccessor; + +impl __sdk::TableAccessor for BarkBattleDraftConfigTableAccessor { + type Row = BarkBattleDraftConfigRow; + type Handle<'db> = BarkBattleDraftConfigTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.bark_battle_draft_config() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `bark_battle_draft_config`. /// @@ -42,6 +54,18 @@ impl BarkBattleDraftConfigTableAccess for super::RemoteTables { pub struct BarkBattleDraftConfigInsertCallbackId(__sdk::CallbackId); pub struct BarkBattleDraftConfigDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BarkBattleDraftConfigTableHandle<'ctx> { + type Row = BarkBattleDraftConfigRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BarkBattleDraftConfigTableHandle<'ctx> { type Row = BarkBattleDraftConfigRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for BarkBattleDraftConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BarkBattleDraftConfigTableHandle<'ctx> { + type InsertCallbackId = BarkBattleDraftConfigInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattleDraftConfigInsertCallbackId { + BarkBattleDraftConfigInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BarkBattleDraftConfigInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for BarkBattleDraftConfigTableHandle<'ctx> { + type DeleteCallbackId = BarkBattleDraftConfigDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattleDraftConfigDeleteCallbackId { + BarkBattleDraftConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BarkBattleDraftConfigDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct BarkBattleDraftConfigUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattleDraftConfigTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattleDraftConfigTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for BarkBattleDraftConfigTableHandle<'ctx> { + type UpdateCallbackId = BarkBattleDraftConfigUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BarkBattleDraftConfigUpdateCallbackId { + BarkBattleDraftConfigUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BarkBattleDraftConfigUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `draft_id` unique index on the table `bark_battle_draft_config`, /// which allows point queries on the field of the same name /// via the [`BarkBattleDraftConfigDraftIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_leaderboard_entry_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_leaderboard_entry_table.rs index a4ed2f3dc..ae1423815 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_leaderboard_entry_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_leaderboard_entry_table.rs @@ -18,6 +18,18 @@ pub struct BarkBattleLeaderboardEntryTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `bark_battle_leaderboard_entry`. +pub struct BarkBattleLeaderboardEntryTableAccessor; + +impl __sdk::TableAccessor for BarkBattleLeaderboardEntryTableAccessor { + type Row = BarkBattleLeaderboardEntryRow; + type Handle<'db> = BarkBattleLeaderboardEntryTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.bark_battle_leaderboard_entry() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `bark_battle_leaderboard_entry`. /// @@ -42,6 +54,18 @@ impl BarkBattleLeaderboardEntryTableAccess for super::RemoteTables { pub struct BarkBattleLeaderboardEntryInsertCallbackId(__sdk::CallbackId); pub struct BarkBattleLeaderboardEntryDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BarkBattleLeaderboardEntryTableHandle<'ctx> { + type Row = BarkBattleLeaderboardEntryRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BarkBattleLeaderboardEntryTableHandle<'ctx> { type Row = BarkBattleLeaderboardEntryRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for BarkBattleLeaderboardEntryTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BarkBattleLeaderboardEntryTableHandle<'ctx> { + type InsertCallbackId = BarkBattleLeaderboardEntryInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattleLeaderboardEntryInsertCallbackId { + BarkBattleLeaderboardEntryInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BarkBattleLeaderboardEntryInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for BarkBattleLeaderboardEntryTableHandle<'ctx> { + type DeleteCallbackId = BarkBattleLeaderboardEntryDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattleLeaderboardEntryDeleteCallbackId { + BarkBattleLeaderboardEntryDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BarkBattleLeaderboardEntryDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct BarkBattleLeaderboardEntryUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattleLeaderboardEntryTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattleLeaderboardEntryTableHandle< } } +impl<'ctx> __sdk::WithUpdate for BarkBattleLeaderboardEntryTableHandle<'ctx> { + type UpdateCallbackId = BarkBattleLeaderboardEntryUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BarkBattleLeaderboardEntryUpdateCallbackId { + BarkBattleLeaderboardEntryUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BarkBattleLeaderboardEntryUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `leaderboard_entry_id` unique index on the table `bark_battle_leaderboard_entry`, /// which allows point queries on the field of the same name /// via the [`BarkBattleLeaderboardEntryLeaderboardEntryIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_personal_best_projection_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_personal_best_projection_table.rs index d5a142bf5..7c1080cb1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_personal_best_projection_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_personal_best_projection_table.rs @@ -18,6 +18,18 @@ pub struct BarkBattlePersonalBestProjectionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `bark_battle_personal_best_projection`. +pub struct BarkBattlePersonalBestProjectionTableAccessor; + +impl __sdk::TableAccessor for BarkBattlePersonalBestProjectionTableAccessor { + type Row = BarkBattlePersonalBestProjectionRow; + type Handle<'db> = BarkBattlePersonalBestProjectionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.bark_battle_personal_best_projection() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `bark_battle_personal_best_projection`. /// @@ -46,6 +58,18 @@ impl BarkBattlePersonalBestProjectionTableAccess for super::RemoteTables { pub struct BarkBattlePersonalBestProjectionInsertCallbackId(__sdk::CallbackId); pub struct BarkBattlePersonalBestProjectionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BarkBattlePersonalBestProjectionTableHandle<'ctx> { + type Row = BarkBattlePersonalBestProjectionRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BarkBattlePersonalBestProjectionTableHandle<'ctx> { type Row = BarkBattlePersonalBestProjectionRow; type EventContext = super::EventContext; @@ -84,6 +108,36 @@ impl<'ctx> __sdk::Table for BarkBattlePersonalBestProjectionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BarkBattlePersonalBestProjectionTableHandle<'ctx> { + type InsertCallbackId = BarkBattlePersonalBestProjectionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattlePersonalBestProjectionInsertCallbackId { + BarkBattlePersonalBestProjectionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BarkBattlePersonalBestProjectionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for BarkBattlePersonalBestProjectionTableHandle<'ctx> { + type DeleteCallbackId = BarkBattlePersonalBestProjectionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattlePersonalBestProjectionDeleteCallbackId { + BarkBattlePersonalBestProjectionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BarkBattlePersonalBestProjectionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct BarkBattlePersonalBestProjectionUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattlePersonalBestProjectionTableHandle<'ctx> { @@ -101,6 +155,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattlePersonalBestProjectionTableH } } +impl<'ctx> __sdk::WithUpdate for BarkBattlePersonalBestProjectionTableHandle<'ctx> { + type UpdateCallbackId = BarkBattlePersonalBestProjectionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BarkBattlePersonalBestProjectionUpdateCallbackId { + BarkBattlePersonalBestProjectionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BarkBattlePersonalBestProjectionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `personal_best_id` unique index on the table `bark_battle_personal_best_projection`, /// which allows point queries on the field of the same name /// via the [`BarkBattlePersonalBestProjectionPersonalBestIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_published_config_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_published_config_table.rs index a9d7e1888..0f61595ce 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_published_config_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_published_config_table.rs @@ -18,6 +18,18 @@ pub struct BarkBattlePublishedConfigTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `bark_battle_published_config`. +pub struct BarkBattlePublishedConfigTableAccessor; + +impl __sdk::TableAccessor for BarkBattlePublishedConfigTableAccessor { + type Row = BarkBattlePublishedConfigRow; + type Handle<'db> = BarkBattlePublishedConfigTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.bark_battle_published_config() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `bark_battle_published_config`. /// @@ -42,6 +54,18 @@ impl BarkBattlePublishedConfigTableAccess for super::RemoteTables { pub struct BarkBattlePublishedConfigInsertCallbackId(__sdk::CallbackId); pub struct BarkBattlePublishedConfigDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BarkBattlePublishedConfigTableHandle<'ctx> { + type Row = BarkBattlePublishedConfigRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BarkBattlePublishedConfigTableHandle<'ctx> { type Row = BarkBattlePublishedConfigRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for BarkBattlePublishedConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BarkBattlePublishedConfigTableHandle<'ctx> { + type InsertCallbackId = BarkBattlePublishedConfigInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattlePublishedConfigInsertCallbackId { + BarkBattlePublishedConfigInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BarkBattlePublishedConfigInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for BarkBattlePublishedConfigTableHandle<'ctx> { + type DeleteCallbackId = BarkBattlePublishedConfigDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattlePublishedConfigDeleteCallbackId { + BarkBattlePublishedConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BarkBattlePublishedConfigDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct BarkBattlePublishedConfigUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattlePublishedConfigTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattlePublishedConfigTableHandle<' } } +impl<'ctx> __sdk::WithUpdate for BarkBattlePublishedConfigTableHandle<'ctx> { + type UpdateCallbackId = BarkBattlePublishedConfigUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BarkBattlePublishedConfigUpdateCallbackId { + BarkBattlePublishedConfigUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BarkBattlePublishedConfigUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `work_id` unique index on the table `bark_battle_published_config`, /// which allows point queries on the field of the same name /// via the [`BarkBattlePublishedConfigWorkIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_runtime_run_table.rs index fad713669..e1ce7b5db 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_runtime_run_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_runtime_run_table.rs @@ -18,6 +18,18 @@ pub struct BarkBattleRuntimeRunTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `bark_battle_runtime_run`. +pub struct BarkBattleRuntimeRunTableAccessor; + +impl __sdk::TableAccessor for BarkBattleRuntimeRunTableAccessor { + type Row = BarkBattleRuntimeRunRow; + type Handle<'db> = BarkBattleRuntimeRunTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.bark_battle_runtime_run() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `bark_battle_runtime_run`. /// @@ -42,6 +54,18 @@ impl BarkBattleRuntimeRunTableAccess for super::RemoteTables { pub struct BarkBattleRuntimeRunInsertCallbackId(__sdk::CallbackId); pub struct BarkBattleRuntimeRunDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BarkBattleRuntimeRunTableHandle<'ctx> { + type Row = BarkBattleRuntimeRunRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BarkBattleRuntimeRunTableHandle<'ctx> { type Row = BarkBattleRuntimeRunRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for BarkBattleRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BarkBattleRuntimeRunTableHandle<'ctx> { + type InsertCallbackId = BarkBattleRuntimeRunInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattleRuntimeRunInsertCallbackId { + BarkBattleRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BarkBattleRuntimeRunInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for BarkBattleRuntimeRunTableHandle<'ctx> { + type DeleteCallbackId = BarkBattleRuntimeRunDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattleRuntimeRunDeleteCallbackId { + BarkBattleRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BarkBattleRuntimeRunDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct BarkBattleRuntimeRunUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattleRuntimeRunTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattleRuntimeRunTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for BarkBattleRuntimeRunTableHandle<'ctx> { + type UpdateCallbackId = BarkBattleRuntimeRunUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BarkBattleRuntimeRunUpdateCallbackId { + BarkBattleRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BarkBattleRuntimeRunUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `run_id` unique index on the table `bark_battle_runtime_run`, /// which allows point queries on the field of the same name /// via the [`BarkBattleRuntimeRunRunIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_score_record_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_score_record_table.rs index baee1a300..c466c9d1a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_score_record_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_score_record_table.rs @@ -18,6 +18,18 @@ pub struct BarkBattleScoreRecordTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `bark_battle_score_record`. +pub struct BarkBattleScoreRecordTableAccessor; + +impl __sdk::TableAccessor for BarkBattleScoreRecordTableAccessor { + type Row = BarkBattleScoreRecordRow; + type Handle<'db> = BarkBattleScoreRecordTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.bark_battle_score_record() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `bark_battle_score_record`. /// @@ -42,6 +54,18 @@ impl BarkBattleScoreRecordTableAccess for super::RemoteTables { pub struct BarkBattleScoreRecordInsertCallbackId(__sdk::CallbackId); pub struct BarkBattleScoreRecordDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BarkBattleScoreRecordTableHandle<'ctx> { + type Row = BarkBattleScoreRecordRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BarkBattleScoreRecordTableHandle<'ctx> { type Row = BarkBattleScoreRecordRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for BarkBattleScoreRecordTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BarkBattleScoreRecordTableHandle<'ctx> { + type InsertCallbackId = BarkBattleScoreRecordInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattleScoreRecordInsertCallbackId { + BarkBattleScoreRecordInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BarkBattleScoreRecordInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for BarkBattleScoreRecordTableHandle<'ctx> { + type DeleteCallbackId = BarkBattleScoreRecordDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattleScoreRecordDeleteCallbackId { + BarkBattleScoreRecordDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BarkBattleScoreRecordDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct BarkBattleScoreRecordUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattleScoreRecordTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattleScoreRecordTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for BarkBattleScoreRecordTableHandle<'ctx> { + type UpdateCallbackId = BarkBattleScoreRecordUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BarkBattleScoreRecordUpdateCallbackId { + BarkBattleScoreRecordUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BarkBattleScoreRecordUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `score_id` unique index on the table `bark_battle_score_record`, /// which allows point queries on the field of the same name /// via the [`BarkBattleScoreRecordScoreIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_work_stats_projection_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_work_stats_projection_table.rs index 66cf17cb8..bc6346f76 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_work_stats_projection_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/bark_battle_work_stats_projection_table.rs @@ -18,6 +18,18 @@ pub struct BarkBattleWorkStatsProjectionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `bark_battle_work_stats_projection`. +pub struct BarkBattleWorkStatsProjectionTableAccessor; + +impl __sdk::TableAccessor for BarkBattleWorkStatsProjectionTableAccessor { + type Row = BarkBattleWorkStatsProjectionRow; + type Handle<'db> = BarkBattleWorkStatsProjectionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.bark_battle_work_stats_projection() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `bark_battle_work_stats_projection`. /// @@ -42,6 +54,18 @@ impl BarkBattleWorkStatsProjectionTableAccess for super::RemoteTables { pub struct BarkBattleWorkStatsProjectionInsertCallbackId(__sdk::CallbackId); pub struct BarkBattleWorkStatsProjectionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BarkBattleWorkStatsProjectionTableHandle<'ctx> { + type Row = BarkBattleWorkStatsProjectionRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BarkBattleWorkStatsProjectionTableHandle<'ctx> { type Row = BarkBattleWorkStatsProjectionRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for BarkBattleWorkStatsProjectionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BarkBattleWorkStatsProjectionTableHandle<'ctx> { + type InsertCallbackId = BarkBattleWorkStatsProjectionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattleWorkStatsProjectionInsertCallbackId { + BarkBattleWorkStatsProjectionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BarkBattleWorkStatsProjectionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for BarkBattleWorkStatsProjectionTableHandle<'ctx> { + type DeleteCallbackId = BarkBattleWorkStatsProjectionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BarkBattleWorkStatsProjectionDeleteCallbackId { + BarkBattleWorkStatsProjectionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: BarkBattleWorkStatsProjectionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct BarkBattleWorkStatsProjectionUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattleWorkStatsProjectionTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BarkBattleWorkStatsProjectionTableHand } } +impl<'ctx> __sdk::WithUpdate for BarkBattleWorkStatsProjectionTableHandle<'ctx> { + type UpdateCallbackId = BarkBattleWorkStatsProjectionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> BarkBattleWorkStatsProjectionUpdateCallbackId { + BarkBattleWorkStatsProjectionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: BarkBattleWorkStatsProjectionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `work_id` unique index on the table `bark_battle_work_stats_projection`, /// which allows point queries on the field of the same name /// via the [`BarkBattleWorkStatsProjectionWorkIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_table.rs index 98a289a4c..6b59fb16c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/battle_state_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/battle_state_table.rs @@ -22,6 +22,18 @@ pub struct BattleStateTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `battle_state`. +pub struct BattleStateTableAccessor; + +impl __sdk::TableAccessor for BattleStateTableAccessor { + type Row = BattleState; + type Handle<'db> = BattleStateTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.battle_state() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `battle_state`. /// @@ -44,6 +56,18 @@ impl BattleStateTableAccess for super::RemoteTables { pub struct BattleStateInsertCallbackId(__sdk::CallbackId); pub struct BattleStateDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BattleStateTableHandle<'ctx> { + type Row = BattleState; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BattleStateTableHandle<'ctx> { type Row = BattleState; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for BattleStateTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BattleStateTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for BattleStateTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BattleStateTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_table.rs index cbb48abe5..51683b3d3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_agent_message_table.rs @@ -20,6 +20,18 @@ pub struct BigFishAgentMessageTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `big_fish_agent_message`. +pub struct BigFishAgentMessageTableAccessor; + +impl __sdk::TableAccessor for BigFishAgentMessageTableAccessor { + type Row = BigFishAgentMessage; + type Handle<'db> = BigFishAgentMessageTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.big_fish_agent_message() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `big_fish_agent_message`. /// @@ -44,6 +56,18 @@ impl BigFishAgentMessageTableAccess for super::RemoteTables { pub struct BigFishAgentMessageInsertCallbackId(__sdk::CallbackId); pub struct BigFishAgentMessageDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BigFishAgentMessageTableHandle<'ctx> { + type Row = BigFishAgentMessage; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BigFishAgentMessageTableHandle<'ctx> { type Row = BigFishAgentMessage; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for BigFishAgentMessageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BigFishAgentMessageTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for BigFishAgentMessageTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAgentMessageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_table.rs index d4817cf0b..1cc8b52cc 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_asset_slot_table.rs @@ -20,6 +20,18 @@ pub struct BigFishAssetSlotTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `big_fish_asset_slot`. +pub struct BigFishAssetSlotTableAccessor; + +impl __sdk::TableAccessor for BigFishAssetSlotTableAccessor { + type Row = BigFishAssetSlot; + type Handle<'db> = BigFishAssetSlotTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.big_fish_asset_slot() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `big_fish_asset_slot`. /// @@ -44,6 +56,18 @@ impl BigFishAssetSlotTableAccess for super::RemoteTables { pub struct BigFishAssetSlotInsertCallbackId(__sdk::CallbackId); pub struct BigFishAssetSlotDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BigFishAssetSlotTableHandle<'ctx> { + type Row = BigFishAssetSlot; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BigFishAssetSlotTableHandle<'ctx> { type Row = BigFishAssetSlot; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for BigFishAssetSlotTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BigFishAssetSlotTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for BigFishAssetSlotTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAssetSlotTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_table.rs index d7b822981..62451f321 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_creation_session_table.rs @@ -19,6 +19,18 @@ pub struct BigFishCreationSessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `big_fish_creation_session`. +pub struct BigFishCreationSessionTableAccessor; + +impl __sdk::TableAccessor for BigFishCreationSessionTableAccessor { + type Row = BigFishCreationSession; + type Handle<'db> = BigFishCreationSessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.big_fish_creation_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `big_fish_creation_session`. /// @@ -43,6 +55,18 @@ impl BigFishCreationSessionTableAccess for super::RemoteTables { pub struct BigFishCreationSessionInsertCallbackId(__sdk::CallbackId); pub struct BigFishCreationSessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BigFishCreationSessionTableHandle<'ctx> { + type Row = BigFishCreationSession; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BigFishCreationSessionTableHandle<'ctx> { type Row = BigFishCreationSession; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for BigFishCreationSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BigFishCreationSessionTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for BigFishCreationSessionTableHandle<'ctx> { + 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> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BigFishCreationSessionTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_event_table.rs index e7da8bca6..1999f9fa9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_event_table.rs @@ -19,6 +19,18 @@ pub struct BigFishEventTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `big_fish_event`. +pub struct BigFishEventTableAccessor; + +impl __sdk::TableAccessor for BigFishEventTableAccessor { + type Row = BigFishEvent; + type Handle<'db> = BigFishEventTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.big_fish_event() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `big_fish_event`. /// @@ -40,6 +52,18 @@ impl BigFishEventTableAccess for super::RemoteTables { pub struct BigFishEventInsertCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BigFishEventTableHandle<'ctx> { + type Row = BigFishEvent; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::EventTable for BigFishEventTableHandle<'ctx> { type Row = BigFishEvent; type EventContext = super::EventContext; @@ -65,6 +89,21 @@ impl<'ctx> __sdk::EventTable for BigFishEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BigFishEventTableHandle<'ctx> { + type InsertCallbackId = BigFishEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> BigFishEventInsertCallbackId { + BigFishEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: BigFishEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("big_fish_event"); diff --git a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_table.rs index bbf7ef944..1b037679a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/big_fish_runtime_run_table.rs @@ -19,6 +19,18 @@ pub struct BigFishRuntimeRunTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `big_fish_runtime_run`. +pub struct BigFishRuntimeRunTableAccessor; + +impl __sdk::TableAccessor for BigFishRuntimeRunTableAccessor { + type Row = BigFishRuntimeRun; + type Handle<'db> = BigFishRuntimeRunTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.big_fish_runtime_run() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `big_fish_runtime_run`. /// @@ -43,6 +55,18 @@ impl BigFishRuntimeRunTableAccess for super::RemoteTables { pub struct BigFishRuntimeRunInsertCallbackId(__sdk::CallbackId); pub struct BigFishRuntimeRunDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for BigFishRuntimeRunTableHandle<'ctx> { + type Row = BigFishRuntimeRun; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for BigFishRuntimeRunTableHandle<'ctx> { type Row = BigFishRuntimeRun; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for BigFishRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for BigFishRuntimeRunTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for BigFishRuntimeRunTableHandle<'ctx> { + 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> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for BigFishRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_table.rs index 2fb6c0427..2072a6a90 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/chapter_progression_table.rs @@ -19,6 +19,18 @@ pub struct ChapterProgressionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `chapter_progression`. +pub struct ChapterProgressionTableAccessor; + +impl __sdk::TableAccessor for ChapterProgressionTableAccessor { + type Row = ChapterProgression; + type Handle<'db> = ChapterProgressionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.chapter_progression() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `chapter_progression`. /// @@ -43,6 +55,18 @@ impl ChapterProgressionTableAccess for super::RemoteTables { pub struct ChapterProgressionInsertCallbackId(__sdk::CallbackId); pub struct ChapterProgressionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ChapterProgressionTableHandle<'ctx> { + type Row = ChapterProgression; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ChapterProgressionTableHandle<'ctx> { type Row = ChapterProgression; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for ChapterProgressionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ChapterProgressionTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for ChapterProgressionTableHandle<'ctx> { + 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> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ChapterProgressionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/creation_entry_config_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/creation_entry_config_table.rs index 99d0794da..7e980fd19 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/creation_entry_config_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/creation_entry_config_table.rs @@ -18,6 +18,18 @@ pub struct CreationEntryConfigTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `creation_entry_config`. +pub struct CreationEntryConfigTableAccessor; + +impl __sdk::TableAccessor for CreationEntryConfigTableAccessor { + type Row = CreationEntryConfig; + type Handle<'db> = CreationEntryConfigTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.creation_entry_config() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `creation_entry_config`. /// @@ -42,6 +54,18 @@ impl CreationEntryConfigTableAccess for super::RemoteTables { pub struct CreationEntryConfigInsertCallbackId(__sdk::CallbackId); pub struct CreationEntryConfigDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for CreationEntryConfigTableHandle<'ctx> { + type Row = CreationEntryConfig; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for CreationEntryConfigTableHandle<'ctx> { type Row = CreationEntryConfig; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for CreationEntryConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for CreationEntryConfigTableHandle<'ctx> { + type InsertCallbackId = CreationEntryConfigInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CreationEntryConfigInsertCallbackId { + CreationEntryConfigInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: CreationEntryConfigInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for CreationEntryConfigTableHandle<'ctx> { + type DeleteCallbackId = CreationEntryConfigDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CreationEntryConfigDeleteCallbackId { + CreationEntryConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: CreationEntryConfigDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct CreationEntryConfigUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for CreationEntryConfigTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CreationEntryConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for CreationEntryConfigTableHandle<'ctx> { + type UpdateCallbackId = CreationEntryConfigUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> CreationEntryConfigUpdateCallbackId { + CreationEntryConfigUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: CreationEntryConfigUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `config_id` unique index on the table `creation_entry_config`, /// which allows point queries on the field of the same name /// via the [`CreationEntryConfigConfigIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/creation_entry_type_config_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/creation_entry_type_config_table.rs index d4a86172a..a75c5c52a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/creation_entry_type_config_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/creation_entry_type_config_table.rs @@ -18,6 +18,18 @@ pub struct CreationEntryTypeConfigTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `creation_entry_type_config`. +pub struct CreationEntryTypeConfigTableAccessor; + +impl __sdk::TableAccessor for CreationEntryTypeConfigTableAccessor { + type Row = CreationEntryTypeConfig; + type Handle<'db> = CreationEntryTypeConfigTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.creation_entry_type_config() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `creation_entry_type_config`. /// @@ -42,6 +54,18 @@ impl CreationEntryTypeConfigTableAccess for super::RemoteTables { pub struct CreationEntryTypeConfigInsertCallbackId(__sdk::CallbackId); pub struct CreationEntryTypeConfigDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for CreationEntryTypeConfigTableHandle<'ctx> { + type Row = CreationEntryTypeConfig; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for CreationEntryTypeConfigTableHandle<'ctx> { type Row = CreationEntryTypeConfig; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for CreationEntryTypeConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for CreationEntryTypeConfigTableHandle<'ctx> { + type InsertCallbackId = CreationEntryTypeConfigInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CreationEntryTypeConfigInsertCallbackId { + CreationEntryTypeConfigInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: CreationEntryTypeConfigInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for CreationEntryTypeConfigTableHandle<'ctx> { + type DeleteCallbackId = CreationEntryTypeConfigDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CreationEntryTypeConfigDeleteCallbackId { + CreationEntryTypeConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: CreationEntryTypeConfigDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct CreationEntryTypeConfigUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for CreationEntryTypeConfigTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CreationEntryTypeConfigTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate for CreationEntryTypeConfigTableHandle<'ctx> { + type UpdateCallbackId = CreationEntryTypeConfigUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> CreationEntryTypeConfigUpdateCallbackId { + CreationEntryTypeConfigUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: CreationEntryTypeConfigUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `id` unique index on the table `creation_entry_type_config`, /// which allows point queries on the field of the same name /// via the [`CreationEntryTypeConfigIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_table.rs index 1d0886e71..df529c284 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_message_table.rs @@ -20,6 +20,18 @@ pub struct CustomWorldAgentMessageTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `custom_world_agent_message`. +pub struct CustomWorldAgentMessageTableAccessor; + +impl __sdk::TableAccessor for CustomWorldAgentMessageTableAccessor { + type Row = CustomWorldAgentMessage; + type Handle<'db> = CustomWorldAgentMessageTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.custom_world_agent_message() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `custom_world_agent_message`. /// @@ -44,6 +56,18 @@ impl CustomWorldAgentMessageTableAccess for super::RemoteTables { pub struct CustomWorldAgentMessageInsertCallbackId(__sdk::CallbackId); pub struct CustomWorldAgentMessageDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for CustomWorldAgentMessageTableHandle<'ctx> { + type Row = CustomWorldAgentMessage; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for CustomWorldAgentMessageTableHandle<'ctx> { type Row = CustomWorldAgentMessage; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for CustomWorldAgentMessageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for CustomWorldAgentMessageTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for CustomWorldAgentMessageTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentMessageTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_table.rs index 316a95b11..e7eec6e80 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_operation_table.rs @@ -20,6 +20,18 @@ pub struct CustomWorldAgentOperationTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `custom_world_agent_operation`. +pub struct CustomWorldAgentOperationTableAccessor; + +impl __sdk::TableAccessor for CustomWorldAgentOperationTableAccessor { + type Row = CustomWorldAgentOperation; + type Handle<'db> = CustomWorldAgentOperationTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.custom_world_agent_operation() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `custom_world_agent_operation`. /// @@ -44,6 +56,18 @@ impl CustomWorldAgentOperationTableAccess for super::RemoteTables { pub struct CustomWorldAgentOperationInsertCallbackId(__sdk::CallbackId); pub struct CustomWorldAgentOperationDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for CustomWorldAgentOperationTableHandle<'ctx> { + type Row = CustomWorldAgentOperation; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for CustomWorldAgentOperationTableHandle<'ctx> { type Row = CustomWorldAgentOperation; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for CustomWorldAgentOperationTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for CustomWorldAgentOperationTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for CustomWorldAgentOperationTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentOperationTableHandle<' } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_table.rs index d63d156c1..30a77d90c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_agent_session_table.rs @@ -19,6 +19,18 @@ pub struct CustomWorldAgentSessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `custom_world_agent_session`. +pub struct CustomWorldAgentSessionTableAccessor; + +impl __sdk::TableAccessor for CustomWorldAgentSessionTableAccessor { + type Row = CustomWorldAgentSession; + type Handle<'db> = CustomWorldAgentSessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.custom_world_agent_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `custom_world_agent_session`. /// @@ -43,6 +55,18 @@ impl CustomWorldAgentSessionTableAccess for super::RemoteTables { pub struct CustomWorldAgentSessionInsertCallbackId(__sdk::CallbackId); pub struct CustomWorldAgentSessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for CustomWorldAgentSessionTableHandle<'ctx> { + type Row = CustomWorldAgentSession; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for CustomWorldAgentSessionTableHandle<'ctx> { type Row = CustomWorldAgentSession; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for CustomWorldAgentSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for CustomWorldAgentSessionTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for CustomWorldAgentSessionTableHandle<'ctx> { + 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> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentSessionTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_table.rs index 6f1759981..45c003c5e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_draft_card_table.rs @@ -21,6 +21,18 @@ pub struct CustomWorldDraftCardTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `custom_world_draft_card`. +pub struct CustomWorldDraftCardTableAccessor; + +impl __sdk::TableAccessor for CustomWorldDraftCardTableAccessor { + type Row = CustomWorldDraftCard; + type Handle<'db> = CustomWorldDraftCardTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.custom_world_draft_card() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `custom_world_draft_card`. /// @@ -45,6 +57,18 @@ impl CustomWorldDraftCardTableAccess for super::RemoteTables { pub struct CustomWorldDraftCardInsertCallbackId(__sdk::CallbackId); pub struct CustomWorldDraftCardDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for CustomWorldDraftCardTableHandle<'ctx> { + type Row = CustomWorldDraftCard; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for CustomWorldDraftCardTableHandle<'ctx> { type Row = CustomWorldDraftCard; type EventContext = super::EventContext; @@ -83,6 +107,36 @@ impl<'ctx> __sdk::Table for CustomWorldDraftCardTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for CustomWorldDraftCardTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for CustomWorldDraftCardTableHandle<'ctx> { + 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> { @@ -100,6 +154,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldDraftCardTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_table.rs index 425b6a129..293f489fe 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_gallery_entry_table.rs @@ -19,6 +19,18 @@ pub struct CustomWorldGalleryEntryTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `custom_world_gallery_entry`. +pub struct CustomWorldGalleryEntryTableAccessor; + +impl __sdk::TableAccessor for CustomWorldGalleryEntryTableAccessor { + type Row = CustomWorldGalleryEntry; + type Handle<'db> = CustomWorldGalleryEntryTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.custom_world_gallery_entry() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `custom_world_gallery_entry`. /// @@ -43,6 +55,18 @@ impl CustomWorldGalleryEntryTableAccess for super::RemoteTables { pub struct CustomWorldGalleryEntryInsertCallbackId(__sdk::CallbackId); pub struct CustomWorldGalleryEntryDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for CustomWorldGalleryEntryTableHandle<'ctx> { + type Row = CustomWorldGalleryEntry; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for CustomWorldGalleryEntryTableHandle<'ctx> { type Row = CustomWorldGalleryEntry; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for CustomWorldGalleryEntryTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for CustomWorldGalleryEntryTableHandle<'ctx> { + type InsertCallbackId = CustomWorldGalleryEntryInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldGalleryEntryInsertCallbackId { + CustomWorldGalleryEntryInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: CustomWorldGalleryEntryInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for CustomWorldGalleryEntryTableHandle<'ctx> { + type DeleteCallbackId = CustomWorldGalleryEntryDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> CustomWorldGalleryEntryDeleteCallbackId { + CustomWorldGalleryEntryDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: CustomWorldGalleryEntryDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct CustomWorldGalleryEntryUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldGalleryEntryTableHandle<'ctx> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldGalleryEntryTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate for CustomWorldGalleryEntryTableHandle<'ctx> { + type UpdateCallbackId = CustomWorldGalleryEntryUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> CustomWorldGalleryEntryUpdateCallbackId { + CustomWorldGalleryEntryUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: CustomWorldGalleryEntryUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `profile_id` unique index on the table `custom_world_gallery_entry`, /// which allows point queries on the field of the same name /// via the [`CustomWorldGalleryEntryProfileIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_table.rs index 226924342..963f9cb0a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_profile_table.rs @@ -20,6 +20,18 @@ pub struct CustomWorldProfileTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `custom_world_profile`. +pub struct CustomWorldProfileTableAccessor; + +impl __sdk::TableAccessor for CustomWorldProfileTableAccessor { + type Row = CustomWorldProfile; + type Handle<'db> = CustomWorldProfileTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.custom_world_profile() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `custom_world_profile`. /// @@ -44,6 +56,18 @@ impl CustomWorldProfileTableAccess for super::RemoteTables { pub struct CustomWorldProfileInsertCallbackId(__sdk::CallbackId); pub struct CustomWorldProfileDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for CustomWorldProfileTableHandle<'ctx> { + type Row = CustomWorldProfile; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for CustomWorldProfileTableHandle<'ctx> { type Row = CustomWorldProfile; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for CustomWorldProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for CustomWorldProfileTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for CustomWorldProfileTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_table.rs index 2813b6e26..52d89b600 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/custom_world_session_table.rs @@ -20,6 +20,18 @@ pub struct CustomWorldSessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `custom_world_session`. +pub struct CustomWorldSessionTableAccessor; + +impl __sdk::TableAccessor for CustomWorldSessionTableAccessor { + type Row = CustomWorldSession; + type Handle<'db> = CustomWorldSessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.custom_world_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `custom_world_session`. /// @@ -44,6 +56,18 @@ impl CustomWorldSessionTableAccess for super::RemoteTables { pub struct CustomWorldSessionInsertCallbackId(__sdk::CallbackId); pub struct CustomWorldSessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for CustomWorldSessionTableHandle<'ctx> { + type Row = CustomWorldSession; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for CustomWorldSessionTableHandle<'ctx> { type Row = CustomWorldSession; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for CustomWorldSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for CustomWorldSessionTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for CustomWorldSessionTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/database_migration_import_chunk_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/database_migration_import_chunk_table.rs index 3ef15eb98..aa776fa90 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/database_migration_import_chunk_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/database_migration_import_chunk_table.rs @@ -18,6 +18,18 @@ pub struct DatabaseMigrationImportChunkTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `database_migration_import_chunk`. +pub struct DatabaseMigrationImportChunkTableAccessor; + +impl __sdk::TableAccessor for DatabaseMigrationImportChunkTableAccessor { + type Row = DatabaseMigrationImportChunk; + type Handle<'db> = DatabaseMigrationImportChunkTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.database_migration_import_chunk() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `database_migration_import_chunk`. /// @@ -42,6 +54,18 @@ impl DatabaseMigrationImportChunkTableAccess for super::RemoteTables { pub struct DatabaseMigrationImportChunkInsertCallbackId(__sdk::CallbackId); pub struct DatabaseMigrationImportChunkDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for DatabaseMigrationImportChunkTableHandle<'ctx> { + type Row = DatabaseMigrationImportChunk; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for DatabaseMigrationImportChunkTableHandle<'ctx> { type Row = DatabaseMigrationImportChunk; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for DatabaseMigrationImportChunkTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for DatabaseMigrationImportChunkTableHandle<'ctx> { + type InsertCallbackId = DatabaseMigrationImportChunkInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationImportChunkInsertCallbackId { + DatabaseMigrationImportChunkInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: DatabaseMigrationImportChunkInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for DatabaseMigrationImportChunkTableHandle<'ctx> { + type DeleteCallbackId = DatabaseMigrationImportChunkDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationImportChunkDeleteCallbackId { + DatabaseMigrationImportChunkDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: DatabaseMigrationImportChunkDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct DatabaseMigrationImportChunkUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for DatabaseMigrationImportChunkTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for DatabaseMigrationImportChunkTableHandl } } +impl<'ctx> __sdk::WithUpdate for DatabaseMigrationImportChunkTableHandle<'ctx> { + type UpdateCallbackId = DatabaseMigrationImportChunkUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationImportChunkUpdateCallbackId { + DatabaseMigrationImportChunkUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: DatabaseMigrationImportChunkUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `chunk_key` unique index on the table `database_migration_import_chunk`, /// which allows point queries on the field of the same name /// via the [`DatabaseMigrationImportChunkChunkKeyUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/database_migration_operator_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/database_migration_operator_table.rs index 9eb5c1fa0..1648dbb6b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/database_migration_operator_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/database_migration_operator_table.rs @@ -18,6 +18,18 @@ pub struct DatabaseMigrationOperatorTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `database_migration_operator`. +pub struct DatabaseMigrationOperatorTableAccessor; + +impl __sdk::TableAccessor for DatabaseMigrationOperatorTableAccessor { + type Row = DatabaseMigrationOperator; + type Handle<'db> = DatabaseMigrationOperatorTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.database_migration_operator() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `database_migration_operator`. /// @@ -42,6 +54,18 @@ impl DatabaseMigrationOperatorTableAccess for super::RemoteTables { pub struct DatabaseMigrationOperatorInsertCallbackId(__sdk::CallbackId); pub struct DatabaseMigrationOperatorDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for DatabaseMigrationOperatorTableHandle<'ctx> { + type Row = DatabaseMigrationOperator; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for DatabaseMigrationOperatorTableHandle<'ctx> { type Row = DatabaseMigrationOperator; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for DatabaseMigrationOperatorTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for DatabaseMigrationOperatorTableHandle<'ctx> { + type InsertCallbackId = DatabaseMigrationOperatorInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationOperatorInsertCallbackId { + DatabaseMigrationOperatorInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: DatabaseMigrationOperatorInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for DatabaseMigrationOperatorTableHandle<'ctx> { + type DeleteCallbackId = DatabaseMigrationOperatorDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationOperatorDeleteCallbackId { + DatabaseMigrationOperatorDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: DatabaseMigrationOperatorDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct DatabaseMigrationOperatorUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for DatabaseMigrationOperatorTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for DatabaseMigrationOperatorTableHandle<' } } +impl<'ctx> __sdk::WithUpdate for DatabaseMigrationOperatorTableHandle<'ctx> { + type UpdateCallbackId = DatabaseMigrationOperatorUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> DatabaseMigrationOperatorUpdateCallbackId { + DatabaseMigrationOperatorUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: DatabaseMigrationOperatorUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `operator_identity` unique index on the table `database_migration_operator`, /// which allows point queries on the field of the same name /// via the [`DatabaseMigrationOperatorOperatorIdentityUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_agent_conversation_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_agent_conversation_table.rs index 09558b858..0caee8932 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_agent_conversation_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_agent_conversation_table.rs @@ -18,6 +18,18 @@ pub struct EditorAgentConversationTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_agent_conversation`. +pub struct EditorAgentConversationTableAccessor; + +impl __sdk::TableAccessor for EditorAgentConversationTableAccessor { + type Row = EditorAgentConversation; + type Handle<'db> = EditorAgentConversationTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_agent_conversation() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_agent_conversation`. /// @@ -42,6 +54,18 @@ impl EditorAgentConversationTableAccess for super::RemoteTables { pub struct EditorAgentConversationInsertCallbackId(__sdk::CallbackId); pub struct EditorAgentConversationDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorAgentConversationTableHandle<'ctx> { + type Row = EditorAgentConversation; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorAgentConversationTableHandle<'ctx> { type Row = EditorAgentConversation; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for EditorAgentConversationTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorAgentConversationTableHandle<'ctx> { + type InsertCallbackId = EditorAgentConversationInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorAgentConversationInsertCallbackId { + EditorAgentConversationInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorAgentConversationInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorAgentConversationTableHandle<'ctx> { + type DeleteCallbackId = EditorAgentConversationDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorAgentConversationDeleteCallbackId { + EditorAgentConversationDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorAgentConversationDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorAgentConversationUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorAgentConversationTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorAgentConversationTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate for EditorAgentConversationTableHandle<'ctx> { + type UpdateCallbackId = EditorAgentConversationUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorAgentConversationUpdateCallbackId { + EditorAgentConversationUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorAgentConversationUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `conversation_id` unique index on the table `editor_agent_conversation`, /// which allows point queries on the field of the same name /// via the [`EditorAgentConversationConversationIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_folder_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_folder_table.rs index d90c63756..2fbdf5e50 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_folder_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_folder_table.rs @@ -18,6 +18,18 @@ pub struct EditorAssetFolderTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_asset_folder`. +pub struct EditorAssetFolderTableAccessor; + +impl __sdk::TableAccessor for EditorAssetFolderTableAccessor { + type Row = EditorAssetFolder; + type Handle<'db> = EditorAssetFolderTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_asset_folder() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_asset_folder`. /// @@ -42,6 +54,18 @@ impl EditorAssetFolderTableAccess for super::RemoteTables { pub struct EditorAssetFolderInsertCallbackId(__sdk::CallbackId); pub struct EditorAssetFolderDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorAssetFolderTableHandle<'ctx> { + type Row = EditorAssetFolder; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorAssetFolderTableHandle<'ctx> { type Row = EditorAssetFolder; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for EditorAssetFolderTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorAssetFolderTableHandle<'ctx> { + type InsertCallbackId = EditorAssetFolderInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorAssetFolderInsertCallbackId { + EditorAssetFolderInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorAssetFolderInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorAssetFolderTableHandle<'ctx> { + type DeleteCallbackId = EditorAssetFolderDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorAssetFolderDeleteCallbackId { + EditorAssetFolderDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorAssetFolderDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorAssetFolderUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorAssetFolderTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorAssetFolderTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for EditorAssetFolderTableHandle<'ctx> { + type UpdateCallbackId = EditorAssetFolderUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorAssetFolderUpdateCallbackId { + EditorAssetFolderUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorAssetFolderUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `folder_id` unique index on the table `editor_asset_folder`, /// which allows point queries on the field of the same name /// via the [`EditorAssetFolderFolderIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_group_cohort_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_group_cohort_table.rs index 787eb2d5d..a1abfaf9b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_group_cohort_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_group_cohort_table.rs @@ -18,6 +18,18 @@ pub struct EditorAssetGroupCohortTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_asset_group_cohort`. +pub struct EditorAssetGroupCohortTableAccessor; + +impl __sdk::TableAccessor for EditorAssetGroupCohortTableAccessor { + type Row = EditorAssetGroupCohort; + type Handle<'db> = EditorAssetGroupCohortTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_asset_group_cohort() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_asset_group_cohort`. /// @@ -42,6 +54,18 @@ impl EditorAssetGroupCohortTableAccess for super::RemoteTables { pub struct EditorAssetGroupCohortInsertCallbackId(__sdk::CallbackId); pub struct EditorAssetGroupCohortDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorAssetGroupCohortTableHandle<'ctx> { + type Row = EditorAssetGroupCohort; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorAssetGroupCohortTableHandle<'ctx> { type Row = EditorAssetGroupCohort; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for EditorAssetGroupCohortTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorAssetGroupCohortTableHandle<'ctx> { + type InsertCallbackId = EditorAssetGroupCohortInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorAssetGroupCohortInsertCallbackId { + EditorAssetGroupCohortInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorAssetGroupCohortInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorAssetGroupCohortTableHandle<'ctx> { + type DeleteCallbackId = EditorAssetGroupCohortDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorAssetGroupCohortDeleteCallbackId { + EditorAssetGroupCohortDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorAssetGroupCohortDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorAssetGroupCohortUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorAssetGroupCohortTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorAssetGroupCohortTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate for EditorAssetGroupCohortTableHandle<'ctx> { + type UpdateCallbackId = EditorAssetGroupCohortUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorAssetGroupCohortUpdateCallbackId { + EditorAssetGroupCohortUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorAssetGroupCohortUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `cohort_id` unique index on the table `editor_asset_group_cohort`, /// which allows point queries on the field of the same name /// via the [`EditorAssetGroupCohortCohortIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_group_source_provenance_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_group_source_provenance_table.rs index cc67c43e8..400e4f147 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_group_source_provenance_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_group_source_provenance_table.rs @@ -18,6 +18,18 @@ pub struct EditorAssetGroupSourceProvenanceTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_asset_group_source_provenance`. +pub struct EditorAssetGroupSourceProvenanceTableAccessor; + +impl __sdk::TableAccessor for EditorAssetGroupSourceProvenanceTableAccessor { + type Row = EditorAssetGroupSourceProvenance; + type Handle<'db> = EditorAssetGroupSourceProvenanceTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_asset_group_source_provenance() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_asset_group_source_provenance`. /// @@ -46,6 +58,18 @@ impl EditorAssetGroupSourceProvenanceTableAccess for super::RemoteTables { pub struct EditorAssetGroupSourceProvenanceInsertCallbackId(__sdk::CallbackId); pub struct EditorAssetGroupSourceProvenanceDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorAssetGroupSourceProvenanceTableHandle<'ctx> { + type Row = EditorAssetGroupSourceProvenance; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorAssetGroupSourceProvenanceTableHandle<'ctx> { type Row = EditorAssetGroupSourceProvenance; type EventContext = super::EventContext; @@ -84,6 +108,36 @@ impl<'ctx> __sdk::Table for EditorAssetGroupSourceProvenanceTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorAssetGroupSourceProvenanceTableHandle<'ctx> { + type InsertCallbackId = EditorAssetGroupSourceProvenanceInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorAssetGroupSourceProvenanceInsertCallbackId { + EditorAssetGroupSourceProvenanceInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorAssetGroupSourceProvenanceInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorAssetGroupSourceProvenanceTableHandle<'ctx> { + type DeleteCallbackId = EditorAssetGroupSourceProvenanceDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorAssetGroupSourceProvenanceDeleteCallbackId { + EditorAssetGroupSourceProvenanceDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorAssetGroupSourceProvenanceDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorAssetGroupSourceProvenanceUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorAssetGroupSourceProvenanceTableHandle<'ctx> { @@ -101,6 +155,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorAssetGroupSourceProvenanceTableH } } +impl<'ctx> __sdk::WithUpdate for EditorAssetGroupSourceProvenanceTableHandle<'ctx> { + type UpdateCallbackId = EditorAssetGroupSourceProvenanceUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorAssetGroupSourceProvenanceUpdateCallbackId { + EditorAssetGroupSourceProvenanceUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorAssetGroupSourceProvenanceUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `lookup_key` unique index on the table `editor_asset_group_source_provenance`, /// which allows point queries on the field of the same name /// via the [`EditorAssetGroupSourceProvenanceLookupKeyUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_table.rs index 2bb93bb2c..16adc7d21 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_asset_table.rs @@ -18,6 +18,18 @@ pub struct EditorAssetTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_asset`. +pub struct EditorAssetTableAccessor; + +impl __sdk::TableAccessor for EditorAssetTableAccessor { + type Row = EditorAsset; + type Handle<'db> = EditorAssetTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_asset() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_asset`. /// @@ -40,6 +52,18 @@ impl EditorAssetTableAccess for super::RemoteTables { pub struct EditorAssetInsertCallbackId(__sdk::CallbackId); pub struct EditorAssetDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorAssetTableHandle<'ctx> { + type Row = EditorAsset; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorAssetTableHandle<'ctx> { type Row = EditorAsset; type EventContext = super::EventContext; @@ -78,6 +102,36 @@ impl<'ctx> __sdk::Table for EditorAssetTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorAssetTableHandle<'ctx> { + type InsertCallbackId = EditorAssetInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorAssetInsertCallbackId { + EditorAssetInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorAssetInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorAssetTableHandle<'ctx> { + type DeleteCallbackId = EditorAssetDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorAssetDeleteCallbackId { + EditorAssetDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorAssetDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorAssetUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorAssetTableHandle<'ctx> { @@ -95,6 +149,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorAssetTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for EditorAssetTableHandle<'ctx> { + type UpdateCallbackId = EditorAssetUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorAssetUpdateCallbackId { + EditorAssetUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorAssetUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `asset_id` unique index on the table `editor_asset`, /// which allows point queries on the field of the same name /// via the [`EditorAssetAssetIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_generation_dialog_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_generation_dialog_table.rs index 353947c22..f8417ba46 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_generation_dialog_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_generation_dialog_table.rs @@ -18,6 +18,18 @@ pub struct EditorCanvasGenerationDialogTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_canvas_generation_dialog`. +pub struct EditorCanvasGenerationDialogTableAccessor; + +impl __sdk::TableAccessor for EditorCanvasGenerationDialogTableAccessor { + type Row = EditorCanvasGenerationDialog; + type Handle<'db> = EditorCanvasGenerationDialogTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_canvas_generation_dialog() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_canvas_generation_dialog`. /// @@ -42,6 +54,18 @@ impl EditorCanvasGenerationDialogTableAccess for super::RemoteTables { pub struct EditorCanvasGenerationDialogInsertCallbackId(__sdk::CallbackId); pub struct EditorCanvasGenerationDialogDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorCanvasGenerationDialogTableHandle<'ctx> { + type Row = EditorCanvasGenerationDialog; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorCanvasGenerationDialogTableHandle<'ctx> { type Row = EditorCanvasGenerationDialog; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for EditorCanvasGenerationDialogTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorCanvasGenerationDialogTableHandle<'ctx> { + type InsertCallbackId = EditorCanvasGenerationDialogInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorCanvasGenerationDialogInsertCallbackId { + EditorCanvasGenerationDialogInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorCanvasGenerationDialogInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorCanvasGenerationDialogTableHandle<'ctx> { + type DeleteCallbackId = EditorCanvasGenerationDialogDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorCanvasGenerationDialogDeleteCallbackId { + EditorCanvasGenerationDialogDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorCanvasGenerationDialogDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorCanvasGenerationDialogUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorCanvasGenerationDialogTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorCanvasGenerationDialogTableHandl } } +impl<'ctx> __sdk::WithUpdate for EditorCanvasGenerationDialogTableHandle<'ctx> { + type UpdateCallbackId = EditorCanvasGenerationDialogUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorCanvasGenerationDialogUpdateCallbackId { + EditorCanvasGenerationDialogUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorCanvasGenerationDialogUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `dialog_key` unique index on the table `editor_canvas_generation_dialog`, /// which allows point queries on the field of the same name /// via the [`EditorCanvasGenerationDialogDialogKeyUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_layer_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_layer_table.rs index d3561fe47..4c194bca2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_layer_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_layer_table.rs @@ -18,6 +18,18 @@ pub struct EditorCanvasLayerTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_canvas_layer`. +pub struct EditorCanvasLayerTableAccessor; + +impl __sdk::TableAccessor for EditorCanvasLayerTableAccessor { + type Row = EditorCanvasLayer; + type Handle<'db> = EditorCanvasLayerTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_canvas_layer() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_canvas_layer`. /// @@ -42,6 +54,18 @@ impl EditorCanvasLayerTableAccess for super::RemoteTables { pub struct EditorCanvasLayerInsertCallbackId(__sdk::CallbackId); pub struct EditorCanvasLayerDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorCanvasLayerTableHandle<'ctx> { + type Row = EditorCanvasLayer; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorCanvasLayerTableHandle<'ctx> { type Row = EditorCanvasLayer; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for EditorCanvasLayerTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorCanvasLayerTableHandle<'ctx> { + type InsertCallbackId = EditorCanvasLayerInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorCanvasLayerInsertCallbackId { + EditorCanvasLayerInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorCanvasLayerInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorCanvasLayerTableHandle<'ctx> { + type DeleteCallbackId = EditorCanvasLayerDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorCanvasLayerDeleteCallbackId { + EditorCanvasLayerDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorCanvasLayerDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorCanvasLayerUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorCanvasLayerTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorCanvasLayerTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for EditorCanvasLayerTableHandle<'ctx> { + type UpdateCallbackId = EditorCanvasLayerUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorCanvasLayerUpdateCallbackId { + EditorCanvasLayerUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorCanvasLayerUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `layer_key` unique index on the table `editor_canvas_layer`, /// which allows point queries on the field of the same name /// via the [`EditorCanvasLayerLayerKeyUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_layout_migration_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_layout_migration_table.rs index 77dfffaf4..0cad0e61d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_layout_migration_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_layout_migration_table.rs @@ -18,6 +18,18 @@ pub struct EditorCanvasLayoutMigrationTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_canvas_layout_migration`. +pub struct EditorCanvasLayoutMigrationTableAccessor; + +impl __sdk::TableAccessor for EditorCanvasLayoutMigrationTableAccessor { + type Row = EditorCanvasLayoutMigration; + type Handle<'db> = EditorCanvasLayoutMigrationTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_canvas_layout_migration() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_canvas_layout_migration`. /// @@ -42,6 +54,18 @@ impl EditorCanvasLayoutMigrationTableAccess for super::RemoteTables { pub struct EditorCanvasLayoutMigrationInsertCallbackId(__sdk::CallbackId); pub struct EditorCanvasLayoutMigrationDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorCanvasLayoutMigrationTableHandle<'ctx> { + type Row = EditorCanvasLayoutMigration; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorCanvasLayoutMigrationTableHandle<'ctx> { type Row = EditorCanvasLayoutMigration; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for EditorCanvasLayoutMigrationTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorCanvasLayoutMigrationTableHandle<'ctx> { + type InsertCallbackId = EditorCanvasLayoutMigrationInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorCanvasLayoutMigrationInsertCallbackId { + EditorCanvasLayoutMigrationInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorCanvasLayoutMigrationInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorCanvasLayoutMigrationTableHandle<'ctx> { + type DeleteCallbackId = EditorCanvasLayoutMigrationDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorCanvasLayoutMigrationDeleteCallbackId { + EditorCanvasLayoutMigrationDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorCanvasLayoutMigrationDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorCanvasLayoutMigrationUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorCanvasLayoutMigrationTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorCanvasLayoutMigrationTableHandle } } +impl<'ctx> __sdk::WithUpdate for EditorCanvasLayoutMigrationTableHandle<'ctx> { + type UpdateCallbackId = EditorCanvasLayoutMigrationUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorCanvasLayoutMigrationUpdateCallbackId { + EditorCanvasLayoutMigrationUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorCanvasLayoutMigrationUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `canvas_id` unique index on the table `editor_canvas_layout_migration`, /// which allows point queries on the field of the same name /// via the [`EditorCanvasLayoutMigrationCanvasIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_table.rs index 6e0eb9c8e..30145f4c1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_canvas_table.rs @@ -18,6 +18,18 @@ pub struct EditorCanvasTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_canvas`. +pub struct EditorCanvasTableAccessor; + +impl __sdk::TableAccessor for EditorCanvasTableAccessor { + type Row = EditorCanvas; + type Handle<'db> = EditorCanvasTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_canvas() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_canvas`. /// @@ -40,6 +52,18 @@ impl EditorCanvasTableAccess for super::RemoteTables { pub struct EditorCanvasInsertCallbackId(__sdk::CallbackId); pub struct EditorCanvasDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorCanvasTableHandle<'ctx> { + type Row = EditorCanvas; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorCanvasTableHandle<'ctx> { type Row = EditorCanvas; type EventContext = super::EventContext; @@ -78,6 +102,36 @@ impl<'ctx> __sdk::Table for EditorCanvasTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorCanvasTableHandle<'ctx> { + type InsertCallbackId = EditorCanvasInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorCanvasInsertCallbackId { + EditorCanvasInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorCanvasInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorCanvasTableHandle<'ctx> { + type DeleteCallbackId = EditorCanvasDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorCanvasDeleteCallbackId { + EditorCanvasDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorCanvasDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorCanvasUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorCanvasTableHandle<'ctx> { @@ -95,6 +149,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorCanvasTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for EditorCanvasTableHandle<'ctx> { + type UpdateCallbackId = EditorCanvasUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorCanvasUpdateCallbackId { + EditorCanvasUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorCanvasUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `canvas_id` unique index on the table `editor_canvas`, /// which allows point queries on the field of the same name /// via the [`EditorCanvasCanvasIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_generation_pricing_config_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_generation_pricing_config_table.rs index 1845200d7..65ada83ed 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_generation_pricing_config_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_generation_pricing_config_table.rs @@ -19,6 +19,18 @@ pub struct EditorGenerationPricingConfigTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_generation_pricing_config`. +pub struct EditorGenerationPricingConfigTableAccessor; + +impl __sdk::TableAccessor for EditorGenerationPricingConfigTableAccessor { + type Row = EditorGenerationPricingConfig; + type Handle<'db> = EditorGenerationPricingConfigTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_generation_pricing_config() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_generation_pricing_config`. /// @@ -43,6 +55,18 @@ impl EditorGenerationPricingConfigTableAccess for super::RemoteTables { pub struct EditorGenerationPricingConfigInsertCallbackId(__sdk::CallbackId); pub struct EditorGenerationPricingConfigDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorGenerationPricingConfigTableHandle<'ctx> { + type Row = EditorGenerationPricingConfig; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorGenerationPricingConfigTableHandle<'ctx> { type Row = EditorGenerationPricingConfig; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for EditorGenerationPricingConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorGenerationPricingConfigTableHandle<'ctx> { + type InsertCallbackId = EditorGenerationPricingConfigInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorGenerationPricingConfigInsertCallbackId { + EditorGenerationPricingConfigInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorGenerationPricingConfigInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorGenerationPricingConfigTableHandle<'ctx> { + type DeleteCallbackId = EditorGenerationPricingConfigDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorGenerationPricingConfigDeleteCallbackId { + EditorGenerationPricingConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorGenerationPricingConfigDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorGenerationPricingConfigUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorGenerationPricingConfigTableHandle<'ctx> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorGenerationPricingConfigTableHand } } +impl<'ctx> __sdk::WithUpdate for EditorGenerationPricingConfigTableHandle<'ctx> { + type UpdateCallbackId = EditorGenerationPricingConfigUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorGenerationPricingConfigUpdateCallbackId { + EditorGenerationPricingConfigUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorGenerationPricingConfigUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `config_id` unique index on the table `editor_generation_pricing_config`, /// which allows point queries on the field of the same name /// via the [`EditorGenerationPricingConfigConfigIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_generation_runtime_identity_rotation_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_generation_runtime_identity_rotation_table.rs index 6106cc384..0e044eb5e 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_generation_runtime_identity_rotation_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_generation_runtime_identity_rotation_table.rs @@ -18,6 +18,20 @@ pub struct EditorGenerationRuntimeIdentityRotationTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_generation_runtime_identity_rotation`. +pub struct EditorGenerationRuntimeIdentityRotationTableAccessor; + +impl __sdk::TableAccessor + for EditorGenerationRuntimeIdentityRotationTableAccessor +{ + type Row = EditorGenerationRuntimeIdentityRotation; + type Handle<'db> = EditorGenerationRuntimeIdentityRotationTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_generation_runtime_identity_rotation() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_generation_runtime_identity_rotation`. /// @@ -48,6 +62,18 @@ impl EditorGenerationRuntimeIdentityRotationTableAccess for super::RemoteTables pub struct EditorGenerationRuntimeIdentityRotationInsertCallbackId(__sdk::CallbackId); pub struct EditorGenerationRuntimeIdentityRotationDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorGenerationRuntimeIdentityRotationTableHandle<'ctx> { + type Row = EditorGenerationRuntimeIdentityRotation; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorGenerationRuntimeIdentityRotationTableHandle<'ctx> { type Row = EditorGenerationRuntimeIdentityRotation; type EventContext = super::EventContext; @@ -90,6 +116,40 @@ impl<'ctx> __sdk::Table for EditorGenerationRuntimeIdentityRotationTableHandle<' } } +impl<'ctx> __sdk::WithInsert for EditorGenerationRuntimeIdentityRotationTableHandle<'ctx> { + type InsertCallbackId = EditorGenerationRuntimeIdentityRotationInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorGenerationRuntimeIdentityRotationInsertCallbackId { + EditorGenerationRuntimeIdentityRotationInsertCallbackId( + self.imp.on_insert(Box::new(callback)), + ) + } + + fn remove_on_insert(&self, callback: EditorGenerationRuntimeIdentityRotationInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorGenerationRuntimeIdentityRotationTableHandle<'ctx> { + type DeleteCallbackId = EditorGenerationRuntimeIdentityRotationDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorGenerationRuntimeIdentityRotationDeleteCallbackId { + EditorGenerationRuntimeIdentityRotationDeleteCallbackId( + self.imp.on_delete(Box::new(callback)), + ) + } + + fn remove_on_delete(&self, callback: EditorGenerationRuntimeIdentityRotationDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorGenerationRuntimeIdentityRotationUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorGenerationRuntimeIdentityRotationTableHandle<'ctx> { @@ -109,6 +169,23 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorGenerationRuntimeIdentityRotatio } } +impl<'ctx> __sdk::WithUpdate for EditorGenerationRuntimeIdentityRotationTableHandle<'ctx> { + type UpdateCallbackId = EditorGenerationRuntimeIdentityRotationUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorGenerationRuntimeIdentityRotationUpdateCallbackId { + EditorGenerationRuntimeIdentityRotationUpdateCallbackId( + self.imp.on_update(Box::new(callback)), + ) + } + + fn remove_on_update(&self, callback: EditorGenerationRuntimeIdentityRotationUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `rotation_id` unique index on the table `editor_generation_runtime_identity_rotation`, /// which allows point queries on the field of the same name /// via the [`EditorGenerationRuntimeIdentityRotationRotationIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_project_resource_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_project_resource_table.rs index 47208d830..760ec8c6d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_project_resource_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_project_resource_table.rs @@ -18,6 +18,18 @@ pub struct EditorProjectResourceTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_project_resource`. +pub struct EditorProjectResourceTableAccessor; + +impl __sdk::TableAccessor for EditorProjectResourceTableAccessor { + type Row = EditorProjectResource; + type Handle<'db> = EditorProjectResourceTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_project_resource() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_project_resource`. /// @@ -42,6 +54,18 @@ impl EditorProjectResourceTableAccess for super::RemoteTables { pub struct EditorProjectResourceInsertCallbackId(__sdk::CallbackId); pub struct EditorProjectResourceDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorProjectResourceTableHandle<'ctx> { + type Row = EditorProjectResource; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorProjectResourceTableHandle<'ctx> { type Row = EditorProjectResource; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for EditorProjectResourceTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorProjectResourceTableHandle<'ctx> { + type InsertCallbackId = EditorProjectResourceInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorProjectResourceInsertCallbackId { + EditorProjectResourceInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorProjectResourceInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorProjectResourceTableHandle<'ctx> { + type DeleteCallbackId = EditorProjectResourceDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorProjectResourceDeleteCallbackId { + EditorProjectResourceDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorProjectResourceDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorProjectResourceUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorProjectResourceTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorProjectResourceTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for EditorProjectResourceTableHandle<'ctx> { + type UpdateCallbackId = EditorProjectResourceUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorProjectResourceUpdateCallbackId { + EditorProjectResourceUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorProjectResourceUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `resource_id` unique index on the table `editor_project_resource`, /// which allows point queries on the field of the same name /// via the [`EditorProjectResourceResourceIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_project_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_project_table.rs index 98c062cf2..443aca59a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_project_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_project_table.rs @@ -18,6 +18,18 @@ pub struct EditorProjectTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_project`. +pub struct EditorProjectTableAccessor; + +impl __sdk::TableAccessor for EditorProjectTableAccessor { + type Row = EditorProject; + type Handle<'db> = EditorProjectTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_project() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_project`. /// @@ -40,6 +52,18 @@ impl EditorProjectTableAccess for super::RemoteTables { pub struct EditorProjectInsertCallbackId(__sdk::CallbackId); pub struct EditorProjectDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorProjectTableHandle<'ctx> { + type Row = EditorProject; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorProjectTableHandle<'ctx> { type Row = EditorProject; type EventContext = super::EventContext; @@ -78,6 +102,36 @@ impl<'ctx> __sdk::Table for EditorProjectTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorProjectTableHandle<'ctx> { + type InsertCallbackId = EditorProjectInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorProjectInsertCallbackId { + EditorProjectInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorProjectInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorProjectTableHandle<'ctx> { + type DeleteCallbackId = EditorProjectDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorProjectDeleteCallbackId { + EditorProjectDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorProjectDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorProjectUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorProjectTableHandle<'ctx> { @@ -95,6 +149,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorProjectTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for EditorProjectTableHandle<'ctx> { + type UpdateCallbackId = EditorProjectUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorProjectUpdateCallbackId { + EditorProjectUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorProjectUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `project_id` unique index on the table `editor_project`, /// which allows point queries on the field of the same name /// via the [`EditorProjectProjectIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_asset_like_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_asset_like_table.rs index ab54e1420..632275662 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_asset_like_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_asset_like_table.rs @@ -18,6 +18,18 @@ pub struct EditorShowcaseAssetLikeTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_showcase_asset_like`. +pub struct EditorShowcaseAssetLikeTableAccessor; + +impl __sdk::TableAccessor for EditorShowcaseAssetLikeTableAccessor { + type Row = EditorShowcaseAssetLike; + type Handle<'db> = EditorShowcaseAssetLikeTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_showcase_asset_like() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_showcase_asset_like`. /// @@ -42,6 +54,18 @@ impl EditorShowcaseAssetLikeTableAccess for super::RemoteTables { pub struct EditorShowcaseAssetLikeInsertCallbackId(__sdk::CallbackId); pub struct EditorShowcaseAssetLikeDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorShowcaseAssetLikeTableHandle<'ctx> { + type Row = EditorShowcaseAssetLike; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorShowcaseAssetLikeTableHandle<'ctx> { type Row = EditorShowcaseAssetLike; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for EditorShowcaseAssetLikeTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorShowcaseAssetLikeTableHandle<'ctx> { + type InsertCallbackId = EditorShowcaseAssetLikeInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorShowcaseAssetLikeInsertCallbackId { + EditorShowcaseAssetLikeInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorShowcaseAssetLikeInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorShowcaseAssetLikeTableHandle<'ctx> { + type DeleteCallbackId = EditorShowcaseAssetLikeDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorShowcaseAssetLikeDeleteCallbackId { + EditorShowcaseAssetLikeDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorShowcaseAssetLikeDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorShowcaseAssetLikeUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorShowcaseAssetLikeTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorShowcaseAssetLikeTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate for EditorShowcaseAssetLikeTableHandle<'ctx> { + type UpdateCallbackId = EditorShowcaseAssetLikeUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorShowcaseAssetLikeUpdateCallbackId { + EditorShowcaseAssetLikeUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorShowcaseAssetLikeUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `like_id` unique index on the table `editor_showcase_asset_like`, /// which allows point queries on the field of the same name /// via the [`EditorShowcaseAssetLikeLikeIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_asset_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_asset_table.rs index 3c12986be..1d7eb2983 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_asset_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_asset_table.rs @@ -18,6 +18,18 @@ pub struct EditorShowcaseAssetTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_showcase_asset`. +pub struct EditorShowcaseAssetTableAccessor; + +impl __sdk::TableAccessor for EditorShowcaseAssetTableAccessor { + type Row = EditorShowcaseAsset; + type Handle<'db> = EditorShowcaseAssetTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_showcase_asset() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_showcase_asset`. /// @@ -42,6 +54,18 @@ impl EditorShowcaseAssetTableAccess for super::RemoteTables { pub struct EditorShowcaseAssetInsertCallbackId(__sdk::CallbackId); pub struct EditorShowcaseAssetDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorShowcaseAssetTableHandle<'ctx> { + type Row = EditorShowcaseAsset; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorShowcaseAssetTableHandle<'ctx> { type Row = EditorShowcaseAsset; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for EditorShowcaseAssetTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorShowcaseAssetTableHandle<'ctx> { + type InsertCallbackId = EditorShowcaseAssetInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorShowcaseAssetInsertCallbackId { + EditorShowcaseAssetInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorShowcaseAssetInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorShowcaseAssetTableHandle<'ctx> { + type DeleteCallbackId = EditorShowcaseAssetDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorShowcaseAssetDeleteCallbackId { + EditorShowcaseAssetDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorShowcaseAssetDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorShowcaseAssetUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorShowcaseAssetTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorShowcaseAssetTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for EditorShowcaseAssetTableHandle<'ctx> { + type UpdateCallbackId = EditorShowcaseAssetUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorShowcaseAssetUpdateCallbackId { + EditorShowcaseAssetUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorShowcaseAssetUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `showcase_id` unique index on the table `editor_showcase_asset`, /// which allows point queries on the field of the same name /// via the [`EditorShowcaseAssetShowcaseIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_campaign_config_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_campaign_config_table.rs index 5e7f913fd..d18916cc9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_campaign_config_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/editor_showcase_campaign_config_table.rs @@ -18,6 +18,18 @@ pub struct EditorShowcaseCampaignConfigTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `editor_showcase_campaign_config`. +pub struct EditorShowcaseCampaignConfigTableAccessor; + +impl __sdk::TableAccessor for EditorShowcaseCampaignConfigTableAccessor { + type Row = EditorShowcaseCampaignConfig; + type Handle<'db> = EditorShowcaseCampaignConfigTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.editor_showcase_campaign_config() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `editor_showcase_campaign_config`. /// @@ -42,6 +54,18 @@ impl EditorShowcaseCampaignConfigTableAccess for super::RemoteTables { pub struct EditorShowcaseCampaignConfigInsertCallbackId(__sdk::CallbackId); pub struct EditorShowcaseCampaignConfigDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for EditorShowcaseCampaignConfigTableHandle<'ctx> { + type Row = EditorShowcaseCampaignConfig; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for EditorShowcaseCampaignConfigTableHandle<'ctx> { type Row = EditorShowcaseCampaignConfig; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for EditorShowcaseCampaignConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for EditorShowcaseCampaignConfigTableHandle<'ctx> { + type InsertCallbackId = EditorShowcaseCampaignConfigInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorShowcaseCampaignConfigInsertCallbackId { + EditorShowcaseCampaignConfigInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: EditorShowcaseCampaignConfigInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for EditorShowcaseCampaignConfigTableHandle<'ctx> { + type DeleteCallbackId = EditorShowcaseCampaignConfigDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> EditorShowcaseCampaignConfigDeleteCallbackId { + EditorShowcaseCampaignConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: EditorShowcaseCampaignConfigDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct EditorShowcaseCampaignConfigUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for EditorShowcaseCampaignConfigTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for EditorShowcaseCampaignConfigTableHandl } } +impl<'ctx> __sdk::WithUpdate for EditorShowcaseCampaignConfigTableHandle<'ctx> { + type UpdateCallbackId = EditorShowcaseCampaignConfigUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> EditorShowcaseCampaignConfigUpdateCallbackId { + EditorShowcaseCampaignConfigUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: EditorShowcaseCampaignConfigUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `config_id` unique index on the table `editor_showcase_campaign_config`, /// which allows point queries on the field of the same name /// via the [`EditorShowcaseCampaignConfigConfigIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/external_api_key_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/external_api_key_table.rs index b07fbdfdd..cecf47e63 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/external_api_key_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/external_api_key_table.rs @@ -18,6 +18,18 @@ pub struct ExternalApiKeyTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `external_api_key`. +pub struct ExternalApiKeyTableAccessor; + +impl __sdk::TableAccessor for ExternalApiKeyTableAccessor { + type Row = ExternalApiKey; + type Handle<'db> = ExternalApiKeyTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.external_api_key() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `external_api_key`. /// @@ -40,6 +52,18 @@ impl ExternalApiKeyTableAccess for super::RemoteTables { pub struct ExternalApiKeyInsertCallbackId(__sdk::CallbackId); pub struct ExternalApiKeyDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ExternalApiKeyTableHandle<'ctx> { + type Row = ExternalApiKey; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ExternalApiKeyTableHandle<'ctx> { type Row = ExternalApiKey; type EventContext = super::EventContext; @@ -78,6 +102,36 @@ impl<'ctx> __sdk::Table for ExternalApiKeyTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ExternalApiKeyTableHandle<'ctx> { + type InsertCallbackId = ExternalApiKeyInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ExternalApiKeyInsertCallbackId { + ExternalApiKeyInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ExternalApiKeyInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ExternalApiKeyTableHandle<'ctx> { + type DeleteCallbackId = ExternalApiKeyDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ExternalApiKeyDeleteCallbackId { + ExternalApiKeyDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ExternalApiKeyDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ExternalApiKeyUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ExternalApiKeyTableHandle<'ctx> { @@ -95,6 +149,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ExternalApiKeyTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for ExternalApiKeyTableHandle<'ctx> { + type UpdateCallbackId = ExternalApiKeyUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ExternalApiKeyUpdateCallbackId { + ExternalApiKeyUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ExternalApiKeyUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `key_id` unique index on the table `external_api_key`, /// which allows point queries on the field of the same name /// via the [`ExternalApiKeyKeyIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_event_table.rs index c808b8594..1cf9faee1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_event_table.rs @@ -18,6 +18,18 @@ pub struct ExternalGenerationJobEventTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `external_generation_job_event`. +pub struct ExternalGenerationJobEventTableAccessor; + +impl __sdk::TableAccessor for ExternalGenerationJobEventTableAccessor { + type Row = ExternalGenerationJobEvent; + type Handle<'db> = ExternalGenerationJobEventTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.external_generation_job_event() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `external_generation_job_event`. /// @@ -42,6 +54,18 @@ impl ExternalGenerationJobEventTableAccess for super::RemoteTables { pub struct ExternalGenerationJobEventInsertCallbackId(__sdk::CallbackId); pub struct ExternalGenerationJobEventDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ExternalGenerationJobEventTableHandle<'ctx> { + type Row = ExternalGenerationJobEvent; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ExternalGenerationJobEventTableHandle<'ctx> { type Row = ExternalGenerationJobEvent; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ExternalGenerationJobEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ExternalGenerationJobEventTableHandle<'ctx> { + type InsertCallbackId = ExternalGenerationJobEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ExternalGenerationJobEventInsertCallbackId { + ExternalGenerationJobEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ExternalGenerationJobEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ExternalGenerationJobEventTableHandle<'ctx> { + type DeleteCallbackId = ExternalGenerationJobEventDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ExternalGenerationJobEventDeleteCallbackId { + ExternalGenerationJobEventDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ExternalGenerationJobEventDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ExternalGenerationJobEventUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ExternalGenerationJobEventTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ExternalGenerationJobEventTableHandle< } } +impl<'ctx> __sdk::WithUpdate for ExternalGenerationJobEventTableHandle<'ctx> { + type UpdateCallbackId = ExternalGenerationJobEventUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ExternalGenerationJobEventUpdateCallbackId { + ExternalGenerationJobEventUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ExternalGenerationJobEventUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `event_id` unique index on the table `external_generation_job_event`, /// which allows point queries on the field of the same name /// via the [`ExternalGenerationJobEventEventIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_summary_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_summary_table.rs index 55e14f63a..b5327f9c9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_summary_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_summary_table.rs @@ -18,6 +18,18 @@ pub struct ExternalGenerationJobSummaryTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `external_generation_job_summary`. +pub struct ExternalGenerationJobSummaryTableAccessor; + +impl __sdk::TableAccessor for ExternalGenerationJobSummaryTableAccessor { + type Row = ExternalGenerationJobSummary; + type Handle<'db> = ExternalGenerationJobSummaryTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.external_generation_job_summary() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `external_generation_job_summary`. /// @@ -42,6 +54,18 @@ impl ExternalGenerationJobSummaryTableAccess for super::RemoteTables { pub struct ExternalGenerationJobSummaryInsertCallbackId(__sdk::CallbackId); pub struct ExternalGenerationJobSummaryDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ExternalGenerationJobSummaryTableHandle<'ctx> { + type Row = ExternalGenerationJobSummary; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ExternalGenerationJobSummaryTableHandle<'ctx> { type Row = ExternalGenerationJobSummary; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ExternalGenerationJobSummaryTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ExternalGenerationJobSummaryTableHandle<'ctx> { + type InsertCallbackId = ExternalGenerationJobSummaryInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ExternalGenerationJobSummaryInsertCallbackId { + ExternalGenerationJobSummaryInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ExternalGenerationJobSummaryInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ExternalGenerationJobSummaryTableHandle<'ctx> { + type DeleteCallbackId = ExternalGenerationJobSummaryDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ExternalGenerationJobSummaryDeleteCallbackId { + ExternalGenerationJobSummaryDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ExternalGenerationJobSummaryDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ExternalGenerationJobSummaryUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ExternalGenerationJobSummaryTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ExternalGenerationJobSummaryTableHandl } } +impl<'ctx> __sdk::WithUpdate for ExternalGenerationJobSummaryTableHandle<'ctx> { + type UpdateCallbackId = ExternalGenerationJobSummaryUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ExternalGenerationJobSummaryUpdateCallbackId { + ExternalGenerationJobSummaryUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ExternalGenerationJobSummaryUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `job_id` unique index on the table `external_generation_job_summary`, /// which allows point queries on the field of the same name /// via the [`ExternalGenerationJobSummaryJobIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_table.rs index 7318cd496..e679447ed 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/external_generation_job_table.rs @@ -18,6 +18,18 @@ pub struct ExternalGenerationJobTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `external_generation_job`. +pub struct ExternalGenerationJobTableAccessor; + +impl __sdk::TableAccessor for ExternalGenerationJobTableAccessor { + type Row = ExternalGenerationJob; + type Handle<'db> = ExternalGenerationJobTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.external_generation_job() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `external_generation_job`. /// @@ -42,6 +54,18 @@ impl ExternalGenerationJobTableAccess for super::RemoteTables { pub struct ExternalGenerationJobInsertCallbackId(__sdk::CallbackId); pub struct ExternalGenerationJobDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ExternalGenerationJobTableHandle<'ctx> { + type Row = ExternalGenerationJob; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ExternalGenerationJobTableHandle<'ctx> { type Row = ExternalGenerationJob; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ExternalGenerationJobTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ExternalGenerationJobTableHandle<'ctx> { + type InsertCallbackId = ExternalGenerationJobInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ExternalGenerationJobInsertCallbackId { + ExternalGenerationJobInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ExternalGenerationJobInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ExternalGenerationJobTableHandle<'ctx> { + type DeleteCallbackId = ExternalGenerationJobDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ExternalGenerationJobDeleteCallbackId { + ExternalGenerationJobDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ExternalGenerationJobDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ExternalGenerationJobUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ExternalGenerationJobTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ExternalGenerationJobTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for ExternalGenerationJobTableHandle<'ctx> { + type UpdateCallbackId = ExternalGenerationJobUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ExternalGenerationJobUpdateCallbackId { + ExternalGenerationJobUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ExternalGenerationJobUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `job_id` unique index on the table `external_generation_job`, /// which allows point queries on the field of the same name /// via the [`ExternalGenerationJobJobIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/feature_gate_config_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/feature_gate_config_table.rs index 0cffbecef..e667cd0a6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/feature_gate_config_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/feature_gate_config_table.rs @@ -18,6 +18,18 @@ pub struct FeatureGateConfigTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `feature_gate_config`. +pub struct FeatureGateConfigTableAccessor; + +impl __sdk::TableAccessor for FeatureGateConfigTableAccessor { + type Row = FeatureGateConfig; + type Handle<'db> = FeatureGateConfigTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.feature_gate_config() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `feature_gate_config`. /// @@ -42,6 +54,18 @@ impl FeatureGateConfigTableAccess for super::RemoteTables { pub struct FeatureGateConfigInsertCallbackId(__sdk::CallbackId); pub struct FeatureGateConfigDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for FeatureGateConfigTableHandle<'ctx> { + type Row = FeatureGateConfig; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for FeatureGateConfigTableHandle<'ctx> { type Row = FeatureGateConfig; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for FeatureGateConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for FeatureGateConfigTableHandle<'ctx> { + type InsertCallbackId = FeatureGateConfigInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> FeatureGateConfigInsertCallbackId { + FeatureGateConfigInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: FeatureGateConfigInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for FeatureGateConfigTableHandle<'ctx> { + type DeleteCallbackId = FeatureGateConfigDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> FeatureGateConfigDeleteCallbackId { + FeatureGateConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: FeatureGateConfigDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct FeatureGateConfigUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for FeatureGateConfigTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for FeatureGateConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for FeatureGateConfigTableHandle<'ctx> { + type UpdateCallbackId = FeatureGateConfigUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> FeatureGateConfigUpdateCallbackId { + FeatureGateConfigUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: FeatureGateConfigUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `gate_key` unique index on the table `feature_gate_config`, /// which allows point queries on the field of the same name /// via the [`FeatureGateConfigGateKeyUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_table.rs index 277df68a0..76786f9e1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/inventory_slot_table.rs @@ -22,6 +22,18 @@ pub struct InventorySlotTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `inventory_slot`. +pub struct InventorySlotTableAccessor; + +impl __sdk::TableAccessor for InventorySlotTableAccessor { + type Row = InventorySlot; + type Handle<'db> = InventorySlotTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.inventory_slot() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `inventory_slot`. /// @@ -44,6 +56,18 @@ impl InventorySlotTableAccess for super::RemoteTables { pub struct InventorySlotInsertCallbackId(__sdk::CallbackId); pub struct InventorySlotDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for InventorySlotTableHandle<'ctx> { + type Row = InventorySlot; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for InventorySlotTableHandle<'ctx> { type Row = InventorySlot; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for InventorySlotTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for InventorySlotTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for InventorySlotTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for InventorySlotTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_agent_session_table.rs index 7e77ef24f..62ca0e530 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_agent_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_agent_session_table.rs @@ -18,6 +18,18 @@ pub struct JumpHopAgentSessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `jump_hop_agent_session`. +pub struct JumpHopAgentSessionTableAccessor; + +impl __sdk::TableAccessor for JumpHopAgentSessionTableAccessor { + type Row = JumpHopAgentSessionRow; + type Handle<'db> = JumpHopAgentSessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.jump_hop_agent_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `jump_hop_agent_session`. /// @@ -42,6 +54,18 @@ impl JumpHopAgentSessionTableAccess for super::RemoteTables { pub struct JumpHopAgentSessionInsertCallbackId(__sdk::CallbackId); pub struct JumpHopAgentSessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for JumpHopAgentSessionTableHandle<'ctx> { + type Row = JumpHopAgentSessionRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for JumpHopAgentSessionTableHandle<'ctx> { type Row = JumpHopAgentSessionRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for JumpHopAgentSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for JumpHopAgentSessionTableHandle<'ctx> { + type InsertCallbackId = JumpHopAgentSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> JumpHopAgentSessionInsertCallbackId { + JumpHopAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: JumpHopAgentSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for JumpHopAgentSessionTableHandle<'ctx> { + type DeleteCallbackId = JumpHopAgentSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> JumpHopAgentSessionDeleteCallbackId { + JumpHopAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: JumpHopAgentSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct JumpHopAgentSessionUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopAgentSessionTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopAgentSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for JumpHopAgentSessionTableHandle<'ctx> { + type UpdateCallbackId = JumpHopAgentSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> JumpHopAgentSessionUpdateCallbackId { + JumpHopAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: JumpHopAgentSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `session_id` unique index on the table `jump_hop_agent_session`, /// which allows point queries on the field of the same name /// via the [`JumpHopAgentSessionSessionIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_event_table.rs index 8070f7a84..5690cfc9a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_event_table.rs @@ -18,6 +18,18 @@ pub struct JumpHopEventTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `jump_hop_event`. +pub struct JumpHopEventTableAccessor; + +impl __sdk::TableAccessor for JumpHopEventTableAccessor { + type Row = JumpHopEventRow; + type Handle<'db> = JumpHopEventTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.jump_hop_event() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `jump_hop_event`. /// @@ -40,6 +52,18 @@ impl JumpHopEventTableAccess for super::RemoteTables { pub struct JumpHopEventInsertCallbackId(__sdk::CallbackId); pub struct JumpHopEventDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for JumpHopEventTableHandle<'ctx> { + type Row = JumpHopEventRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for JumpHopEventTableHandle<'ctx> { type Row = JumpHopEventRow; type EventContext = super::EventContext; @@ -78,6 +102,36 @@ impl<'ctx> __sdk::Table for JumpHopEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for JumpHopEventTableHandle<'ctx> { + type InsertCallbackId = JumpHopEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> JumpHopEventInsertCallbackId { + JumpHopEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: JumpHopEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for JumpHopEventTableHandle<'ctx> { + type DeleteCallbackId = JumpHopEventDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> JumpHopEventDeleteCallbackId { + JumpHopEventDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: JumpHopEventDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct JumpHopEventUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopEventTableHandle<'ctx> { @@ -95,6 +149,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for JumpHopEventTableHandle<'ctx> { + type UpdateCallbackId = JumpHopEventUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> JumpHopEventUpdateCallbackId { + JumpHopEventUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: JumpHopEventUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `event_id` unique index on the table `jump_hop_event`, /// which allows point queries on the field of the same name /// via the [`JumpHopEventEventIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_leaderboard_entry_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_leaderboard_entry_table.rs index 1d6ea6ec0..960cb02a2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_leaderboard_entry_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_leaderboard_entry_table.rs @@ -18,6 +18,18 @@ pub struct JumpHopLeaderboardEntryTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `jump_hop_leaderboard_entry`. +pub struct JumpHopLeaderboardEntryTableAccessor; + +impl __sdk::TableAccessor for JumpHopLeaderboardEntryTableAccessor { + type Row = JumpHopLeaderboardEntryRow; + type Handle<'db> = JumpHopLeaderboardEntryTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.jump_hop_leaderboard_entry() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `jump_hop_leaderboard_entry`. /// @@ -42,6 +54,18 @@ impl JumpHopLeaderboardEntryTableAccess for super::RemoteTables { pub struct JumpHopLeaderboardEntryInsertCallbackId(__sdk::CallbackId); pub struct JumpHopLeaderboardEntryDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for JumpHopLeaderboardEntryTableHandle<'ctx> { + type Row = JumpHopLeaderboardEntryRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for JumpHopLeaderboardEntryTableHandle<'ctx> { type Row = JumpHopLeaderboardEntryRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for JumpHopLeaderboardEntryTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for JumpHopLeaderboardEntryTableHandle<'ctx> { + type InsertCallbackId = JumpHopLeaderboardEntryInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> JumpHopLeaderboardEntryInsertCallbackId { + JumpHopLeaderboardEntryInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: JumpHopLeaderboardEntryInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for JumpHopLeaderboardEntryTableHandle<'ctx> { + type DeleteCallbackId = JumpHopLeaderboardEntryDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> JumpHopLeaderboardEntryDeleteCallbackId { + JumpHopLeaderboardEntryDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: JumpHopLeaderboardEntryDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct JumpHopLeaderboardEntryUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopLeaderboardEntryTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopLeaderboardEntryTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate for JumpHopLeaderboardEntryTableHandle<'ctx> { + type UpdateCallbackId = JumpHopLeaderboardEntryUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> JumpHopLeaderboardEntryUpdateCallbackId { + JumpHopLeaderboardEntryUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: JumpHopLeaderboardEntryUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `entry_id` unique index on the table `jump_hop_leaderboard_entry`, /// which allows point queries on the field of the same name /// via the [`JumpHopLeaderboardEntryEntryIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_runtime_run_table.rs index 1fd4bab96..64e23a7ee 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_runtime_run_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_runtime_run_table.rs @@ -18,6 +18,18 @@ pub struct JumpHopRuntimeRunTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `jump_hop_runtime_run`. +pub struct JumpHopRuntimeRunTableAccessor; + +impl __sdk::TableAccessor for JumpHopRuntimeRunTableAccessor { + type Row = JumpHopRuntimeRunRow; + type Handle<'db> = JumpHopRuntimeRunTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.jump_hop_runtime_run() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `jump_hop_runtime_run`. /// @@ -42,6 +54,18 @@ impl JumpHopRuntimeRunTableAccess for super::RemoteTables { pub struct JumpHopRuntimeRunInsertCallbackId(__sdk::CallbackId); pub struct JumpHopRuntimeRunDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for JumpHopRuntimeRunTableHandle<'ctx> { + type Row = JumpHopRuntimeRunRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for JumpHopRuntimeRunTableHandle<'ctx> { type Row = JumpHopRuntimeRunRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for JumpHopRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for JumpHopRuntimeRunTableHandle<'ctx> { + type InsertCallbackId = JumpHopRuntimeRunInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> JumpHopRuntimeRunInsertCallbackId { + JumpHopRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: JumpHopRuntimeRunInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for JumpHopRuntimeRunTableHandle<'ctx> { + type DeleteCallbackId = JumpHopRuntimeRunDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> JumpHopRuntimeRunDeleteCallbackId { + JumpHopRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: JumpHopRuntimeRunDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct JumpHopRuntimeRunUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopRuntimeRunTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for JumpHopRuntimeRunTableHandle<'ctx> { + type UpdateCallbackId = JumpHopRuntimeRunUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> JumpHopRuntimeRunUpdateCallbackId { + JumpHopRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: JumpHopRuntimeRunUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `run_id` unique index on the table `jump_hop_runtime_run`, /// which allows point queries on the field of the same name /// via the [`JumpHopRuntimeRunRunIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_work_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_work_profile_table.rs index cdc2c77f3..aca645f75 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_work_profile_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/jump_hop_work_profile_table.rs @@ -18,6 +18,18 @@ pub struct JumpHopWorkProfileTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `jump_hop_work_profile`. +pub struct JumpHopWorkProfileTableAccessor; + +impl __sdk::TableAccessor for JumpHopWorkProfileTableAccessor { + type Row = JumpHopWorkProfileRow; + type Handle<'db> = JumpHopWorkProfileTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.jump_hop_work_profile() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `jump_hop_work_profile`. /// @@ -42,6 +54,18 @@ impl JumpHopWorkProfileTableAccess for super::RemoteTables { pub struct JumpHopWorkProfileInsertCallbackId(__sdk::CallbackId); pub struct JumpHopWorkProfileDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for JumpHopWorkProfileTableHandle<'ctx> { + type Row = JumpHopWorkProfileRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for JumpHopWorkProfileTableHandle<'ctx> { type Row = JumpHopWorkProfileRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for JumpHopWorkProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for JumpHopWorkProfileTableHandle<'ctx> { + type InsertCallbackId = JumpHopWorkProfileInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> JumpHopWorkProfileInsertCallbackId { + JumpHopWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: JumpHopWorkProfileInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for JumpHopWorkProfileTableHandle<'ctx> { + type DeleteCallbackId = JumpHopWorkProfileDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> JumpHopWorkProfileDeleteCallbackId { + JumpHopWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: JumpHopWorkProfileDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct JumpHopWorkProfileUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopWorkProfileTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for JumpHopWorkProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for JumpHopWorkProfileTableHandle<'ctx> { + type UpdateCallbackId = JumpHopWorkProfileUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> JumpHopWorkProfileUpdateCallbackId { + JumpHopWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: JumpHopWorkProfileUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `profile_id` unique index on the table `jump_hop_work_profile`, /// which allows point queries on the field of the same name /// via the [`JumpHopWorkProfileProfileIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_message_table.rs index d2aacbf3b..6842beee7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_message_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_message_table.rs @@ -18,6 +18,18 @@ pub struct Match3DAgentMessageTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `match_3_d_agent_message`. +pub struct Match3DAgentMessageTableAccessor; + +impl __sdk::TableAccessor for Match3DAgentMessageTableAccessor { + type Row = Match3DAgentMessageRow; + type Handle<'db> = Match3DAgentMessageTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.match_3_d_agent_message() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `match_3_d_agent_message`. /// @@ -42,6 +54,18 @@ impl Match3DAgentMessageTableAccess for super::RemoteTables { pub struct Match3DAgentMessageInsertCallbackId(__sdk::CallbackId); pub struct Match3DAgentMessageDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for Match3DAgentMessageTableHandle<'ctx> { + type Row = Match3DAgentMessageRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for Match3DAgentMessageTableHandle<'ctx> { type Row = Match3DAgentMessageRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for Match3DAgentMessageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for Match3DAgentMessageTableHandle<'ctx> { + type InsertCallbackId = Match3DAgentMessageInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DAgentMessageInsertCallbackId { + Match3DAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: Match3DAgentMessageInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for Match3DAgentMessageTableHandle<'ctx> { + type DeleteCallbackId = Match3DAgentMessageDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DAgentMessageDeleteCallbackId { + Match3DAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: Match3DAgentMessageDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct Match3DAgentMessageUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for Match3DAgentMessageTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for Match3DAgentMessageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for Match3DAgentMessageTableHandle<'ctx> { + type UpdateCallbackId = Match3DAgentMessageUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> Match3DAgentMessageUpdateCallbackId { + Match3DAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: Match3DAgentMessageUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `message_id` unique index on the table `match_3_d_agent_message`, /// which allows point queries on the field of the same name /// via the [`Match3DAgentMessageMessageIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_session_table.rs index 7c7920897..9e2d554a8 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_agent_session_table.rs @@ -18,6 +18,18 @@ pub struct Match3DAgentSessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `match_3_d_agent_session`. +pub struct Match3DAgentSessionTableAccessor; + +impl __sdk::TableAccessor for Match3DAgentSessionTableAccessor { + type Row = Match3DAgentSessionRow; + type Handle<'db> = Match3DAgentSessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.match_3_d_agent_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `match_3_d_agent_session`. /// @@ -42,6 +54,18 @@ impl Match3DAgentSessionTableAccess for super::RemoteTables { pub struct Match3DAgentSessionInsertCallbackId(__sdk::CallbackId); pub struct Match3DAgentSessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for Match3DAgentSessionTableHandle<'ctx> { + type Row = Match3DAgentSessionRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for Match3DAgentSessionTableHandle<'ctx> { type Row = Match3DAgentSessionRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for Match3DAgentSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for Match3DAgentSessionTableHandle<'ctx> { + type InsertCallbackId = Match3DAgentSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DAgentSessionInsertCallbackId { + Match3DAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: Match3DAgentSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for Match3DAgentSessionTableHandle<'ctx> { + type DeleteCallbackId = Match3DAgentSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DAgentSessionDeleteCallbackId { + Match3DAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: Match3DAgentSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct Match3DAgentSessionUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for Match3DAgentSessionTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for Match3DAgentSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for Match3DAgentSessionTableHandle<'ctx> { + type UpdateCallbackId = Match3DAgentSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> Match3DAgentSessionUpdateCallbackId { + Match3DAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: Match3DAgentSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `session_id` unique index on the table `match_3_d_agent_session`, /// which allows point queries on the field of the same name /// via the [`Match3DAgentSessionSessionIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_runtime_run_table.rs index b04780674..3998804da 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_runtime_run_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_runtime_run_table.rs @@ -18,6 +18,18 @@ pub struct Match3DRuntimeRunTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `match_3_d_runtime_run`. +pub struct Match3DRuntimeRunTableAccessor; + +impl __sdk::TableAccessor for Match3DRuntimeRunTableAccessor { + type Row = Match3DRuntimeRunRow; + type Handle<'db> = Match3DRuntimeRunTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.match_3_d_runtime_run() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `match_3_d_runtime_run`. /// @@ -42,6 +54,18 @@ impl Match3DRuntimeRunTableAccess for super::RemoteTables { pub struct Match3DRuntimeRunInsertCallbackId(__sdk::CallbackId); pub struct Match3DRuntimeRunDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for Match3DRuntimeRunTableHandle<'ctx> { + type Row = Match3DRuntimeRunRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for Match3DRuntimeRunTableHandle<'ctx> { type Row = Match3DRuntimeRunRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for Match3DRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for Match3DRuntimeRunTableHandle<'ctx> { + type InsertCallbackId = Match3DRuntimeRunInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DRuntimeRunInsertCallbackId { + Match3DRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: Match3DRuntimeRunInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for Match3DRuntimeRunTableHandle<'ctx> { + type DeleteCallbackId = Match3DRuntimeRunDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DRuntimeRunDeleteCallbackId { + Match3DRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: Match3DRuntimeRunDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct Match3DRuntimeRunUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for Match3DRuntimeRunTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for Match3DRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for Match3DRuntimeRunTableHandle<'ctx> { + type UpdateCallbackId = Match3DRuntimeRunUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> Match3DRuntimeRunUpdateCallbackId { + Match3DRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: Match3DRuntimeRunUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `run_id` unique index on the table `match_3_d_runtime_run`, /// which allows point queries on the field of the same name /// via the [`Match3DRuntimeRunRunIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_work_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_work_profile_table.rs index bc4c96b09..dc5155c43 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_work_profile_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/match_3_d_work_profile_table.rs @@ -18,6 +18,18 @@ pub struct Match3DWorkProfileTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `match_3_d_work_profile`. +pub struct Match3DWorkProfileTableAccessor; + +impl __sdk::TableAccessor for Match3DWorkProfileTableAccessor { + type Row = Match3DWorkProfileRow; + type Handle<'db> = Match3DWorkProfileTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.match_3_d_work_profile() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `match_3_d_work_profile`. /// @@ -42,6 +54,18 @@ impl Match3DWorkProfileTableAccess for super::RemoteTables { pub struct Match3DWorkProfileInsertCallbackId(__sdk::CallbackId); pub struct Match3DWorkProfileDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for Match3DWorkProfileTableHandle<'ctx> { + type Row = Match3DWorkProfileRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for Match3DWorkProfileTableHandle<'ctx> { type Row = Match3DWorkProfileRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for Match3DWorkProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for Match3DWorkProfileTableHandle<'ctx> { + type InsertCallbackId = Match3DWorkProfileInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DWorkProfileInsertCallbackId { + Match3DWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: Match3DWorkProfileInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for Match3DWorkProfileTableHandle<'ctx> { + type DeleteCallbackId = Match3DWorkProfileDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> Match3DWorkProfileDeleteCallbackId { + Match3DWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: Match3DWorkProfileDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct Match3DWorkProfileUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for Match3DWorkProfileTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for Match3DWorkProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for Match3DWorkProfileTableHandle<'ctx> { + type UpdateCallbackId = Match3DWorkProfileUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> Match3DWorkProfileUpdateCallbackId { + Match3DWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: Match3DWorkProfileUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `profile_id` unique index on the table `match_3_d_work_profile`, /// which allows point queries on the field of the same name /// via the [`Match3DWorkProfileProfileIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_table.rs index 26e7fcf5d..83c676126 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/npc_state_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/npc_state_table.rs @@ -20,6 +20,18 @@ pub struct NpcStateTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `npc_state`. +pub struct NpcStateTableAccessor; + +impl __sdk::TableAccessor for NpcStateTableAccessor { + type Row = NpcState; + type Handle<'db> = NpcStateTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.npc_state() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `npc_state`. /// @@ -42,6 +54,18 @@ impl NpcStateTableAccess for super::RemoteTables { pub struct NpcStateInsertCallbackId(__sdk::CallbackId); pub struct NpcStateDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for NpcStateTableHandle<'ctx> { + type Row = NpcState; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for NpcStateTableHandle<'ctx> { type Row = NpcState; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for NpcStateTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for NpcStateTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for NpcStateTableHandle<'ctx> { + 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> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for NpcStateTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_table.rs index 66961930e..12f1cb0db 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/player_progression_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/player_progression_table.rs @@ -19,6 +19,18 @@ pub struct PlayerProgressionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `player_progression`. +pub struct PlayerProgressionTableAccessor; + +impl __sdk::TableAccessor for PlayerProgressionTableAccessor { + type Row = PlayerProgression; + type Handle<'db> = PlayerProgressionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.player_progression() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `player_progression`. /// @@ -43,6 +55,18 @@ impl PlayerProgressionTableAccess for super::RemoteTables { pub struct PlayerProgressionInsertCallbackId(__sdk::CallbackId); pub struct PlayerProgressionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PlayerProgressionTableHandle<'ctx> { + type Row = PlayerProgression; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PlayerProgressionTableHandle<'ctx> { type Row = PlayerProgression; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for PlayerProgressionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PlayerProgressionTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for PlayerProgressionTableHandle<'ctx> { + 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> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PlayerProgressionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_code_operation_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_code_operation_table.rs index ef679c70c..a4aa45188 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_code_operation_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_code_operation_table.rs @@ -18,6 +18,18 @@ pub struct ProfileCodeOperationTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_code_operation`. +pub struct ProfileCodeOperationTableAccessor; + +impl __sdk::TableAccessor for ProfileCodeOperationTableAccessor { + type Row = ProfileCodeOperation; + type Handle<'db> = ProfileCodeOperationTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_code_operation() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_code_operation`. /// @@ -42,6 +54,18 @@ impl ProfileCodeOperationTableAccess for super::RemoteTables { pub struct ProfileCodeOperationInsertCallbackId(__sdk::CallbackId); pub struct ProfileCodeOperationDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileCodeOperationTableHandle<'ctx> { + type Row = ProfileCodeOperation; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileCodeOperationTableHandle<'ctx> { type Row = ProfileCodeOperation; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ProfileCodeOperationTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileCodeOperationTableHandle<'ctx> { + type InsertCallbackId = ProfileCodeOperationInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileCodeOperationInsertCallbackId { + ProfileCodeOperationInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileCodeOperationInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileCodeOperationTableHandle<'ctx> { + type DeleteCallbackId = ProfileCodeOperationDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileCodeOperationDeleteCallbackId { + ProfileCodeOperationDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileCodeOperationDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileCodeOperationUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileCodeOperationTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileCodeOperationTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for ProfileCodeOperationTableHandle<'ctx> { + type UpdateCallbackId = ProfileCodeOperationUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileCodeOperationUpdateCallbackId { + ProfileCodeOperationUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileCodeOperationUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `operation_id` unique index on the table `profile_code_operation`, /// which allows point queries on the field of the same name /// via the [`ProfileCodeOperationOperationIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_daily_free_points_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_daily_free_points_table.rs index dea2cd453..9dd280482 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_daily_free_points_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_daily_free_points_table.rs @@ -18,6 +18,18 @@ pub struct ProfileDailyFreePointsTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_daily_free_points`. +pub struct ProfileDailyFreePointsTableAccessor; + +impl __sdk::TableAccessor for ProfileDailyFreePointsTableAccessor { + type Row = ProfileDailyFreePoints; + type Handle<'db> = ProfileDailyFreePointsTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_daily_free_points() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_daily_free_points`. /// @@ -42,6 +54,18 @@ impl ProfileDailyFreePointsTableAccess for super::RemoteTables { pub struct ProfileDailyFreePointsInsertCallbackId(__sdk::CallbackId); pub struct ProfileDailyFreePointsDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileDailyFreePointsTableHandle<'ctx> { + type Row = ProfileDailyFreePoints; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileDailyFreePointsTableHandle<'ctx> { type Row = ProfileDailyFreePoints; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ProfileDailyFreePointsTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileDailyFreePointsTableHandle<'ctx> { + type InsertCallbackId = ProfileDailyFreePointsInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileDailyFreePointsInsertCallbackId { + ProfileDailyFreePointsInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileDailyFreePointsInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileDailyFreePointsTableHandle<'ctx> { + type DeleteCallbackId = ProfileDailyFreePointsDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileDailyFreePointsDeleteCallbackId { + ProfileDailyFreePointsDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileDailyFreePointsDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileDailyFreePointsUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileDailyFreePointsTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileDailyFreePointsTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate for ProfileDailyFreePointsTableHandle<'ctx> { + type UpdateCallbackId = ProfileDailyFreePointsUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileDailyFreePointsUpdateCallbackId { + ProfileDailyFreePointsUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileDailyFreePointsUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `user_id` unique index on the table `profile_daily_free_points`, /// which allows point queries on the field of the same name /// via the [`ProfileDailyFreePointsUserIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_table.rs index c79f8b0c9..c89d0fc36 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_dashboard_state_table.rs @@ -18,6 +18,18 @@ pub struct ProfileDashboardStateTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_dashboard_state`. +pub struct ProfileDashboardStateTableAccessor; + +impl __sdk::TableAccessor for ProfileDashboardStateTableAccessor { + type Row = ProfileDashboardState; + type Handle<'db> = ProfileDashboardStateTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_dashboard_state() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_dashboard_state`. /// @@ -42,6 +54,18 @@ impl ProfileDashboardStateTableAccess for super::RemoteTables { pub struct ProfileDashboardStateInsertCallbackId(__sdk::CallbackId); pub struct ProfileDashboardStateDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileDashboardStateTableHandle<'ctx> { + type Row = ProfileDashboardState; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileDashboardStateTableHandle<'ctx> { type Row = ProfileDashboardState; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ProfileDashboardStateTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileDashboardStateTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileDashboardStateTableHandle<'ctx> { + 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> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileDashboardStateTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_feedback_submission_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_feedback_submission_table.rs index b65c8a5e5..d08c448a1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_feedback_submission_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_feedback_submission_table.rs @@ -19,6 +19,18 @@ pub struct ProfileFeedbackSubmissionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_feedback_submission`. +pub struct ProfileFeedbackSubmissionTableAccessor; + +impl __sdk::TableAccessor for ProfileFeedbackSubmissionTableAccessor { + type Row = ProfileFeedbackSubmission; + type Handle<'db> = ProfileFeedbackSubmissionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_feedback_submission() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_feedback_submission`. /// @@ -43,6 +55,18 @@ impl ProfileFeedbackSubmissionTableAccess for super::RemoteTables { pub struct ProfileFeedbackSubmissionInsertCallbackId(__sdk::CallbackId); pub struct ProfileFeedbackSubmissionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileFeedbackSubmissionTableHandle<'ctx> { + type Row = ProfileFeedbackSubmission; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileFeedbackSubmissionTableHandle<'ctx> { type Row = ProfileFeedbackSubmission; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for ProfileFeedbackSubmissionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileFeedbackSubmissionTableHandle<'ctx> { + type InsertCallbackId = ProfileFeedbackSubmissionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileFeedbackSubmissionInsertCallbackId { + ProfileFeedbackSubmissionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileFeedbackSubmissionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileFeedbackSubmissionTableHandle<'ctx> { + type DeleteCallbackId = ProfileFeedbackSubmissionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileFeedbackSubmissionDeleteCallbackId { + ProfileFeedbackSubmissionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileFeedbackSubmissionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileFeedbackSubmissionUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileFeedbackSubmissionTableHandle<'ctx> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileFeedbackSubmissionTableHandle<' } } +impl<'ctx> __sdk::WithUpdate for ProfileFeedbackSubmissionTableHandle<'ctx> { + type UpdateCallbackId = ProfileFeedbackSubmissionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileFeedbackSubmissionUpdateCallbackId { + ProfileFeedbackSubmissionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileFeedbackSubmissionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `feedback_id` unique index on the table `profile_feedback_submission`, /// which allows point queries on the field of the same name /// via the [`ProfileFeedbackSubmissionFeedbackIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_invite_code_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_invite_code_table.rs index 17c10036c..917319014 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_invite_code_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_invite_code_table.rs @@ -18,6 +18,18 @@ pub struct ProfileInviteCodeTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_invite_code`. +pub struct ProfileInviteCodeTableAccessor; + +impl __sdk::TableAccessor for ProfileInviteCodeTableAccessor { + type Row = ProfileInviteCode; + type Handle<'db> = ProfileInviteCodeTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_invite_code() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_invite_code`. /// @@ -42,6 +54,18 @@ impl ProfileInviteCodeTableAccess for super::RemoteTables { pub struct ProfileInviteCodeInsertCallbackId(__sdk::CallbackId); pub struct ProfileInviteCodeDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileInviteCodeTableHandle<'ctx> { + type Row = ProfileInviteCode; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileInviteCodeTableHandle<'ctx> { type Row = ProfileInviteCode; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ProfileInviteCodeTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileInviteCodeTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileInviteCodeTableHandle<'ctx> { + 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> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileInviteCodeTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_membership_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_membership_table.rs index 82d0e7497..a06543e88 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_membership_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_membership_table.rs @@ -20,6 +20,18 @@ pub struct ProfileMembershipTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_membership`. +pub struct ProfileMembershipTableAccessor; + +impl __sdk::TableAccessor for ProfileMembershipTableAccessor { + type Row = ProfileMembership; + type Handle<'db> = ProfileMembershipTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_membership() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_membership`. /// @@ -44,6 +56,18 @@ impl ProfileMembershipTableAccess for super::RemoteTables { pub struct ProfileMembershipInsertCallbackId(__sdk::CallbackId); pub struct ProfileMembershipDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileMembershipTableHandle<'ctx> { + type Row = ProfileMembership; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileMembershipTableHandle<'ctx> { type Row = ProfileMembership; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for ProfileMembershipTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileMembershipTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileMembershipTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileMembershipTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_table.rs index 0f147bd51..4fc639f37 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_played_world_table.rs @@ -18,6 +18,18 @@ pub struct ProfilePlayedWorldTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_played_world`. +pub struct ProfilePlayedWorldTableAccessor; + +impl __sdk::TableAccessor for ProfilePlayedWorldTableAccessor { + type Row = ProfilePlayedWorld; + type Handle<'db> = ProfilePlayedWorldTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_played_world() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_played_world`. /// @@ -42,6 +54,18 @@ impl ProfilePlayedWorldTableAccess for super::RemoteTables { pub struct ProfilePlayedWorldInsertCallbackId(__sdk::CallbackId); pub struct ProfilePlayedWorldDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfilePlayedWorldTableHandle<'ctx> { + type Row = ProfilePlayedWorld; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfilePlayedWorldTableHandle<'ctx> { type Row = ProfilePlayedWorld; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ProfilePlayedWorldTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfilePlayedWorldTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for ProfilePlayedWorldTableHandle<'ctx> { + 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> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfilePlayedWorldTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_expiration_schedule_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_expiration_schedule_table.rs index 2c0a4da54..0a9b67ddc 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_expiration_schedule_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_expiration_schedule_table.rs @@ -18,6 +18,20 @@ pub struct ProfileRechargeOrderExpirationScheduleTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_recharge_order_expiration_schedule`. +pub struct ProfileRechargeOrderExpirationScheduleTableAccessor; + +impl __sdk::TableAccessor + for ProfileRechargeOrderExpirationScheduleTableAccessor +{ + type Row = ProfileRechargeOrderExpirationSchedule; + type Handle<'db> = ProfileRechargeOrderExpirationScheduleTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_recharge_order_expiration_schedule() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_recharge_order_expiration_schedule`. /// @@ -48,6 +62,18 @@ impl ProfileRechargeOrderExpirationScheduleTableAccess for super::RemoteTables { pub struct ProfileRechargeOrderExpirationScheduleInsertCallbackId(__sdk::CallbackId); pub struct ProfileRechargeOrderExpirationScheduleDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileRechargeOrderExpirationScheduleTableHandle<'ctx> { + type Row = ProfileRechargeOrderExpirationSchedule; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileRechargeOrderExpirationScheduleTableHandle<'ctx> { type Row = ProfileRechargeOrderExpirationSchedule; type EventContext = super::EventContext; @@ -90,6 +116,40 @@ impl<'ctx> __sdk::Table for ProfileRechargeOrderExpirationScheduleTableHandle<'c } } +impl<'ctx> __sdk::WithInsert for ProfileRechargeOrderExpirationScheduleTableHandle<'ctx> { + type InsertCallbackId = ProfileRechargeOrderExpirationScheduleInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderExpirationScheduleInsertCallbackId { + ProfileRechargeOrderExpirationScheduleInsertCallbackId( + self.imp.on_insert(Box::new(callback)), + ) + } + + fn remove_on_insert(&self, callback: ProfileRechargeOrderExpirationScheduleInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileRechargeOrderExpirationScheduleTableHandle<'ctx> { + type DeleteCallbackId = ProfileRechargeOrderExpirationScheduleDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderExpirationScheduleDeleteCallbackId { + ProfileRechargeOrderExpirationScheduleDeleteCallbackId( + self.imp.on_delete(Box::new(callback)), + ) + } + + fn remove_on_delete(&self, callback: ProfileRechargeOrderExpirationScheduleDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileRechargeOrderExpirationScheduleUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeOrderExpirationScheduleTableHandle<'ctx> { @@ -109,6 +169,23 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeOrderExpirationSchedule } } +impl<'ctx> __sdk::WithUpdate for ProfileRechargeOrderExpirationScheduleTableHandle<'ctx> { + type UpdateCallbackId = ProfileRechargeOrderExpirationScheduleUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderExpirationScheduleUpdateCallbackId { + ProfileRechargeOrderExpirationScheduleUpdateCallbackId( + self.imp.on_update(Box::new(callback)), + ) + } + + fn remove_on_update(&self, callback: ProfileRechargeOrderExpirationScheduleUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `order_id` unique index on the table `profile_recharge_order_expiration_schedule`, /// which allows point queries on the field of the same name /// via the [`ProfileRechargeOrderExpirationScheduleOrderIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_expiration_timer_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_expiration_timer_table.rs index 66a297366..cfbc3fcac 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_expiration_timer_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_expiration_timer_table.rs @@ -18,6 +18,20 @@ pub struct ProfileRechargeOrderExpirationTimerTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_recharge_order_expiration_timer`. +pub struct ProfileRechargeOrderExpirationTimerTableAccessor; + +impl __sdk::TableAccessor + for ProfileRechargeOrderExpirationTimerTableAccessor +{ + type Row = ProfileRechargeOrderExpirationTimer; + type Handle<'db> = ProfileRechargeOrderExpirationTimerTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_recharge_order_expiration_timer() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_recharge_order_expiration_timer`. /// @@ -46,6 +60,18 @@ impl ProfileRechargeOrderExpirationTimerTableAccess for super::RemoteTables { pub struct ProfileRechargeOrderExpirationTimerInsertCallbackId(__sdk::CallbackId); pub struct ProfileRechargeOrderExpirationTimerDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileRechargeOrderExpirationTimerTableHandle<'ctx> { + type Row = ProfileRechargeOrderExpirationTimer; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileRechargeOrderExpirationTimerTableHandle<'ctx> { type Row = ProfileRechargeOrderExpirationTimer; type EventContext = super::EventContext; @@ -84,6 +110,36 @@ impl<'ctx> __sdk::Table for ProfileRechargeOrderExpirationTimerTableHandle<'ctx> } } +impl<'ctx> __sdk::WithInsert for ProfileRechargeOrderExpirationTimerTableHandle<'ctx> { + type InsertCallbackId = ProfileRechargeOrderExpirationTimerInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderExpirationTimerInsertCallbackId { + ProfileRechargeOrderExpirationTimerInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRechargeOrderExpirationTimerInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileRechargeOrderExpirationTimerTableHandle<'ctx> { + type DeleteCallbackId = ProfileRechargeOrderExpirationTimerDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderExpirationTimerDeleteCallbackId { + ProfileRechargeOrderExpirationTimerDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRechargeOrderExpirationTimerDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileRechargeOrderExpirationTimerUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeOrderExpirationTimerTableHandle<'ctx> { @@ -101,6 +157,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeOrderExpirationTimerTab } } +impl<'ctx> __sdk::WithUpdate for ProfileRechargeOrderExpirationTimerTableHandle<'ctx> { + type UpdateCallbackId = ProfileRechargeOrderExpirationTimerUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderExpirationTimerUpdateCallbackId { + ProfileRechargeOrderExpirationTimerUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRechargeOrderExpirationTimerUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `scheduled_id` unique index on the table `profile_recharge_order_expiration_timer`, /// which allows point queries on the field of the same name /// via the [`ProfileRechargeOrderExpirationTimerScheduledIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_refund_settlement_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_refund_settlement_table.rs index 01a538eb1..dfedb6017 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_refund_settlement_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_refund_settlement_table.rs @@ -19,6 +19,20 @@ pub struct ProfileRechargeOrderRefundSettlementTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_recharge_order_refund_settlement`. +pub struct ProfileRechargeOrderRefundSettlementTableAccessor; + +impl __sdk::TableAccessor + for ProfileRechargeOrderRefundSettlementTableAccessor +{ + type Row = ProfileRechargeOrderRefundSettlement; + type Handle<'db> = ProfileRechargeOrderRefundSettlementTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_recharge_order_refund_settlement() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_recharge_order_refund_settlement`. /// @@ -47,6 +61,18 @@ impl ProfileRechargeOrderRefundSettlementTableAccess for super::RemoteTables { pub struct ProfileRechargeOrderRefundSettlementInsertCallbackId(__sdk::CallbackId); pub struct ProfileRechargeOrderRefundSettlementDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileRechargeOrderRefundSettlementTableHandle<'ctx> { + type Row = ProfileRechargeOrderRefundSettlement; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileRechargeOrderRefundSettlementTableHandle<'ctx> { type Row = ProfileRechargeOrderRefundSettlement; type EventContext = super::EventContext; @@ -85,6 +111,36 @@ impl<'ctx> __sdk::Table for ProfileRechargeOrderRefundSettlementTableHandle<'ctx } } +impl<'ctx> __sdk::WithInsert for ProfileRechargeOrderRefundSettlementTableHandle<'ctx> { + type InsertCallbackId = ProfileRechargeOrderRefundSettlementInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderRefundSettlementInsertCallbackId { + ProfileRechargeOrderRefundSettlementInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRechargeOrderRefundSettlementInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileRechargeOrderRefundSettlementTableHandle<'ctx> { + type DeleteCallbackId = ProfileRechargeOrderRefundSettlementDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderRefundSettlementDeleteCallbackId { + ProfileRechargeOrderRefundSettlementDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRechargeOrderRefundSettlementDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileRechargeOrderRefundSettlementUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeOrderRefundSettlementTableHandle<'ctx> { @@ -102,6 +158,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeOrderRefundSettlementTa } } +impl<'ctx> __sdk::WithUpdate for ProfileRechargeOrderRefundSettlementTableHandle<'ctx> { + type UpdateCallbackId = ProfileRechargeOrderRefundSettlementUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRechargeOrderRefundSettlementUpdateCallbackId { + ProfileRechargeOrderRefundSettlementUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRechargeOrderRefundSettlementUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `order_id` unique index on the table `profile_recharge_order_refund_settlement`, /// which allows point queries on the field of the same name /// via the [`ProfileRechargeOrderRefundSettlementOrderIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_table.rs index e3909eec2..3869911a9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_order_table.rs @@ -20,6 +20,18 @@ pub struct ProfileRechargeOrderTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_recharge_order`. +pub struct ProfileRechargeOrderTableAccessor; + +impl __sdk::TableAccessor for ProfileRechargeOrderTableAccessor { + type Row = ProfileRechargeOrder; + type Handle<'db> = ProfileRechargeOrderTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_recharge_order() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_recharge_order`. /// @@ -44,6 +56,18 @@ impl ProfileRechargeOrderTableAccess for super::RemoteTables { pub struct ProfileRechargeOrderInsertCallbackId(__sdk::CallbackId); pub struct ProfileRechargeOrderDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileRechargeOrderTableHandle<'ctx> { + type Row = ProfileRechargeOrder; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileRechargeOrderTableHandle<'ctx> { type Row = ProfileRechargeOrder; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for ProfileRechargeOrderTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileRechargeOrderTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileRechargeOrderTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeOrderTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_product_config_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_product_config_table.rs index 2da927d36..cf0d11d37 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_product_config_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_product_config_table.rs @@ -20,6 +20,18 @@ pub struct ProfileRechargeProductConfigTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_recharge_product_config`. +pub struct ProfileRechargeProductConfigTableAccessor; + +impl __sdk::TableAccessor for ProfileRechargeProductConfigTableAccessor { + type Row = ProfileRechargeProductConfig; + type Handle<'db> = ProfileRechargeProductConfigTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_recharge_product_config() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_recharge_product_config`. /// @@ -44,6 +56,18 @@ impl ProfileRechargeProductConfigTableAccess for super::RemoteTables { pub struct ProfileRechargeProductConfigInsertCallbackId(__sdk::CallbackId); pub struct ProfileRechargeProductConfigDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileRechargeProductConfigTableHandle<'ctx> { + type Row = ProfileRechargeProductConfig; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileRechargeProductConfigTableHandle<'ctx> { type Row = ProfileRechargeProductConfig; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for ProfileRechargeProductConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileRechargeProductConfigTableHandle<'ctx> { + type InsertCallbackId = ProfileRechargeProductConfigInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeProductConfigInsertCallbackId { + ProfileRechargeProductConfigInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRechargeProductConfigInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileRechargeProductConfigTableHandle<'ctx> { + type DeleteCallbackId = ProfileRechargeProductConfigDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeProductConfigDeleteCallbackId { + ProfileRechargeProductConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRechargeProductConfigDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileRechargeProductConfigUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeProductConfigTableHandle<'ctx> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeProductConfigTableHandl } } +impl<'ctx> __sdk::WithUpdate for ProfileRechargeProductConfigTableHandle<'ctx> { + type UpdateCallbackId = ProfileRechargeProductConfigUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRechargeProductConfigUpdateCallbackId { + ProfileRechargeProductConfigUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRechargeProductConfigUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `product_id` unique index on the table `profile_recharge_product_config`, /// which allows point queries on the field of the same name /// via the [`ProfileRechargeProductConfigProductIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_bill_checkpoint_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_bill_checkpoint_table.rs index 2baa9dfb7..89070d611 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_bill_checkpoint_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_bill_checkpoint_table.rs @@ -18,6 +18,20 @@ pub struct ProfileRechargeRefundBillCheckpointTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_recharge_refund_bill_checkpoint`. +pub struct ProfileRechargeRefundBillCheckpointTableAccessor; + +impl __sdk::TableAccessor + for ProfileRechargeRefundBillCheckpointTableAccessor +{ + type Row = ProfileRechargeRefundBillCheckpoint; + type Handle<'db> = ProfileRechargeRefundBillCheckpointTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_recharge_refund_bill_checkpoint() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_recharge_refund_bill_checkpoint`. /// @@ -46,6 +60,18 @@ impl ProfileRechargeRefundBillCheckpointTableAccess for super::RemoteTables { pub struct ProfileRechargeRefundBillCheckpointInsertCallbackId(__sdk::CallbackId); pub struct ProfileRechargeRefundBillCheckpointDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileRechargeRefundBillCheckpointTableHandle<'ctx> { + type Row = ProfileRechargeRefundBillCheckpoint; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileRechargeRefundBillCheckpointTableHandle<'ctx> { type Row = ProfileRechargeRefundBillCheckpoint; type EventContext = super::EventContext; @@ -84,6 +110,36 @@ impl<'ctx> __sdk::Table for ProfileRechargeRefundBillCheckpointTableHandle<'ctx> } } +impl<'ctx> __sdk::WithInsert for ProfileRechargeRefundBillCheckpointTableHandle<'ctx> { + type InsertCallbackId = ProfileRechargeRefundBillCheckpointInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundBillCheckpointInsertCallbackId { + ProfileRechargeRefundBillCheckpointInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRechargeRefundBillCheckpointInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileRechargeRefundBillCheckpointTableHandle<'ctx> { + type DeleteCallbackId = ProfileRechargeRefundBillCheckpointDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundBillCheckpointDeleteCallbackId { + ProfileRechargeRefundBillCheckpointDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRechargeRefundBillCheckpointDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileRechargeRefundBillCheckpointUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeRefundBillCheckpointTableHandle<'ctx> { @@ -101,6 +157,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeRefundBillCheckpointTab } } +impl<'ctx> __sdk::WithUpdate for ProfileRechargeRefundBillCheckpointTableHandle<'ctx> { + type UpdateCallbackId = ProfileRechargeRefundBillCheckpointUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundBillCheckpointUpdateCallbackId { + ProfileRechargeRefundBillCheckpointUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRechargeRefundBillCheckpointUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `checkpoint_id` unique index on the table `profile_recharge_refund_bill_checkpoint`, /// which allows point queries on the field of the same name /// via the [`ProfileRechargeRefundBillCheckpointCheckpointIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_hold_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_hold_table.rs index 5d417560d..099f1e02b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_hold_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_hold_table.rs @@ -19,6 +19,18 @@ pub struct ProfileRechargeRefundHoldTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_recharge_refund_hold`. +pub struct ProfileRechargeRefundHoldTableAccessor; + +impl __sdk::TableAccessor for ProfileRechargeRefundHoldTableAccessor { + type Row = ProfileRechargeRefundHold; + type Handle<'db> = ProfileRechargeRefundHoldTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_recharge_refund_hold() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_recharge_refund_hold`. /// @@ -43,6 +55,18 @@ impl ProfileRechargeRefundHoldTableAccess for super::RemoteTables { pub struct ProfileRechargeRefundHoldInsertCallbackId(__sdk::CallbackId); pub struct ProfileRechargeRefundHoldDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileRechargeRefundHoldTableHandle<'ctx> { + type Row = ProfileRechargeRefundHold; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileRechargeRefundHoldTableHandle<'ctx> { type Row = ProfileRechargeRefundHold; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for ProfileRechargeRefundHoldTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileRechargeRefundHoldTableHandle<'ctx> { + type InsertCallbackId = ProfileRechargeRefundHoldInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundHoldInsertCallbackId { + ProfileRechargeRefundHoldInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRechargeRefundHoldInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileRechargeRefundHoldTableHandle<'ctx> { + type DeleteCallbackId = ProfileRechargeRefundHoldDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundHoldDeleteCallbackId { + ProfileRechargeRefundHoldDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRechargeRefundHoldDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileRechargeRefundHoldUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeRefundHoldTableHandle<'ctx> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeRefundHoldTableHandle<' } } +impl<'ctx> __sdk::WithUpdate for ProfileRechargeRefundHoldTableHandle<'ctx> { + type UpdateCallbackId = ProfileRechargeRefundHoldUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundHoldUpdateCallbackId { + ProfileRechargeRefundHoldUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRechargeRefundHoldUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `out_refund_no` unique index on the table `profile_recharge_refund_hold`, /// which allows point queries on the field of the same name /// via the [`ProfileRechargeRefundHoldOutRefundNoUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_observation_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_observation_table.rs index b9e32dd3e..6d0587ebb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_observation_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_observation_table.rs @@ -20,6 +20,18 @@ pub struct ProfileRechargeRefundObservationTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_recharge_refund_observation`. +pub struct ProfileRechargeRefundObservationTableAccessor; + +impl __sdk::TableAccessor for ProfileRechargeRefundObservationTableAccessor { + type Row = ProfileRechargeRefundObservation; + type Handle<'db> = ProfileRechargeRefundObservationTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_recharge_refund_observation() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_recharge_refund_observation`. /// @@ -48,6 +60,18 @@ impl ProfileRechargeRefundObservationTableAccess for super::RemoteTables { pub struct ProfileRechargeRefundObservationInsertCallbackId(__sdk::CallbackId); pub struct ProfileRechargeRefundObservationDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileRechargeRefundObservationTableHandle<'ctx> { + type Row = ProfileRechargeRefundObservation; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileRechargeRefundObservationTableHandle<'ctx> { type Row = ProfileRechargeRefundObservation; type EventContext = super::EventContext; @@ -86,6 +110,36 @@ impl<'ctx> __sdk::Table for ProfileRechargeRefundObservationTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileRechargeRefundObservationTableHandle<'ctx> { + type InsertCallbackId = ProfileRechargeRefundObservationInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundObservationInsertCallbackId { + ProfileRechargeRefundObservationInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRechargeRefundObservationInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileRechargeRefundObservationTableHandle<'ctx> { + type DeleteCallbackId = ProfileRechargeRefundObservationDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundObservationDeleteCallbackId { + ProfileRechargeRefundObservationDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRechargeRefundObservationDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileRechargeRefundObservationUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeRefundObservationTableHandle<'ctx> { @@ -103,6 +157,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeRefundObservationTableH } } +impl<'ctx> __sdk::WithUpdate for ProfileRechargeRefundObservationTableHandle<'ctx> { + type UpdateCallbackId = ProfileRechargeRefundObservationUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundObservationUpdateCallbackId { + ProfileRechargeRefundObservationUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRechargeRefundObservationUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `observation_id` unique index on the table `profile_recharge_refund_observation`, /// which allows point queries on the field of the same name /// via the [`ProfileRechargeRefundObservationObservationIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_table.rs index eb20b13af..2ba6f390a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_recharge_refund_table.rs @@ -21,6 +21,18 @@ pub struct ProfileRechargeRefundTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_recharge_refund`. +pub struct ProfileRechargeRefundTableAccessor; + +impl __sdk::TableAccessor for ProfileRechargeRefundTableAccessor { + type Row = ProfileRechargeRefund; + type Handle<'db> = ProfileRechargeRefundTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_recharge_refund() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_recharge_refund`. /// @@ -45,6 +57,18 @@ impl ProfileRechargeRefundTableAccess for super::RemoteTables { pub struct ProfileRechargeRefundInsertCallbackId(__sdk::CallbackId); pub struct ProfileRechargeRefundDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileRechargeRefundTableHandle<'ctx> { + type Row = ProfileRechargeRefund; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileRechargeRefundTableHandle<'ctx> { type Row = ProfileRechargeRefund; type EventContext = super::EventContext; @@ -83,6 +107,36 @@ impl<'ctx> __sdk::Table for ProfileRechargeRefundTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileRechargeRefundTableHandle<'ctx> { + type InsertCallbackId = ProfileRechargeRefundInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundInsertCallbackId { + ProfileRechargeRefundInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRechargeRefundInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileRechargeRefundTableHandle<'ctx> { + type DeleteCallbackId = ProfileRechargeRefundDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundDeleteCallbackId { + ProfileRechargeRefundDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRechargeRefundDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileRechargeRefundUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeRefundTableHandle<'ctx> { @@ -100,6 +154,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeRefundTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for ProfileRechargeRefundTableHandle<'ctx> { + type UpdateCallbackId = ProfileRechargeRefundUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRechargeRefundUpdateCallbackId { + ProfileRechargeRefundUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRechargeRefundUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `out_refund_no` unique index on the table `profile_recharge_refund`, /// which allows point queries on the field of the same name /// via the [`ProfileRechargeRefundOutRefundNoUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_table.rs index 2b9ac34f4..8ef2b27bb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_table.rs @@ -19,6 +19,18 @@ pub struct ProfileRedeemCodeTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_redeem_code`. +pub struct ProfileRedeemCodeTableAccessor; + +impl __sdk::TableAccessor for ProfileRedeemCodeTableAccessor { + type Row = ProfileRedeemCode; + type Handle<'db> = ProfileRedeemCodeTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_redeem_code() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_redeem_code`. /// @@ -43,6 +55,18 @@ impl ProfileRedeemCodeTableAccess for super::RemoteTables { pub struct ProfileRedeemCodeInsertCallbackId(__sdk::CallbackId); pub struct ProfileRedeemCodeDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileRedeemCodeTableHandle<'ctx> { + type Row = ProfileRedeemCode; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileRedeemCodeTableHandle<'ctx> { type Row = ProfileRedeemCode; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for ProfileRedeemCodeTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileRedeemCodeTableHandle<'ctx> { + type InsertCallbackId = ProfileRedeemCodeInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeInsertCallbackId { + ProfileRedeemCodeInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRedeemCodeInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileRedeemCodeTableHandle<'ctx> { + type DeleteCallbackId = ProfileRedeemCodeDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeDeleteCallbackId { + ProfileRedeemCodeDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRedeemCodeDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileRedeemCodeUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRedeemCodeTableHandle<'ctx> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRedeemCodeTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for ProfileRedeemCodeTableHandle<'ctx> { + type UpdateCallbackId = ProfileRedeemCodeUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeUpdateCallbackId { + ProfileRedeemCodeUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRedeemCodeUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `code` unique index on the table `profile_redeem_code`, /// which allows point queries on the field of the same name /// via the [`ProfileRedeemCodeCodeUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_usage_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_usage_table.rs index dc48cdabc..336fc8588 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_usage_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_redeem_code_usage_table.rs @@ -18,6 +18,18 @@ pub struct ProfileRedeemCodeUsageTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_redeem_code_usage`. +pub struct ProfileRedeemCodeUsageTableAccessor; + +impl __sdk::TableAccessor for ProfileRedeemCodeUsageTableAccessor { + type Row = ProfileRedeemCodeUsage; + type Handle<'db> = ProfileRedeemCodeUsageTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_redeem_code_usage() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_redeem_code_usage`. /// @@ -42,6 +54,18 @@ impl ProfileRedeemCodeUsageTableAccess for super::RemoteTables { pub struct ProfileRedeemCodeUsageInsertCallbackId(__sdk::CallbackId); pub struct ProfileRedeemCodeUsageDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileRedeemCodeUsageTableHandle<'ctx> { + type Row = ProfileRedeemCodeUsage; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileRedeemCodeUsageTableHandle<'ctx> { type Row = ProfileRedeemCodeUsage; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ProfileRedeemCodeUsageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileRedeemCodeUsageTableHandle<'ctx> { + type InsertCallbackId = ProfileRedeemCodeUsageInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeUsageInsertCallbackId { + ProfileRedeemCodeUsageInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileRedeemCodeUsageInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileRedeemCodeUsageTableHandle<'ctx> { + type DeleteCallbackId = ProfileRedeemCodeUsageDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeUsageDeleteCallbackId { + ProfileRedeemCodeUsageDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileRedeemCodeUsageDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileRedeemCodeUsageUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRedeemCodeUsageTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRedeemCodeUsageTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate for ProfileRedeemCodeUsageTableHandle<'ctx> { + type UpdateCallbackId = ProfileRedeemCodeUsageUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileRedeemCodeUsageUpdateCallbackId { + ProfileRedeemCodeUsageUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileRedeemCodeUsageUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `usage_id` unique index on the table `profile_redeem_code_usage`, /// which allows point queries on the field of the same name /// via the [`ProfileRedeemCodeUsageUsageIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_referral_relation_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_referral_relation_table.rs index 7ab90442d..05811c9b1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_referral_relation_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_referral_relation_table.rs @@ -18,6 +18,18 @@ pub struct ProfileReferralRelationTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_referral_relation`. +pub struct ProfileReferralRelationTableAccessor; + +impl __sdk::TableAccessor for ProfileReferralRelationTableAccessor { + type Row = ProfileReferralRelation; + type Handle<'db> = ProfileReferralRelationTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_referral_relation() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_referral_relation`. /// @@ -42,6 +54,18 @@ impl ProfileReferralRelationTableAccess for super::RemoteTables { pub struct ProfileReferralRelationInsertCallbackId(__sdk::CallbackId); pub struct ProfileReferralRelationDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileReferralRelationTableHandle<'ctx> { + type Row = ProfileReferralRelation; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileReferralRelationTableHandle<'ctx> { type Row = ProfileReferralRelation; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ProfileReferralRelationTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileReferralRelationTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileReferralRelationTableHandle<'ctx> { + 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> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileReferralRelationTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_table.rs index fc9c83e16..7d77b0779 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_save_archive_table.rs @@ -18,6 +18,18 @@ pub struct ProfileSaveArchiveTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_save_archive`. +pub struct ProfileSaveArchiveTableAccessor; + +impl __sdk::TableAccessor for ProfileSaveArchiveTableAccessor { + type Row = ProfileSaveArchive; + type Handle<'db> = ProfileSaveArchiveTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_save_archive() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_save_archive`. /// @@ -42,6 +54,18 @@ impl ProfileSaveArchiveTableAccess for super::RemoteTables { pub struct ProfileSaveArchiveInsertCallbackId(__sdk::CallbackId); pub struct ProfileSaveArchiveDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileSaveArchiveTableHandle<'ctx> { + type Row = ProfileSaveArchive; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileSaveArchiveTableHandle<'ctx> { type Row = ProfileSaveArchive; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ProfileSaveArchiveTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileSaveArchiveTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileSaveArchiveTableHandle<'ctx> { + 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> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileSaveArchiveTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_task_config_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_config_table.rs index 108ccf6ce..a508d7f0a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_task_config_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_config_table.rs @@ -20,6 +20,18 @@ pub struct ProfileTaskConfigTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_task_config`. +pub struct ProfileTaskConfigTableAccessor; + +impl __sdk::TableAccessor for ProfileTaskConfigTableAccessor { + type Row = ProfileTaskConfig; + type Handle<'db> = ProfileTaskConfigTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_task_config() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_task_config`. /// @@ -44,6 +56,18 @@ impl ProfileTaskConfigTableAccess for super::RemoteTables { pub struct ProfileTaskConfigInsertCallbackId(__sdk::CallbackId); pub struct ProfileTaskConfigDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileTaskConfigTableHandle<'ctx> { + type Row = ProfileTaskConfig; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileTaskConfigTableHandle<'ctx> { type Row = ProfileTaskConfig; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for ProfileTaskConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileTaskConfigTableHandle<'ctx> { + type InsertCallbackId = ProfileTaskConfigInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskConfigInsertCallbackId { + ProfileTaskConfigInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileTaskConfigInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileTaskConfigTableHandle<'ctx> { + type DeleteCallbackId = ProfileTaskConfigDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskConfigDeleteCallbackId { + ProfileTaskConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileTaskConfigDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileTaskConfigUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskConfigTableHandle<'ctx> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for ProfileTaskConfigTableHandle<'ctx> { + type UpdateCallbackId = ProfileTaskConfigUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileTaskConfigUpdateCallbackId { + ProfileTaskConfigUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileTaskConfigUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `task_id` unique index on the table `profile_task_config`, /// which allows point queries on the field of the same name /// via the [`ProfileTaskConfigTaskIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_task_progress_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_progress_table.rs index bdf63b3e2..9d3abd6bf 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_task_progress_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_progress_table.rs @@ -19,6 +19,18 @@ pub struct ProfileTaskProgressTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_task_progress`. +pub struct ProfileTaskProgressTableAccessor; + +impl __sdk::TableAccessor for ProfileTaskProgressTableAccessor { + type Row = ProfileTaskProgress; + type Handle<'db> = ProfileTaskProgressTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_task_progress() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_task_progress`. /// @@ -43,6 +55,18 @@ impl ProfileTaskProgressTableAccess for super::RemoteTables { pub struct ProfileTaskProgressInsertCallbackId(__sdk::CallbackId); pub struct ProfileTaskProgressDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileTaskProgressTableHandle<'ctx> { + type Row = ProfileTaskProgress; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileTaskProgressTableHandle<'ctx> { type Row = ProfileTaskProgress; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for ProfileTaskProgressTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileTaskProgressTableHandle<'ctx> { + type InsertCallbackId = ProfileTaskProgressInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskProgressInsertCallbackId { + ProfileTaskProgressInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileTaskProgressInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileTaskProgressTableHandle<'ctx> { + type DeleteCallbackId = ProfileTaskProgressDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskProgressDeleteCallbackId { + ProfileTaskProgressDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileTaskProgressDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileTaskProgressUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskProgressTableHandle<'ctx> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskProgressTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for ProfileTaskProgressTableHandle<'ctx> { + type UpdateCallbackId = ProfileTaskProgressUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileTaskProgressUpdateCallbackId { + ProfileTaskProgressUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileTaskProgressUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `progress_id` unique index on the table `profile_task_progress`, /// which allows point queries on the field of the same name /// via the [`ProfileTaskProgressProgressIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_task_reward_claim_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_reward_claim_table.rs index 7e67894d2..a4c3f60e1 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_task_reward_claim_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_task_reward_claim_table.rs @@ -18,6 +18,18 @@ pub struct ProfileTaskRewardClaimTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_task_reward_claim`. +pub struct ProfileTaskRewardClaimTableAccessor; + +impl __sdk::TableAccessor for ProfileTaskRewardClaimTableAccessor { + type Row = ProfileTaskRewardClaim; + type Handle<'db> = ProfileTaskRewardClaimTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_task_reward_claim() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_task_reward_claim`. /// @@ -42,6 +54,18 @@ impl ProfileTaskRewardClaimTableAccess for super::RemoteTables { pub struct ProfileTaskRewardClaimInsertCallbackId(__sdk::CallbackId); pub struct ProfileTaskRewardClaimDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileTaskRewardClaimTableHandle<'ctx> { + type Row = ProfileTaskRewardClaim; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileTaskRewardClaimTableHandle<'ctx> { type Row = ProfileTaskRewardClaim; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ProfileTaskRewardClaimTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileTaskRewardClaimTableHandle<'ctx> { + type InsertCallbackId = ProfileTaskRewardClaimInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskRewardClaimInsertCallbackId { + ProfileTaskRewardClaimInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileTaskRewardClaimInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileTaskRewardClaimTableHandle<'ctx> { + type DeleteCallbackId = ProfileTaskRewardClaimDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileTaskRewardClaimDeleteCallbackId { + ProfileTaskRewardClaimDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileTaskRewardClaimDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileTaskRewardClaimUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskRewardClaimTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskRewardClaimTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate for ProfileTaskRewardClaimTableHandle<'ctx> { + type UpdateCallbackId = ProfileTaskRewardClaimUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileTaskRewardClaimUpdateCallbackId { + ProfileTaskRewardClaimUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileTaskRewardClaimUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `claim_id` unique index on the table `profile_task_reward_claim`, /// which allows point queries on the field of the same name /// via the [`ProfileTaskRewardClaimClaimIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_config_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_config_table.rs index 57cfdc85f..49dbcb498 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_config_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_config_table.rs @@ -18,6 +18,18 @@ pub struct ProfileWalletConfigTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_wallet_config`. +pub struct ProfileWalletConfigTableAccessor; + +impl __sdk::TableAccessor for ProfileWalletConfigTableAccessor { + type Row = ProfileWalletConfig; + type Handle<'db> = ProfileWalletConfigTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_wallet_config() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_wallet_config`. /// @@ -42,6 +54,18 @@ impl ProfileWalletConfigTableAccess for super::RemoteTables { pub struct ProfileWalletConfigInsertCallbackId(__sdk::CallbackId); pub struct ProfileWalletConfigDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileWalletConfigTableHandle<'ctx> { + type Row = ProfileWalletConfig; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileWalletConfigTableHandle<'ctx> { type Row = ProfileWalletConfig; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ProfileWalletConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileWalletConfigTableHandle<'ctx> { + type InsertCallbackId = ProfileWalletConfigInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileWalletConfigInsertCallbackId { + ProfileWalletConfigInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileWalletConfigInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileWalletConfigTableHandle<'ctx> { + type DeleteCallbackId = ProfileWalletConfigDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileWalletConfigDeleteCallbackId { + ProfileWalletConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileWalletConfigDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileWalletConfigUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileWalletConfigTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileWalletConfigTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for ProfileWalletConfigTableHandle<'ctx> { + type UpdateCallbackId = ProfileWalletConfigUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileWalletConfigUpdateCallbackId { + ProfileWalletConfigUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileWalletConfigUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `config_id` unique index on the table `profile_wallet_config`, /// which allows point queries on the field of the same name /// via the [`ProfileWalletConfigConfigIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_table.rs index 48705ae94..58eccf5fb 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_ledger_table.rs @@ -19,6 +19,18 @@ pub struct ProfileWalletLedgerTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_wallet_ledger`. +pub struct ProfileWalletLedgerTableAccessor; + +impl __sdk::TableAccessor for ProfileWalletLedgerTableAccessor { + type Row = ProfileWalletLedger; + type Handle<'db> = ProfileWalletLedgerTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_wallet_ledger() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_wallet_ledger`. /// @@ -43,6 +55,18 @@ impl ProfileWalletLedgerTableAccess for super::RemoteTables { pub struct ProfileWalletLedgerInsertCallbackId(__sdk::CallbackId); pub struct ProfileWalletLedgerDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileWalletLedgerTableHandle<'ctx> { + type Row = ProfileWalletLedger; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileWalletLedgerTableHandle<'ctx> { type Row = ProfileWalletLedger; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for ProfileWalletLedgerTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileWalletLedgerTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileWalletLedgerTableHandle<'ctx> { + 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> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileWalletLedgerTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_manual_restriction_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_manual_restriction_table.rs index 1de6884d0..31d08deb3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_manual_restriction_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/profile_wallet_manual_restriction_table.rs @@ -18,6 +18,18 @@ pub struct ProfileWalletManualRestrictionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `profile_wallet_manual_restriction`. +pub struct ProfileWalletManualRestrictionTableAccessor; + +impl __sdk::TableAccessor for ProfileWalletManualRestrictionTableAccessor { + type Row = ProfileWalletManualRestriction; + type Handle<'db> = ProfileWalletManualRestrictionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.profile_wallet_manual_restriction() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `profile_wallet_manual_restriction`. /// @@ -42,6 +54,18 @@ impl ProfileWalletManualRestrictionTableAccess for super::RemoteTables { pub struct ProfileWalletManualRestrictionInsertCallbackId(__sdk::CallbackId); pub struct ProfileWalletManualRestrictionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for ProfileWalletManualRestrictionTableHandle<'ctx> { + type Row = ProfileWalletManualRestriction; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for ProfileWalletManualRestrictionTableHandle<'ctx> { type Row = ProfileWalletManualRestriction; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for ProfileWalletManualRestrictionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for ProfileWalletManualRestrictionTableHandle<'ctx> { + type InsertCallbackId = ProfileWalletManualRestrictionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileWalletManualRestrictionInsertCallbackId { + ProfileWalletManualRestrictionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: ProfileWalletManualRestrictionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for ProfileWalletManualRestrictionTableHandle<'ctx> { + type DeleteCallbackId = ProfileWalletManualRestrictionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> ProfileWalletManualRestrictionDeleteCallbackId { + ProfileWalletManualRestrictionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: ProfileWalletManualRestrictionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct ProfileWalletManualRestrictionUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for ProfileWalletManualRestrictionTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for ProfileWalletManualRestrictionTableHan } } +impl<'ctx> __sdk::WithUpdate for ProfileWalletManualRestrictionTableHandle<'ctx> { + type UpdateCallbackId = ProfileWalletManualRestrictionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> ProfileWalletManualRestrictionUpdateCallbackId { + ProfileWalletManualRestrictionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: ProfileWalletManualRestrictionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `user_id` unique index on the table `profile_wallet_manual_restriction`, /// which allows point queries on the field of the same name /// via the [`ProfileWalletManualRestrictionUserIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/public_work_like_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/public_work_like_table.rs index b25f46d10..24d87ec00 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/public_work_like_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/public_work_like_table.rs @@ -18,6 +18,18 @@ pub struct PublicWorkLikeTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `public_work_like`. +pub struct PublicWorkLikeTableAccessor; + +impl __sdk::TableAccessor for PublicWorkLikeTableAccessor { + type Row = PublicWorkLike; + type Handle<'db> = PublicWorkLikeTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.public_work_like() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `public_work_like`. /// @@ -40,6 +52,18 @@ impl PublicWorkLikeTableAccess for super::RemoteTables { pub struct PublicWorkLikeInsertCallbackId(__sdk::CallbackId); pub struct PublicWorkLikeDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PublicWorkLikeTableHandle<'ctx> { + type Row = PublicWorkLike; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PublicWorkLikeTableHandle<'ctx> { type Row = PublicWorkLike; type EventContext = super::EventContext; @@ -78,6 +102,36 @@ impl<'ctx> __sdk::Table for PublicWorkLikeTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PublicWorkLikeTableHandle<'ctx> { + type InsertCallbackId = PublicWorkLikeInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PublicWorkLikeInsertCallbackId { + PublicWorkLikeInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PublicWorkLikeInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for PublicWorkLikeTableHandle<'ctx> { + type DeleteCallbackId = PublicWorkLikeDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PublicWorkLikeDeleteCallbackId { + PublicWorkLikeDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PublicWorkLikeDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct PublicWorkLikeUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for PublicWorkLikeTableHandle<'ctx> { @@ -95,6 +149,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PublicWorkLikeTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for PublicWorkLikeTableHandle<'ctx> { + type UpdateCallbackId = PublicWorkLikeUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PublicWorkLikeUpdateCallbackId { + PublicWorkLikeUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PublicWorkLikeUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `like_id` unique index on the table `public_work_like`, /// which allows point queries on the field of the same name /// via the [`PublicWorkLikeLikeIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/public_work_play_daily_stat_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/public_work_play_daily_stat_table.rs index 8c95aaa8f..3117ed994 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/public_work_play_daily_stat_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/public_work_play_daily_stat_table.rs @@ -18,6 +18,18 @@ pub struct PublicWorkPlayDailyStatTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `public_work_play_daily_stat`. +pub struct PublicWorkPlayDailyStatTableAccessor; + +impl __sdk::TableAccessor for PublicWorkPlayDailyStatTableAccessor { + type Row = PublicWorkPlayDailyStat; + type Handle<'db> = PublicWorkPlayDailyStatTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.public_work_play_daily_stat() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `public_work_play_daily_stat`. /// @@ -42,6 +54,18 @@ impl PublicWorkPlayDailyStatTableAccess for super::RemoteTables { pub struct PublicWorkPlayDailyStatInsertCallbackId(__sdk::CallbackId); pub struct PublicWorkPlayDailyStatDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PublicWorkPlayDailyStatTableHandle<'ctx> { + type Row = PublicWorkPlayDailyStat; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PublicWorkPlayDailyStatTableHandle<'ctx> { type Row = PublicWorkPlayDailyStat; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for PublicWorkPlayDailyStatTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PublicWorkPlayDailyStatTableHandle<'ctx> { + type InsertCallbackId = PublicWorkPlayDailyStatInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PublicWorkPlayDailyStatInsertCallbackId { + PublicWorkPlayDailyStatInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PublicWorkPlayDailyStatInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for PublicWorkPlayDailyStatTableHandle<'ctx> { + type DeleteCallbackId = PublicWorkPlayDailyStatDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PublicWorkPlayDailyStatDeleteCallbackId { + PublicWorkPlayDailyStatDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PublicWorkPlayDailyStatDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct PublicWorkPlayDailyStatUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for PublicWorkPlayDailyStatTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PublicWorkPlayDailyStatTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate for PublicWorkPlayDailyStatTableHandle<'ctx> { + type UpdateCallbackId = PublicWorkPlayDailyStatUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PublicWorkPlayDailyStatUpdateCallbackId { + PublicWorkPlayDailyStatUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PublicWorkPlayDailyStatUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `stat_id` unique index on the table `public_work_play_daily_stat`, /// which allows point queries on the field of the same name /// via the [`PublicWorkPlayDailyStatStatIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_table.rs index 0f54e13b9..eb26ee22d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_message_table.rs @@ -20,6 +20,18 @@ pub struct PuzzleAgentMessageTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `puzzle_agent_message`. +pub struct PuzzleAgentMessageTableAccessor; + +impl __sdk::TableAccessor for PuzzleAgentMessageTableAccessor { + type Row = PuzzleAgentMessageRow; + type Handle<'db> = PuzzleAgentMessageTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.puzzle_agent_message() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `puzzle_agent_message`. /// @@ -44,6 +56,18 @@ impl PuzzleAgentMessageTableAccess for super::RemoteTables { pub struct PuzzleAgentMessageInsertCallbackId(__sdk::CallbackId); pub struct PuzzleAgentMessageDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PuzzleAgentMessageTableHandle<'ctx> { + type Row = PuzzleAgentMessageRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PuzzleAgentMessageTableHandle<'ctx> { type Row = PuzzleAgentMessageRow; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for PuzzleAgentMessageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PuzzleAgentMessageTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for PuzzleAgentMessageTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentMessageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_table.rs index 08c053605..a4072181c 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_agent_session_table.rs @@ -19,6 +19,18 @@ pub struct PuzzleAgentSessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `puzzle_agent_session`. +pub struct PuzzleAgentSessionTableAccessor; + +impl __sdk::TableAccessor for PuzzleAgentSessionTableAccessor { + type Row = PuzzleAgentSessionRow; + type Handle<'db> = PuzzleAgentSessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.puzzle_agent_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `puzzle_agent_session`. /// @@ -43,6 +55,18 @@ impl PuzzleAgentSessionTableAccess for super::RemoteTables { pub struct PuzzleAgentSessionInsertCallbackId(__sdk::CallbackId); pub struct PuzzleAgentSessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PuzzleAgentSessionTableHandle<'ctx> { + type Row = PuzzleAgentSessionRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PuzzleAgentSessionTableHandle<'ctx> { type Row = PuzzleAgentSessionRow; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for PuzzleAgentSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PuzzleAgentSessionTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for PuzzleAgentSessionTableHandle<'ctx> { + 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> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_background_compile_task_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_background_compile_task_table.rs index 227085b59..4982944ad 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_background_compile_task_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_background_compile_task_table.rs @@ -18,6 +18,18 @@ pub struct PuzzleBackgroundCompileTaskTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `puzzle_background_compile_task`. +pub struct PuzzleBackgroundCompileTaskTableAccessor; + +impl __sdk::TableAccessor for PuzzleBackgroundCompileTaskTableAccessor { + type Row = PuzzleBackgroundCompileTaskRow; + type Handle<'db> = PuzzleBackgroundCompileTaskTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.puzzle_background_compile_task() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `puzzle_background_compile_task`. /// @@ -42,6 +54,18 @@ impl PuzzleBackgroundCompileTaskTableAccess for super::RemoteTables { pub struct PuzzleBackgroundCompileTaskInsertCallbackId(__sdk::CallbackId); pub struct PuzzleBackgroundCompileTaskDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PuzzleBackgroundCompileTaskTableHandle<'ctx> { + type Row = PuzzleBackgroundCompileTaskRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PuzzleBackgroundCompileTaskTableHandle<'ctx> { type Row = PuzzleBackgroundCompileTaskRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for PuzzleBackgroundCompileTaskTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PuzzleBackgroundCompileTaskTableHandle<'ctx> { + type InsertCallbackId = PuzzleBackgroundCompileTaskInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleBackgroundCompileTaskInsertCallbackId { + PuzzleBackgroundCompileTaskInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleBackgroundCompileTaskInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for PuzzleBackgroundCompileTaskTableHandle<'ctx> { + type DeleteCallbackId = PuzzleBackgroundCompileTaskDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleBackgroundCompileTaskDeleteCallbackId { + PuzzleBackgroundCompileTaskDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PuzzleBackgroundCompileTaskDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct PuzzleBackgroundCompileTaskUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleBackgroundCompileTaskTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleBackgroundCompileTaskTableHandle } } +impl<'ctx> __sdk::WithUpdate for PuzzleBackgroundCompileTaskTableHandle<'ctx> { + type UpdateCallbackId = PuzzleBackgroundCompileTaskUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PuzzleBackgroundCompileTaskUpdateCallbackId { + PuzzleBackgroundCompileTaskUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PuzzleBackgroundCompileTaskUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `task_id` unique index on the table `puzzle_background_compile_task`, /// which allows point queries on the field of the same name /// via the [`PuzzleBackgroundCompileTaskTaskIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_agent_session_table.rs index 3b2ad9138..68f508729 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_agent_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_agent_session_table.rs @@ -18,6 +18,18 @@ pub struct PuzzleClearAgentSessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `puzzle_clear_agent_session`. +pub struct PuzzleClearAgentSessionTableAccessor; + +impl __sdk::TableAccessor for PuzzleClearAgentSessionTableAccessor { + type Row = PuzzleClearAgentSessionRow; + type Handle<'db> = PuzzleClearAgentSessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.puzzle_clear_agent_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `puzzle_clear_agent_session`. /// @@ -42,6 +54,18 @@ impl PuzzleClearAgentSessionTableAccess for super::RemoteTables { pub struct PuzzleClearAgentSessionInsertCallbackId(__sdk::CallbackId); pub struct PuzzleClearAgentSessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PuzzleClearAgentSessionTableHandle<'ctx> { + type Row = PuzzleClearAgentSessionRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PuzzleClearAgentSessionTableHandle<'ctx> { type Row = PuzzleClearAgentSessionRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for PuzzleClearAgentSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PuzzleClearAgentSessionTableHandle<'ctx> { + type InsertCallbackId = PuzzleClearAgentSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleClearAgentSessionInsertCallbackId { + PuzzleClearAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleClearAgentSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for PuzzleClearAgentSessionTableHandle<'ctx> { + type DeleteCallbackId = PuzzleClearAgentSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleClearAgentSessionDeleteCallbackId { + PuzzleClearAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PuzzleClearAgentSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct PuzzleClearAgentSessionUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleClearAgentSessionTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleClearAgentSessionTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate for PuzzleClearAgentSessionTableHandle<'ctx> { + type UpdateCallbackId = PuzzleClearAgentSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PuzzleClearAgentSessionUpdateCallbackId { + PuzzleClearAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PuzzleClearAgentSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `session_id` unique index on the table `puzzle_clear_agent_session`, /// which allows point queries on the field of the same name /// via the [`PuzzleClearAgentSessionSessionIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_event_table.rs index c1966f235..4f506a433 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_event_table.rs @@ -18,6 +18,18 @@ pub struct PuzzleClearEventTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `puzzle_clear_event`. +pub struct PuzzleClearEventTableAccessor; + +impl __sdk::TableAccessor for PuzzleClearEventTableAccessor { + type Row = PuzzleClearEventRow; + type Handle<'db> = PuzzleClearEventTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.puzzle_clear_event() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `puzzle_clear_event`. /// @@ -42,6 +54,18 @@ impl PuzzleClearEventTableAccess for super::RemoteTables { pub struct PuzzleClearEventInsertCallbackId(__sdk::CallbackId); pub struct PuzzleClearEventDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PuzzleClearEventTableHandle<'ctx> { + type Row = PuzzleClearEventRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PuzzleClearEventTableHandle<'ctx> { type Row = PuzzleClearEventRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for PuzzleClearEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PuzzleClearEventTableHandle<'ctx> { + type InsertCallbackId = PuzzleClearEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleClearEventInsertCallbackId { + PuzzleClearEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleClearEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for PuzzleClearEventTableHandle<'ctx> { + type DeleteCallbackId = PuzzleClearEventDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleClearEventDeleteCallbackId { + PuzzleClearEventDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PuzzleClearEventDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct PuzzleClearEventUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleClearEventTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleClearEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for PuzzleClearEventTableHandle<'ctx> { + type UpdateCallbackId = PuzzleClearEventUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PuzzleClearEventUpdateCallbackId { + PuzzleClearEventUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PuzzleClearEventUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `event_id` unique index on the table `puzzle_clear_event`, /// which allows point queries on the field of the same name /// via the [`PuzzleClearEventEventIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_runtime_run_table.rs index b83148faa..dc7a1f89b 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_runtime_run_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_runtime_run_table.rs @@ -18,6 +18,18 @@ pub struct PuzzleClearRuntimeRunTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `puzzle_clear_runtime_run`. +pub struct PuzzleClearRuntimeRunTableAccessor; + +impl __sdk::TableAccessor for PuzzleClearRuntimeRunTableAccessor { + type Row = PuzzleClearRuntimeRunRow; + type Handle<'db> = PuzzleClearRuntimeRunTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.puzzle_clear_runtime_run() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `puzzle_clear_runtime_run`. /// @@ -42,6 +54,18 @@ impl PuzzleClearRuntimeRunTableAccess for super::RemoteTables { pub struct PuzzleClearRuntimeRunInsertCallbackId(__sdk::CallbackId); pub struct PuzzleClearRuntimeRunDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PuzzleClearRuntimeRunTableHandle<'ctx> { + type Row = PuzzleClearRuntimeRunRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PuzzleClearRuntimeRunTableHandle<'ctx> { type Row = PuzzleClearRuntimeRunRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for PuzzleClearRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PuzzleClearRuntimeRunTableHandle<'ctx> { + type InsertCallbackId = PuzzleClearRuntimeRunInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleClearRuntimeRunInsertCallbackId { + PuzzleClearRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleClearRuntimeRunInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for PuzzleClearRuntimeRunTableHandle<'ctx> { + type DeleteCallbackId = PuzzleClearRuntimeRunDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleClearRuntimeRunDeleteCallbackId { + PuzzleClearRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PuzzleClearRuntimeRunDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct PuzzleClearRuntimeRunUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleClearRuntimeRunTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleClearRuntimeRunTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for PuzzleClearRuntimeRunTableHandle<'ctx> { + type UpdateCallbackId = PuzzleClearRuntimeRunUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PuzzleClearRuntimeRunUpdateCallbackId { + PuzzleClearRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PuzzleClearRuntimeRunUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `run_id` unique index on the table `puzzle_clear_runtime_run`, /// which allows point queries on the field of the same name /// via the [`PuzzleClearRuntimeRunRunIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_work_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_work_profile_table.rs index 412795e70..ea4538fd3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_work_profile_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_clear_work_profile_table.rs @@ -18,6 +18,18 @@ pub struct PuzzleClearWorkProfileTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `puzzle_clear_work_profile`. +pub struct PuzzleClearWorkProfileTableAccessor; + +impl __sdk::TableAccessor for PuzzleClearWorkProfileTableAccessor { + type Row = PuzzleClearWorkProfileRow; + type Handle<'db> = PuzzleClearWorkProfileTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.puzzle_clear_work_profile() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `puzzle_clear_work_profile`. /// @@ -42,6 +54,18 @@ impl PuzzleClearWorkProfileTableAccess for super::RemoteTables { pub struct PuzzleClearWorkProfileInsertCallbackId(__sdk::CallbackId); pub struct PuzzleClearWorkProfileDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PuzzleClearWorkProfileTableHandle<'ctx> { + type Row = PuzzleClearWorkProfileRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PuzzleClearWorkProfileTableHandle<'ctx> { type Row = PuzzleClearWorkProfileRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for PuzzleClearWorkProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PuzzleClearWorkProfileTableHandle<'ctx> { + type InsertCallbackId = PuzzleClearWorkProfileInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleClearWorkProfileInsertCallbackId { + PuzzleClearWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleClearWorkProfileInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for PuzzleClearWorkProfileTableHandle<'ctx> { + type DeleteCallbackId = PuzzleClearWorkProfileDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleClearWorkProfileDeleteCallbackId { + PuzzleClearWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PuzzleClearWorkProfileDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct PuzzleClearWorkProfileUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleClearWorkProfileTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleClearWorkProfileTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate for PuzzleClearWorkProfileTableHandle<'ctx> { + type UpdateCallbackId = PuzzleClearWorkProfileUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PuzzleClearWorkProfileUpdateCallbackId { + PuzzleClearWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PuzzleClearWorkProfileUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `profile_id` unique index on the table `puzzle_clear_work_profile`, /// which allows point queries on the field of the same name /// via the [`PuzzleClearWorkProfileProfileIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_event_table.rs index 7e5638803..3610bb362 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_event_table.rs @@ -19,6 +19,18 @@ pub struct PuzzleEventTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `puzzle_event`. +pub struct PuzzleEventTableAccessor; + +impl __sdk::TableAccessor for PuzzleEventTableAccessor { + type Row = PuzzleEvent; + type Handle<'db> = PuzzleEventTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.puzzle_event() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `puzzle_event`. /// @@ -40,6 +52,18 @@ impl PuzzleEventTableAccess for super::RemoteTables { pub struct PuzzleEventInsertCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PuzzleEventTableHandle<'ctx> { + type Row = PuzzleEvent; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::EventTable for PuzzleEventTableHandle<'ctx> { type Row = PuzzleEvent; type EventContext = super::EventContext; @@ -65,6 +89,21 @@ impl<'ctx> __sdk::EventTable for PuzzleEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PuzzleEventTableHandle<'ctx> { + type InsertCallbackId = PuzzleEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleEventInsertCallbackId { + PuzzleEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = client_cache.get_or_make_table::("puzzle_event"); diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_leaderboard_entry_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_leaderboard_entry_table.rs index 808035f3f..45bb2eb2a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_leaderboard_entry_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_leaderboard_entry_table.rs @@ -18,6 +18,18 @@ pub struct PuzzleLeaderboardEntryTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `puzzle_leaderboard_entry`. +pub struct PuzzleLeaderboardEntryTableAccessor; + +impl __sdk::TableAccessor for PuzzleLeaderboardEntryTableAccessor { + type Row = PuzzleLeaderboardEntryRow; + type Handle<'db> = PuzzleLeaderboardEntryTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.puzzle_leaderboard_entry() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `puzzle_leaderboard_entry`. /// @@ -42,6 +54,18 @@ impl PuzzleLeaderboardEntryTableAccess for super::RemoteTables { pub struct PuzzleLeaderboardEntryInsertCallbackId(__sdk::CallbackId); pub struct PuzzleLeaderboardEntryDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PuzzleLeaderboardEntryTableHandle<'ctx> { + type Row = PuzzleLeaderboardEntryRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PuzzleLeaderboardEntryTableHandle<'ctx> { type Row = PuzzleLeaderboardEntryRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for PuzzleLeaderboardEntryTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PuzzleLeaderboardEntryTableHandle<'ctx> { + type InsertCallbackId = PuzzleLeaderboardEntryInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleLeaderboardEntryInsertCallbackId { + PuzzleLeaderboardEntryInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: PuzzleLeaderboardEntryInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for PuzzleLeaderboardEntryTableHandle<'ctx> { + type DeleteCallbackId = PuzzleLeaderboardEntryDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> PuzzleLeaderboardEntryDeleteCallbackId { + PuzzleLeaderboardEntryDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: PuzzleLeaderboardEntryDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct PuzzleLeaderboardEntryUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleLeaderboardEntryTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleLeaderboardEntryTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate for PuzzleLeaderboardEntryTableHandle<'ctx> { + type UpdateCallbackId = PuzzleLeaderboardEntryUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> PuzzleLeaderboardEntryUpdateCallbackId { + PuzzleLeaderboardEntryUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: PuzzleLeaderboardEntryUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `entry_id` unique index on the table `puzzle_leaderboard_entry`, /// which allows point queries on the field of the same name /// via the [`PuzzleLeaderboardEntryEntryIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_table.rs index 1cd988cce..d8772725a 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_runtime_run_table.rs @@ -18,6 +18,18 @@ pub struct PuzzleRuntimeRunTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `puzzle_runtime_run`. +pub struct PuzzleRuntimeRunTableAccessor; + +impl __sdk::TableAccessor for PuzzleRuntimeRunTableAccessor { + type Row = PuzzleRuntimeRunRow; + type Handle<'db> = PuzzleRuntimeRunTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.puzzle_runtime_run() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `puzzle_runtime_run`. /// @@ -42,6 +54,18 @@ impl PuzzleRuntimeRunTableAccess for super::RemoteTables { pub struct PuzzleRuntimeRunInsertCallbackId(__sdk::CallbackId); pub struct PuzzleRuntimeRunDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PuzzleRuntimeRunTableHandle<'ctx> { + type Row = PuzzleRuntimeRunRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PuzzleRuntimeRunTableHandle<'ctx> { type Row = PuzzleRuntimeRunRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for PuzzleRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PuzzleRuntimeRunTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for PuzzleRuntimeRunTableHandle<'ctx> { + 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> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_table.rs index 673a98412..d585413c0 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/puzzle_work_profile_table.rs @@ -19,6 +19,18 @@ pub struct PuzzleWorkProfileTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `puzzle_work_profile`. +pub struct PuzzleWorkProfileTableAccessor; + +impl __sdk::TableAccessor for PuzzleWorkProfileTableAccessor { + type Row = PuzzleWorkProfileRow; + type Handle<'db> = PuzzleWorkProfileTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.puzzle_work_profile() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `puzzle_work_profile`. /// @@ -43,6 +55,18 @@ impl PuzzleWorkProfileTableAccess for super::RemoteTables { pub struct PuzzleWorkProfileInsertCallbackId(__sdk::CallbackId); pub struct PuzzleWorkProfileDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for PuzzleWorkProfileTableHandle<'ctx> { + type Row = PuzzleWorkProfileRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for PuzzleWorkProfileTableHandle<'ctx> { type Row = PuzzleWorkProfileRow; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for PuzzleWorkProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for PuzzleWorkProfileTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for PuzzleWorkProfileTableHandle<'ctx> { + 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> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleWorkProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_log_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_log_table.rs index b1ac8c785..4f297bbf9 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_log_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_log_table.rs @@ -22,6 +22,18 @@ pub struct QuestLogTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `quest_log`. +pub struct QuestLogTableAccessor; + +impl __sdk::TableAccessor for QuestLogTableAccessor { + type Row = QuestLog; + type Handle<'db> = QuestLogTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.quest_log() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `quest_log`. /// @@ -44,6 +56,18 @@ impl QuestLogTableAccess for super::RemoteTables { pub struct QuestLogInsertCallbackId(__sdk::CallbackId); pub struct QuestLogDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for QuestLogTableHandle<'ctx> { + type Row = QuestLog; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for QuestLogTableHandle<'ctx> { type Row = QuestLog; type EventContext = super::EventContext; @@ -82,6 +106,36 @@ impl<'ctx> __sdk::Table for QuestLogTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for QuestLogTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for QuestLogTableHandle<'ctx> { + 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> { @@ -99,6 +153,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for QuestLogTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/quest_record_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/quest_record_table.rs index 07e6e918c..c7ba519e2 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/quest_record_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/quest_record_table.rs @@ -23,6 +23,18 @@ pub struct QuestRecordTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `quest_record`. +pub struct QuestRecordTableAccessor; + +impl __sdk::TableAccessor for QuestRecordTableAccessor { + type Row = QuestRecord; + type Handle<'db> = QuestRecordTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.quest_record() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `quest_record`. /// @@ -45,6 +57,18 @@ impl QuestRecordTableAccess for super::RemoteTables { pub struct QuestRecordInsertCallbackId(__sdk::CallbackId); pub struct QuestRecordDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for QuestRecordTableHandle<'ctx> { + type Row = QuestRecord; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for QuestRecordTableHandle<'ctx> { type Row = QuestRecord; type EventContext = super::EventContext; @@ -83,6 +107,36 @@ impl<'ctx> __sdk::Table for QuestRecordTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for QuestRecordTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for QuestRecordTableHandle<'ctx> { + 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> { @@ -100,6 +154,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for QuestRecordTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/refresh_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/refresh_session_table.rs index cae674226..472281e54 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/refresh_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/refresh_session_table.rs @@ -18,6 +18,18 @@ pub struct RefreshSessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `refresh_session`. +pub struct RefreshSessionTableAccessor; + +impl __sdk::TableAccessor for RefreshSessionTableAccessor { + type Row = RefreshSession; + type Handle<'db> = RefreshSessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.refresh_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `refresh_session`. /// @@ -40,6 +52,18 @@ impl RefreshSessionTableAccess for super::RemoteTables { pub struct RefreshSessionInsertCallbackId(__sdk::CallbackId); pub struct RefreshSessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for RefreshSessionTableHandle<'ctx> { + type Row = RefreshSession; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for RefreshSessionTableHandle<'ctx> { type Row = RefreshSession; type EventContext = super::EventContext; @@ -78,6 +102,36 @@ impl<'ctx> __sdk::Table for RefreshSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for RefreshSessionTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for RefreshSessionTableHandle<'ctx> { + 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> { @@ -95,6 +149,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for RefreshSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_table.rs index dc1ed5bb0..6ff0a9ab6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_setting_table.rs @@ -19,6 +19,18 @@ pub struct RuntimeSettingTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `runtime_setting`. +pub struct RuntimeSettingTableAccessor; + +impl __sdk::TableAccessor for RuntimeSettingTableAccessor { + type Row = RuntimeSetting; + type Handle<'db> = RuntimeSettingTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.runtime_setting() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `runtime_setting`. /// @@ -41,6 +53,18 @@ impl RuntimeSettingTableAccess for super::RemoteTables { pub struct RuntimeSettingInsertCallbackId(__sdk::CallbackId); pub struct RuntimeSettingDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for RuntimeSettingTableHandle<'ctx> { + type Row = RuntimeSetting; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for RuntimeSettingTableHandle<'ctx> { type Row = RuntimeSetting; type EventContext = super::EventContext; @@ -79,6 +103,36 @@ impl<'ctx> __sdk::Table for RuntimeSettingTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for RuntimeSettingTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for RuntimeSettingTableHandle<'ctx> { + 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> { @@ -96,6 +150,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for RuntimeSettingTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_table.rs index 9d1050169..f6fb4a3a7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/runtime_snapshot_table.rs @@ -18,6 +18,18 @@ pub struct RuntimeSnapshotTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `runtime_snapshot`. +pub struct RuntimeSnapshotTableAccessor; + +impl __sdk::TableAccessor for RuntimeSnapshotTableAccessor { + type Row = RuntimeSnapshotRow; + type Handle<'db> = RuntimeSnapshotTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.runtime_snapshot() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `runtime_snapshot`. /// @@ -40,6 +52,18 @@ impl RuntimeSnapshotTableAccess for super::RemoteTables { pub struct RuntimeSnapshotInsertCallbackId(__sdk::CallbackId); pub struct RuntimeSnapshotDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for RuntimeSnapshotTableHandle<'ctx> { + type Row = RuntimeSnapshotRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for RuntimeSnapshotTableHandle<'ctx> { type Row = RuntimeSnapshotRow; type EventContext = super::EventContext; @@ -78,6 +102,36 @@ impl<'ctx> __sdk::Table for RuntimeSnapshotTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for RuntimeSnapshotTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for RuntimeSnapshotTableHandle<'ctx> { + 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> { @@ -95,6 +149,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for RuntimeSnapshotTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/square_hole_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/square_hole_agent_message_table.rs index 9507df730..013941592 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/square_hole_agent_message_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/square_hole_agent_message_table.rs @@ -18,6 +18,18 @@ pub struct SquareHoleAgentMessageTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `square_hole_agent_message`. +pub struct SquareHoleAgentMessageTableAccessor; + +impl __sdk::TableAccessor for SquareHoleAgentMessageTableAccessor { + type Row = SquareHoleAgentMessageRow; + type Handle<'db> = SquareHoleAgentMessageTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.square_hole_agent_message() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `square_hole_agent_message`. /// @@ -42,6 +54,18 @@ impl SquareHoleAgentMessageTableAccess for super::RemoteTables { pub struct SquareHoleAgentMessageInsertCallbackId(__sdk::CallbackId); pub struct SquareHoleAgentMessageDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for SquareHoleAgentMessageTableHandle<'ctx> { + type Row = SquareHoleAgentMessageRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for SquareHoleAgentMessageTableHandle<'ctx> { type Row = SquareHoleAgentMessageRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for SquareHoleAgentMessageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for SquareHoleAgentMessageTableHandle<'ctx> { + type InsertCallbackId = SquareHoleAgentMessageInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> SquareHoleAgentMessageInsertCallbackId { + SquareHoleAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: SquareHoleAgentMessageInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for SquareHoleAgentMessageTableHandle<'ctx> { + type DeleteCallbackId = SquareHoleAgentMessageDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> SquareHoleAgentMessageDeleteCallbackId { + SquareHoleAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: SquareHoleAgentMessageDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct SquareHoleAgentMessageUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for SquareHoleAgentMessageTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for SquareHoleAgentMessageTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate for SquareHoleAgentMessageTableHandle<'ctx> { + type UpdateCallbackId = SquareHoleAgentMessageUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> SquareHoleAgentMessageUpdateCallbackId { + SquareHoleAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: SquareHoleAgentMessageUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `message_id` unique index on the table `square_hole_agent_message`, /// which allows point queries on the field of the same name /// via the [`SquareHoleAgentMessageMessageIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/square_hole_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/square_hole_agent_session_table.rs index 1f8098b1c..5e4438785 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/square_hole_agent_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/square_hole_agent_session_table.rs @@ -18,6 +18,18 @@ pub struct SquareHoleAgentSessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `square_hole_agent_session`. +pub struct SquareHoleAgentSessionTableAccessor; + +impl __sdk::TableAccessor for SquareHoleAgentSessionTableAccessor { + type Row = SquareHoleAgentSessionRow; + type Handle<'db> = SquareHoleAgentSessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.square_hole_agent_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `square_hole_agent_session`. /// @@ -42,6 +54,18 @@ impl SquareHoleAgentSessionTableAccess for super::RemoteTables { pub struct SquareHoleAgentSessionInsertCallbackId(__sdk::CallbackId); pub struct SquareHoleAgentSessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for SquareHoleAgentSessionTableHandle<'ctx> { + type Row = SquareHoleAgentSessionRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for SquareHoleAgentSessionTableHandle<'ctx> { type Row = SquareHoleAgentSessionRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for SquareHoleAgentSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for SquareHoleAgentSessionTableHandle<'ctx> { + type InsertCallbackId = SquareHoleAgentSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> SquareHoleAgentSessionInsertCallbackId { + SquareHoleAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: SquareHoleAgentSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for SquareHoleAgentSessionTableHandle<'ctx> { + type DeleteCallbackId = SquareHoleAgentSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> SquareHoleAgentSessionDeleteCallbackId { + SquareHoleAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: SquareHoleAgentSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct SquareHoleAgentSessionUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for SquareHoleAgentSessionTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for SquareHoleAgentSessionTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate for SquareHoleAgentSessionTableHandle<'ctx> { + type UpdateCallbackId = SquareHoleAgentSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> SquareHoleAgentSessionUpdateCallbackId { + SquareHoleAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: SquareHoleAgentSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `session_id` unique index on the table `square_hole_agent_session`, /// which allows point queries on the field of the same name /// via the [`SquareHoleAgentSessionSessionIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/square_hole_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/square_hole_runtime_run_table.rs index f257a82e3..01cc05452 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/square_hole_runtime_run_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/square_hole_runtime_run_table.rs @@ -18,6 +18,18 @@ pub struct SquareHoleRuntimeRunTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `square_hole_runtime_run`. +pub struct SquareHoleRuntimeRunTableAccessor; + +impl __sdk::TableAccessor for SquareHoleRuntimeRunTableAccessor { + type Row = SquareHoleRuntimeRunRow; + type Handle<'db> = SquareHoleRuntimeRunTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.square_hole_runtime_run() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `square_hole_runtime_run`. /// @@ -42,6 +54,18 @@ impl SquareHoleRuntimeRunTableAccess for super::RemoteTables { pub struct SquareHoleRuntimeRunInsertCallbackId(__sdk::CallbackId); pub struct SquareHoleRuntimeRunDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for SquareHoleRuntimeRunTableHandle<'ctx> { + type Row = SquareHoleRuntimeRunRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for SquareHoleRuntimeRunTableHandle<'ctx> { type Row = SquareHoleRuntimeRunRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for SquareHoleRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for SquareHoleRuntimeRunTableHandle<'ctx> { + type InsertCallbackId = SquareHoleRuntimeRunInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> SquareHoleRuntimeRunInsertCallbackId { + SquareHoleRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: SquareHoleRuntimeRunInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for SquareHoleRuntimeRunTableHandle<'ctx> { + type DeleteCallbackId = SquareHoleRuntimeRunDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> SquareHoleRuntimeRunDeleteCallbackId { + SquareHoleRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: SquareHoleRuntimeRunDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct SquareHoleRuntimeRunUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for SquareHoleRuntimeRunTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for SquareHoleRuntimeRunTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for SquareHoleRuntimeRunTableHandle<'ctx> { + type UpdateCallbackId = SquareHoleRuntimeRunUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> SquareHoleRuntimeRunUpdateCallbackId { + SquareHoleRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: SquareHoleRuntimeRunUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `run_id` unique index on the table `square_hole_runtime_run`, /// which allows point queries on the field of the same name /// via the [`SquareHoleRuntimeRunRunIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/square_hole_work_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/square_hole_work_profile_table.rs index 9a7102133..923fe6c92 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/square_hole_work_profile_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/square_hole_work_profile_table.rs @@ -18,6 +18,18 @@ pub struct SquareHoleWorkProfileTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `square_hole_work_profile`. +pub struct SquareHoleWorkProfileTableAccessor; + +impl __sdk::TableAccessor for SquareHoleWorkProfileTableAccessor { + type Row = SquareHoleWorkProfileRow; + type Handle<'db> = SquareHoleWorkProfileTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.square_hole_work_profile() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `square_hole_work_profile`. /// @@ -42,6 +54,18 @@ impl SquareHoleWorkProfileTableAccess for super::RemoteTables { pub struct SquareHoleWorkProfileInsertCallbackId(__sdk::CallbackId); pub struct SquareHoleWorkProfileDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for SquareHoleWorkProfileTableHandle<'ctx> { + type Row = SquareHoleWorkProfileRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for SquareHoleWorkProfileTableHandle<'ctx> { type Row = SquareHoleWorkProfileRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for SquareHoleWorkProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for SquareHoleWorkProfileTableHandle<'ctx> { + type InsertCallbackId = SquareHoleWorkProfileInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> SquareHoleWorkProfileInsertCallbackId { + SquareHoleWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: SquareHoleWorkProfileInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for SquareHoleWorkProfileTableHandle<'ctx> { + type DeleteCallbackId = SquareHoleWorkProfileDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> SquareHoleWorkProfileDeleteCallbackId { + SquareHoleWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: SquareHoleWorkProfileDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct SquareHoleWorkProfileUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for SquareHoleWorkProfileTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for SquareHoleWorkProfileTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for SquareHoleWorkProfileTableHandle<'ctx> { + type UpdateCallbackId = SquareHoleWorkProfileUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> SquareHoleWorkProfileUpdateCallbackId { + SquareHoleWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: SquareHoleWorkProfileUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `profile_id` unique index on the table `square_hole_work_profile`, /// which allows point queries on the field of the same name /// via the [`SquareHoleWorkProfileProfileIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_event_table.rs index 232a554ef..a02f01b11 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_event_table.rs @@ -19,6 +19,18 @@ pub struct StoryEventTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `story_event`. +pub struct StoryEventTableAccessor; + +impl __sdk::TableAccessor for StoryEventTableAccessor { + type Row = StoryEvent; + type Handle<'db> = StoryEventTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.story_event() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `story_event`. /// @@ -41,6 +53,18 @@ impl StoryEventTableAccess for super::RemoteTables { pub struct StoryEventInsertCallbackId(__sdk::CallbackId); pub struct StoryEventDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for StoryEventTableHandle<'ctx> { + type Row = StoryEvent; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for StoryEventTableHandle<'ctx> { type Row = StoryEvent; type EventContext = super::EventContext; @@ -79,6 +103,36 @@ impl<'ctx> __sdk::Table for StoryEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for StoryEventTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for StoryEventTableHandle<'ctx> { + 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> { @@ -96,6 +150,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for StoryEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/story_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/story_session_table.rs index 142f7fa18..c7f0b8e02 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/story_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/story_session_table.rs @@ -19,6 +19,18 @@ pub struct StorySessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `story_session`. +pub struct StorySessionTableAccessor; + +impl __sdk::TableAccessor for StorySessionTableAccessor { + type Row = StorySession; + type Handle<'db> = StorySessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.story_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `story_session`. /// @@ -41,6 +53,18 @@ impl StorySessionTableAccess for super::RemoteTables { pub struct StorySessionInsertCallbackId(__sdk::CallbackId); pub struct StorySessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for StorySessionTableHandle<'ctx> { + type Row = StorySession; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for StorySessionTableHandle<'ctx> { type Row = StorySession; type EventContext = super::EventContext; @@ -79,6 +103,36 @@ impl<'ctx> __sdk::Table for StorySessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for StorySessionTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for StorySessionTableHandle<'ctx> { + 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> { @@ -96,6 +150,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for StorySessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/tracking_daily_stat_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/tracking_daily_stat_table.rs index b86a18939..fc20ec94d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/tracking_daily_stat_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/tracking_daily_stat_table.rs @@ -19,6 +19,18 @@ pub struct TrackingDailyStatTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `tracking_daily_stat`. +pub struct TrackingDailyStatTableAccessor; + +impl __sdk::TableAccessor for TrackingDailyStatTableAccessor { + type Row = TrackingDailyStat; + type Handle<'db> = TrackingDailyStatTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.tracking_daily_stat() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `tracking_daily_stat`. /// @@ -43,6 +55,18 @@ impl TrackingDailyStatTableAccess for super::RemoteTables { pub struct TrackingDailyStatInsertCallbackId(__sdk::CallbackId); pub struct TrackingDailyStatDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for TrackingDailyStatTableHandle<'ctx> { + type Row = TrackingDailyStat; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for TrackingDailyStatTableHandle<'ctx> { type Row = TrackingDailyStat; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for TrackingDailyStatTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for TrackingDailyStatTableHandle<'ctx> { + type InsertCallbackId = TrackingDailyStatInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> TrackingDailyStatInsertCallbackId { + TrackingDailyStatInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: TrackingDailyStatInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for TrackingDailyStatTableHandle<'ctx> { + type DeleteCallbackId = TrackingDailyStatDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> TrackingDailyStatDeleteCallbackId { + TrackingDailyStatDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: TrackingDailyStatDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct TrackingDailyStatUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for TrackingDailyStatTableHandle<'ctx> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for TrackingDailyStatTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for TrackingDailyStatTableHandle<'ctx> { + type UpdateCallbackId = TrackingDailyStatUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> TrackingDailyStatUpdateCallbackId { + TrackingDailyStatUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: TrackingDailyStatUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `stat_id` unique index on the table `tracking_daily_stat`, /// which allows point queries on the field of the same name /// via the [`TrackingDailyStatStatIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/tracking_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/tracking_event_table.rs index 0a48f1fbc..c2c72ef87 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/tracking_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/tracking_event_table.rs @@ -19,6 +19,18 @@ pub struct TrackingEventTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `tracking_event`. +pub struct TrackingEventTableAccessor; + +impl __sdk::TableAccessor for TrackingEventTableAccessor { + type Row = TrackingEvent; + type Handle<'db> = TrackingEventTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.tracking_event() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `tracking_event`. /// @@ -41,6 +53,18 @@ impl TrackingEventTableAccess for super::RemoteTables { pub struct TrackingEventInsertCallbackId(__sdk::CallbackId); pub struct TrackingEventDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for TrackingEventTableHandle<'ctx> { + type Row = TrackingEvent; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for TrackingEventTableHandle<'ctx> { type Row = TrackingEvent; type EventContext = super::EventContext; @@ -79,6 +103,36 @@ impl<'ctx> __sdk::Table for TrackingEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for TrackingEventTableHandle<'ctx> { + type InsertCallbackId = TrackingEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> TrackingEventInsertCallbackId { + TrackingEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: TrackingEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for TrackingEventTableHandle<'ctx> { + type DeleteCallbackId = TrackingEventDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> TrackingEventDeleteCallbackId { + TrackingEventDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: TrackingEventDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct TrackingEventUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for TrackingEventTableHandle<'ctx> { @@ -96,6 +150,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for TrackingEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for TrackingEventTableHandle<'ctx> { + type UpdateCallbackId = TrackingEventUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> TrackingEventUpdateCallbackId { + TrackingEventUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: TrackingEventUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `event_id` unique index on the table `tracking_event`, /// which allows point queries on the field of the same name /// via the [`TrackingEventEventIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_table.rs index 927e3256d..090bcae75 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/treasure_record_table.rs @@ -20,6 +20,18 @@ pub struct TreasureRecordTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `treasure_record`. +pub struct TreasureRecordTableAccessor; + +impl __sdk::TableAccessor for TreasureRecordTableAccessor { + type Row = TreasureRecord; + type Handle<'db> = TreasureRecordTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.treasure_record() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `treasure_record`. /// @@ -42,6 +54,18 @@ impl TreasureRecordTableAccess for super::RemoteTables { pub struct TreasureRecordInsertCallbackId(__sdk::CallbackId); pub struct TreasureRecordDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for TreasureRecordTableHandle<'ctx> { + type Row = TreasureRecord; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for TreasureRecordTableHandle<'ctx> { type Row = TreasureRecord; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for TreasureRecordTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for TreasureRecordTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for TreasureRecordTableHandle<'ctx> { + 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> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for TreasureRecordTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/user_account_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/user_account_table.rs index ac55c40ad..7d91aa3c6 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/user_account_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/user_account_table.rs @@ -18,6 +18,18 @@ pub struct UserAccountTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `user_account`. +pub struct UserAccountTableAccessor; + +impl __sdk::TableAccessor for UserAccountTableAccessor { + type Row = UserAccount; + type Handle<'db> = UserAccountTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.user_account() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `user_account`. /// @@ -40,6 +52,18 @@ impl UserAccountTableAccess for super::RemoteTables { pub struct UserAccountInsertCallbackId(__sdk::CallbackId); pub struct UserAccountDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for UserAccountTableHandle<'ctx> { + type Row = UserAccount; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for UserAccountTableHandle<'ctx> { type Row = UserAccount; type EventContext = super::EventContext; @@ -78,6 +102,36 @@ impl<'ctx> __sdk::Table for UserAccountTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for UserAccountTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for UserAccountTableHandle<'ctx> { + 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> { @@ -95,6 +149,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for UserAccountTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_table.rs index 2341921df..8cc51fcac 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/user_browse_history_table.rs @@ -19,6 +19,18 @@ pub struct UserBrowseHistoryTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `user_browse_history`. +pub struct UserBrowseHistoryTableAccessor; + +impl __sdk::TableAccessor for UserBrowseHistoryTableAccessor { + type Row = UserBrowseHistory; + type Handle<'db> = UserBrowseHistoryTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.user_browse_history() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `user_browse_history`. /// @@ -43,6 +55,18 @@ impl UserBrowseHistoryTableAccess for super::RemoteTables { pub struct UserBrowseHistoryInsertCallbackId(__sdk::CallbackId); pub struct UserBrowseHistoryDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for UserBrowseHistoryTableHandle<'ctx> { + type Row = UserBrowseHistory; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for UserBrowseHistoryTableHandle<'ctx> { type Row = UserBrowseHistory; type EventContext = super::EventContext; @@ -81,6 +105,36 @@ impl<'ctx> __sdk::Table for UserBrowseHistoryTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for UserBrowseHistoryTableHandle<'ctx> { + 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) + } +} + +impl<'ctx> __sdk::WithDelete for UserBrowseHistoryTableHandle<'ctx> { + 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> { @@ -98,6 +152,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for UserBrowseHistoryTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate 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. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_agent_message_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_agent_message_table.rs index 094652cf8..5de1de62d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_agent_message_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_agent_message_table.rs @@ -18,6 +18,18 @@ pub struct VisualNovelAgentMessageTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `visual_novel_agent_message`. +pub struct VisualNovelAgentMessageTableAccessor; + +impl __sdk::TableAccessor for VisualNovelAgentMessageTableAccessor { + type Row = VisualNovelAgentMessageRow; + type Handle<'db> = VisualNovelAgentMessageTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.visual_novel_agent_message() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `visual_novel_agent_message`. /// @@ -42,6 +54,18 @@ impl VisualNovelAgentMessageTableAccess for super::RemoteTables { pub struct VisualNovelAgentMessageInsertCallbackId(__sdk::CallbackId); pub struct VisualNovelAgentMessageDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for VisualNovelAgentMessageTableHandle<'ctx> { + type Row = VisualNovelAgentMessageRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for VisualNovelAgentMessageTableHandle<'ctx> { type Row = VisualNovelAgentMessageRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for VisualNovelAgentMessageTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for VisualNovelAgentMessageTableHandle<'ctx> { + type InsertCallbackId = VisualNovelAgentMessageInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> VisualNovelAgentMessageInsertCallbackId { + VisualNovelAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: VisualNovelAgentMessageInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for VisualNovelAgentMessageTableHandle<'ctx> { + type DeleteCallbackId = VisualNovelAgentMessageDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> VisualNovelAgentMessageDeleteCallbackId { + VisualNovelAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: VisualNovelAgentMessageDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct VisualNovelAgentMessageUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for VisualNovelAgentMessageTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for VisualNovelAgentMessageTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate for VisualNovelAgentMessageTableHandle<'ctx> { + type UpdateCallbackId = VisualNovelAgentMessageUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> VisualNovelAgentMessageUpdateCallbackId { + VisualNovelAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: VisualNovelAgentMessageUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `message_id` unique index on the table `visual_novel_agent_message`, /// which allows point queries on the field of the same name /// via the [`VisualNovelAgentMessageMessageIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_agent_session_table.rs index 59c956c83..a2ce33cd7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_agent_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_agent_session_table.rs @@ -18,6 +18,18 @@ pub struct VisualNovelAgentSessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `visual_novel_agent_session`. +pub struct VisualNovelAgentSessionTableAccessor; + +impl __sdk::TableAccessor for VisualNovelAgentSessionTableAccessor { + type Row = VisualNovelAgentSessionRow; + type Handle<'db> = VisualNovelAgentSessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.visual_novel_agent_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `visual_novel_agent_session`. /// @@ -42,6 +54,18 @@ impl VisualNovelAgentSessionTableAccess for super::RemoteTables { pub struct VisualNovelAgentSessionInsertCallbackId(__sdk::CallbackId); pub struct VisualNovelAgentSessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for VisualNovelAgentSessionTableHandle<'ctx> { + type Row = VisualNovelAgentSessionRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for VisualNovelAgentSessionTableHandle<'ctx> { type Row = VisualNovelAgentSessionRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for VisualNovelAgentSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for VisualNovelAgentSessionTableHandle<'ctx> { + type InsertCallbackId = VisualNovelAgentSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> VisualNovelAgentSessionInsertCallbackId { + VisualNovelAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: VisualNovelAgentSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for VisualNovelAgentSessionTableHandle<'ctx> { + type DeleteCallbackId = VisualNovelAgentSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> VisualNovelAgentSessionDeleteCallbackId { + VisualNovelAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: VisualNovelAgentSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct VisualNovelAgentSessionUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for VisualNovelAgentSessionTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for VisualNovelAgentSessionTableHandle<'ct } } +impl<'ctx> __sdk::WithUpdate for VisualNovelAgentSessionTableHandle<'ctx> { + type UpdateCallbackId = VisualNovelAgentSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> VisualNovelAgentSessionUpdateCallbackId { + VisualNovelAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: VisualNovelAgentSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `session_id` unique index on the table `visual_novel_agent_session`, /// which allows point queries on the field of the same name /// via the [`VisualNovelAgentSessionSessionIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_event_table.rs index 07d71e9d1..83457c6d7 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_event_table.rs @@ -18,6 +18,18 @@ pub struct VisualNovelRuntimeEventTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `visual_novel_runtime_event`. +pub struct VisualNovelRuntimeEventTableAccessor; + +impl __sdk::TableAccessor for VisualNovelRuntimeEventTableAccessor { + type Row = VisualNovelRuntimeEvent; + type Handle<'db> = VisualNovelRuntimeEventTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.visual_novel_runtime_event() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `visual_novel_runtime_event`. /// @@ -41,6 +53,18 @@ impl VisualNovelRuntimeEventTableAccess for super::RemoteTables { pub struct VisualNovelRuntimeEventInsertCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for VisualNovelRuntimeEventTableHandle<'ctx> { + type Row = VisualNovelRuntimeEvent; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::EventTable for VisualNovelRuntimeEventTableHandle<'ctx> { type Row = VisualNovelRuntimeEvent; type EventContext = super::EventContext; @@ -66,6 +90,21 @@ impl<'ctx> __sdk::EventTable for VisualNovelRuntimeEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for VisualNovelRuntimeEventTableHandle<'ctx> { + type InsertCallbackId = VisualNovelRuntimeEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> VisualNovelRuntimeEventInsertCallbackId { + VisualNovelRuntimeEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: VisualNovelRuntimeEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + #[doc(hidden)] pub(super) fn register_table(client_cache: &mut __sdk::ClientCache) { let _table = diff --git a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_history_entry_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_history_entry_table.rs index 14fb35413..7936d334d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_history_entry_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_history_entry_table.rs @@ -18,6 +18,18 @@ pub struct VisualNovelRuntimeHistoryEntryTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `visual_novel_runtime_history_entry`. +pub struct VisualNovelRuntimeHistoryEntryTableAccessor; + +impl __sdk::TableAccessor for VisualNovelRuntimeHistoryEntryTableAccessor { + type Row = VisualNovelRuntimeHistoryEntryRow; + type Handle<'db> = VisualNovelRuntimeHistoryEntryTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.visual_novel_runtime_history_entry() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `visual_novel_runtime_history_entry`. /// @@ -42,6 +54,18 @@ impl VisualNovelRuntimeHistoryEntryTableAccess for super::RemoteTables { pub struct VisualNovelRuntimeHistoryEntryInsertCallbackId(__sdk::CallbackId); pub struct VisualNovelRuntimeHistoryEntryDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for VisualNovelRuntimeHistoryEntryTableHandle<'ctx> { + type Row = VisualNovelRuntimeHistoryEntryRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for VisualNovelRuntimeHistoryEntryTableHandle<'ctx> { type Row = VisualNovelRuntimeHistoryEntryRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for VisualNovelRuntimeHistoryEntryTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for VisualNovelRuntimeHistoryEntryTableHandle<'ctx> { + type InsertCallbackId = VisualNovelRuntimeHistoryEntryInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> VisualNovelRuntimeHistoryEntryInsertCallbackId { + VisualNovelRuntimeHistoryEntryInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: VisualNovelRuntimeHistoryEntryInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for VisualNovelRuntimeHistoryEntryTableHandle<'ctx> { + type DeleteCallbackId = VisualNovelRuntimeHistoryEntryDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> VisualNovelRuntimeHistoryEntryDeleteCallbackId { + VisualNovelRuntimeHistoryEntryDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: VisualNovelRuntimeHistoryEntryDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct VisualNovelRuntimeHistoryEntryUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for VisualNovelRuntimeHistoryEntryTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for VisualNovelRuntimeHistoryEntryTableHan } } +impl<'ctx> __sdk::WithUpdate for VisualNovelRuntimeHistoryEntryTableHandle<'ctx> { + type UpdateCallbackId = VisualNovelRuntimeHistoryEntryUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> VisualNovelRuntimeHistoryEntryUpdateCallbackId { + VisualNovelRuntimeHistoryEntryUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: VisualNovelRuntimeHistoryEntryUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `entry_id` unique index on the table `visual_novel_runtime_history_entry`, /// which allows point queries on the field of the same name /// via the [`VisualNovelRuntimeHistoryEntryEntryIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_run_table.rs index 98a497532..2578c1e6f 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_run_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_runtime_run_table.rs @@ -18,6 +18,18 @@ pub struct VisualNovelRuntimeRunTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `visual_novel_runtime_run`. +pub struct VisualNovelRuntimeRunTableAccessor; + +impl __sdk::TableAccessor for VisualNovelRuntimeRunTableAccessor { + type Row = VisualNovelRuntimeRunRow; + type Handle<'db> = VisualNovelRuntimeRunTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.visual_novel_runtime_run() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `visual_novel_runtime_run`. /// @@ -42,6 +54,18 @@ impl VisualNovelRuntimeRunTableAccess for super::RemoteTables { pub struct VisualNovelRuntimeRunInsertCallbackId(__sdk::CallbackId); pub struct VisualNovelRuntimeRunDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for VisualNovelRuntimeRunTableHandle<'ctx> { + type Row = VisualNovelRuntimeRunRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for VisualNovelRuntimeRunTableHandle<'ctx> { type Row = VisualNovelRuntimeRunRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for VisualNovelRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for VisualNovelRuntimeRunTableHandle<'ctx> { + type InsertCallbackId = VisualNovelRuntimeRunInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> VisualNovelRuntimeRunInsertCallbackId { + VisualNovelRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: VisualNovelRuntimeRunInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for VisualNovelRuntimeRunTableHandle<'ctx> { + type DeleteCallbackId = VisualNovelRuntimeRunDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> VisualNovelRuntimeRunDeleteCallbackId { + VisualNovelRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: VisualNovelRuntimeRunDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct VisualNovelRuntimeRunUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for VisualNovelRuntimeRunTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for VisualNovelRuntimeRunTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for VisualNovelRuntimeRunTableHandle<'ctx> { + type UpdateCallbackId = VisualNovelRuntimeRunUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> VisualNovelRuntimeRunUpdateCallbackId { + VisualNovelRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: VisualNovelRuntimeRunUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `run_id` unique index on the table `visual_novel_runtime_run`, /// which allows point queries on the field of the same name /// via the [`VisualNovelRuntimeRunRunIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_work_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_work_profile_table.rs index 55371a46b..87ff32057 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_work_profile_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/visual_novel_work_profile_table.rs @@ -18,6 +18,18 @@ pub struct VisualNovelWorkProfileTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `visual_novel_work_profile`. +pub struct VisualNovelWorkProfileTableAccessor; + +impl __sdk::TableAccessor for VisualNovelWorkProfileTableAccessor { + type Row = VisualNovelWorkProfileRow; + type Handle<'db> = VisualNovelWorkProfileTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.visual_novel_work_profile() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `visual_novel_work_profile`. /// @@ -42,6 +54,18 @@ impl VisualNovelWorkProfileTableAccess for super::RemoteTables { pub struct VisualNovelWorkProfileInsertCallbackId(__sdk::CallbackId); pub struct VisualNovelWorkProfileDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for VisualNovelWorkProfileTableHandle<'ctx> { + type Row = VisualNovelWorkProfileRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for VisualNovelWorkProfileTableHandle<'ctx> { type Row = VisualNovelWorkProfileRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for VisualNovelWorkProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for VisualNovelWorkProfileTableHandle<'ctx> { + type InsertCallbackId = VisualNovelWorkProfileInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> VisualNovelWorkProfileInsertCallbackId { + VisualNovelWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: VisualNovelWorkProfileInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for VisualNovelWorkProfileTableHandle<'ctx> { + type DeleteCallbackId = VisualNovelWorkProfileDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> VisualNovelWorkProfileDeleteCallbackId { + VisualNovelWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: VisualNovelWorkProfileDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct VisualNovelWorkProfileUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for VisualNovelWorkProfileTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for VisualNovelWorkProfileTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate for VisualNovelWorkProfileTableHandle<'ctx> { + type UpdateCallbackId = VisualNovelWorkProfileUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> VisualNovelWorkProfileUpdateCallbackId { + VisualNovelWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: VisualNovelWorkProfileUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `profile_id` unique index on the table `visual_novel_work_profile`, /// which allows point queries on the field of the same name /// via the [`VisualNovelWorkProfileProfileIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_agent_session_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_agent_session_table.rs index 2b9e7d583..b02cf523d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_agent_session_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_agent_session_table.rs @@ -18,6 +18,18 @@ pub struct WoodenFishAgentSessionTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `wooden_fish_agent_session`. +pub struct WoodenFishAgentSessionTableAccessor; + +impl __sdk::TableAccessor for WoodenFishAgentSessionTableAccessor { + type Row = WoodenFishAgentSessionRow; + type Handle<'db> = WoodenFishAgentSessionTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.wooden_fish_agent_session() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `wooden_fish_agent_session`. /// @@ -42,6 +54,18 @@ impl WoodenFishAgentSessionTableAccess for super::RemoteTables { pub struct WoodenFishAgentSessionInsertCallbackId(__sdk::CallbackId); pub struct WoodenFishAgentSessionDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for WoodenFishAgentSessionTableHandle<'ctx> { + type Row = WoodenFishAgentSessionRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for WoodenFishAgentSessionTableHandle<'ctx> { type Row = WoodenFishAgentSessionRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for WoodenFishAgentSessionTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for WoodenFishAgentSessionTableHandle<'ctx> { + type InsertCallbackId = WoodenFishAgentSessionInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> WoodenFishAgentSessionInsertCallbackId { + WoodenFishAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: WoodenFishAgentSessionInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for WoodenFishAgentSessionTableHandle<'ctx> { + type DeleteCallbackId = WoodenFishAgentSessionDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> WoodenFishAgentSessionDeleteCallbackId { + WoodenFishAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: WoodenFishAgentSessionDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct WoodenFishAgentSessionUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishAgentSessionTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishAgentSessionTableHandle<'ctx } } +impl<'ctx> __sdk::WithUpdate for WoodenFishAgentSessionTableHandle<'ctx> { + type UpdateCallbackId = WoodenFishAgentSessionUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> WoodenFishAgentSessionUpdateCallbackId { + WoodenFishAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: WoodenFishAgentSessionUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `session_id` unique index on the table `wooden_fish_agent_session`, /// which allows point queries on the field of the same name /// via the [`WoodenFishAgentSessionSessionIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_event_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_event_table.rs index ba0e979de..6a1c9fc8d 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_event_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_event_table.rs @@ -18,6 +18,18 @@ pub struct WoodenFishEventTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `wooden_fish_event`. +pub struct WoodenFishEventTableAccessor; + +impl __sdk::TableAccessor for WoodenFishEventTableAccessor { + type Row = WoodenFishEventRow; + type Handle<'db> = WoodenFishEventTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.wooden_fish_event() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `wooden_fish_event`. /// @@ -42,6 +54,18 @@ impl WoodenFishEventTableAccess for super::RemoteTables { pub struct WoodenFishEventInsertCallbackId(__sdk::CallbackId); pub struct WoodenFishEventDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for WoodenFishEventTableHandle<'ctx> { + type Row = WoodenFishEventRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for WoodenFishEventTableHandle<'ctx> { type Row = WoodenFishEventRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for WoodenFishEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for WoodenFishEventTableHandle<'ctx> { + type InsertCallbackId = WoodenFishEventInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> WoodenFishEventInsertCallbackId { + WoodenFishEventInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: WoodenFishEventInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for WoodenFishEventTableHandle<'ctx> { + type DeleteCallbackId = WoodenFishEventDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> WoodenFishEventDeleteCallbackId { + WoodenFishEventDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: WoodenFishEventDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct WoodenFishEventUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishEventTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishEventTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithUpdate for WoodenFishEventTableHandle<'ctx> { + type UpdateCallbackId = WoodenFishEventUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> WoodenFishEventUpdateCallbackId { + WoodenFishEventUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: WoodenFishEventUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `event_id` unique index on the table `wooden_fish_event`, /// which allows point queries on the field of the same name /// via the [`WoodenFishEventEventIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_runtime_run_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_runtime_run_table.rs index f09d3b6e6..c762aadd3 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_runtime_run_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_runtime_run_table.rs @@ -18,6 +18,18 @@ pub struct WoodenFishRuntimeRunTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `wooden_fish_runtime_run`. +pub struct WoodenFishRuntimeRunTableAccessor; + +impl __sdk::TableAccessor for WoodenFishRuntimeRunTableAccessor { + type Row = WoodenFishRuntimeRunRow; + type Handle<'db> = WoodenFishRuntimeRunTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.wooden_fish_runtime_run() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `wooden_fish_runtime_run`. /// @@ -42,6 +54,18 @@ impl WoodenFishRuntimeRunTableAccess for super::RemoteTables { pub struct WoodenFishRuntimeRunInsertCallbackId(__sdk::CallbackId); pub struct WoodenFishRuntimeRunDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for WoodenFishRuntimeRunTableHandle<'ctx> { + type Row = WoodenFishRuntimeRunRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for WoodenFishRuntimeRunTableHandle<'ctx> { type Row = WoodenFishRuntimeRunRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for WoodenFishRuntimeRunTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for WoodenFishRuntimeRunTableHandle<'ctx> { + type InsertCallbackId = WoodenFishRuntimeRunInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> WoodenFishRuntimeRunInsertCallbackId { + WoodenFishRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: WoodenFishRuntimeRunInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for WoodenFishRuntimeRunTableHandle<'ctx> { + type DeleteCallbackId = WoodenFishRuntimeRunDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> WoodenFishRuntimeRunDeleteCallbackId { + WoodenFishRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: WoodenFishRuntimeRunDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct WoodenFishRuntimeRunUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishRuntimeRunTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishRuntimeRunTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for WoodenFishRuntimeRunTableHandle<'ctx> { + type UpdateCallbackId = WoodenFishRuntimeRunUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> WoodenFishRuntimeRunUpdateCallbackId { + WoodenFishRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: WoodenFishRuntimeRunUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `run_id` unique index on the table `wooden_fish_runtime_run`, /// which allows point queries on the field of the same name /// via the [`WoodenFishRuntimeRunRunIdUnique::find`] method. diff --git a/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_work_profile_table.rs b/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_work_profile_table.rs index 6815f1698..aa9904114 100644 --- a/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_work_profile_table.rs +++ b/server-rs/crates/spacetime-client/src/module_bindings/wooden_fish_work_profile_table.rs @@ -18,6 +18,18 @@ pub struct WoodenFishWorkProfileTableHandle<'ctx> { ctx: std::marker::PhantomData<&'ctx super::RemoteTables>, } +/// Lifetime-aware accessor marker for the table `wooden_fish_work_profile`. +pub struct WoodenFishWorkProfileTableAccessor; + +impl __sdk::TableAccessor for WoodenFishWorkProfileTableAccessor { + type Row = WoodenFishWorkProfileRow; + type Handle<'db> = WoodenFishWorkProfileTableHandle<'db>; + + fn get<'db>(db: &'db super::RemoteTables) -> Self::Handle<'db> { + db.wooden_fish_work_profile() + } +} + #[allow(non_camel_case_types)] /// Extension trait for access to the table `wooden_fish_work_profile`. /// @@ -42,6 +54,18 @@ impl WoodenFishWorkProfileTableAccess for super::RemoteTables { pub struct WoodenFishWorkProfileInsertCallbackId(__sdk::CallbackId); pub struct WoodenFishWorkProfileDeleteCallbackId(__sdk::CallbackId); +impl<'ctx> __sdk::TableLike for WoodenFishWorkProfileTableHandle<'ctx> { + type Row = WoodenFishWorkProfileRow; + type EventContext = super::EventContext; + + fn count(&self) -> u64 { + self.imp.count() + } + fn iter(&self) -> impl Iterator + '_ { + self.imp.iter() + } +} + impl<'ctx> __sdk::Table for WoodenFishWorkProfileTableHandle<'ctx> { type Row = WoodenFishWorkProfileRow; type EventContext = super::EventContext; @@ -80,6 +104,36 @@ impl<'ctx> __sdk::Table for WoodenFishWorkProfileTableHandle<'ctx> { } } +impl<'ctx> __sdk::WithInsert for WoodenFishWorkProfileTableHandle<'ctx> { + type InsertCallbackId = WoodenFishWorkProfileInsertCallbackId; + + fn on_insert( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> WoodenFishWorkProfileInsertCallbackId { + WoodenFishWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback))) + } + + fn remove_on_insert(&self, callback: WoodenFishWorkProfileInsertCallbackId) { + self.imp.remove_on_insert(callback.0) + } +} + +impl<'ctx> __sdk::WithDelete for WoodenFishWorkProfileTableHandle<'ctx> { + type DeleteCallbackId = WoodenFishWorkProfileDeleteCallbackId; + + fn on_delete( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static, + ) -> WoodenFishWorkProfileDeleteCallbackId { + WoodenFishWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback))) + } + + fn remove_on_delete(&self, callback: WoodenFishWorkProfileDeleteCallbackId) { + self.imp.remove_on_delete(callback.0) + } +} + pub struct WoodenFishWorkProfileUpdateCallbackId(__sdk::CallbackId); impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishWorkProfileTableHandle<'ctx> { @@ -97,6 +151,21 @@ impl<'ctx> __sdk::TableWithPrimaryKey for WoodenFishWorkProfileTableHandle<'ctx> } } +impl<'ctx> __sdk::WithUpdate for WoodenFishWorkProfileTableHandle<'ctx> { + type UpdateCallbackId = WoodenFishWorkProfileUpdateCallbackId; + + fn on_update( + &self, + callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static, + ) -> WoodenFishWorkProfileUpdateCallbackId { + WoodenFishWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback))) + } + + fn remove_on_update(&self, callback: WoodenFishWorkProfileUpdateCallbackId) { + self.imp.remove_on_update(callback.0) + } +} + /// Access to the `profile_id` unique index on the table `wooden_fish_work_profile`, /// which allows point queries on the field of the same name /// via the [`WoodenFishWorkProfileProfileIdUnique::find`] method.