feat: add analytics date dimension bindings
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
- lock profile task tracking scope to user - add analytics date dimension module support and tests - regenerate SpacetimeDB Rust bindings with private APIs
This commit is contained in:
@@ -0,0 +1,724 @@
|
|||||||
|
# 埋点系统新增周、月、季、年维度映射表计划
|
||||||
|
|
||||||
|
## 目标
|
||||||
|
|
||||||
|
在 Genarrative 的埋点/统计系统中新增“周、月、季、年”维度映射表,让后续统计查询可以按不同时间粒度稳定聚合,而不是只依赖运行时临时计算日期范围。
|
||||||
|
|
||||||
|
本计划只做设计与落地步骤,不直接修改业务代码。
|
||||||
|
|
||||||
|
## 当前上下文与初步发现
|
||||||
|
|
||||||
|
1. 当前仓库根目录为 `/home/dsk/workspace/Genarrative`。
|
||||||
|
2. 远端更新后已定位到当前真实埋点/任务系统:
|
||||||
|
- 原始埋点表:`tracking_event`
|
||||||
|
- 日聚合投影表:`tracking_daily_stat`
|
||||||
|
- 任务配置表:`profile_task_config`
|
||||||
|
- 任务进度表:`profile_task_progress`
|
||||||
|
- 领奖记录表:`profile_task_reward_claim`
|
||||||
|
3. 相关文件:
|
||||||
|
- `server-rs/crates/spacetime-module/src/runtime/profile.rs`
|
||||||
|
- `server-rs/crates/module-runtime/src/domain.rs`
|
||||||
|
- `server-rs/crates/module-runtime/src/application.rs`
|
||||||
|
- `server-rs/crates/api-server/src/runtime_profile.rs`
|
||||||
|
- `apps/admin-web/src/pages/AdminTaskConfigPage.tsx`
|
||||||
|
- `apps/admin-web/src/api/adminApiTypes.ts`
|
||||||
|
- `apps/admin-web/src/config/trackingEventDefinitions.ts`
|
||||||
|
- `docs/technical/PROFILE_TASK_AND_TRACKING_SYSTEM_2026-05-03.md`
|
||||||
|
- `docs/tracking/TRACKING_QUERY_PLAYBOOK_2026-05-03.md`
|
||||||
|
4. 当前 `tracking_event` 是明细表,`tracking_daily_stat` 是统一日汇总表,不按范围拆表;它通过 `event_key + scope_kind + scope_id + day_key` 区分不同聚合桶。
|
||||||
|
5. 当前任务系统是“个人任务系统”,首版任务配置均面向用户维度;后台暴露“埋点范围”选择会导致运营误配。
|
||||||
|
6. 已决定采用任务配置方案 B:
|
||||||
|
- 后台任务配置不再让运营手动选择埋点范围。
|
||||||
|
- 后端个人任务配置统一限制为 `RuntimeTrackingScopeKind::User`。
|
||||||
|
- 若 API 收到非 `user` 的 `scopeKind`,应拒绝或兼容忽略但最终落库必须为 `User`;推荐直接拒绝并返回清晰错误。
|
||||||
|
7. 已发现一个需要纳入本计划修复的语义问题:`profile_task_tracking_scope_id` 里 `RuntimeTrackingScopeKind::Work` 当前返回 `user_id`,这不符合 work 维度语义。即使个人任务暂不支持 work,也应避免错误映射继续存在。
|
||||||
|
8. 当前日期桶使用北京时间自然日:`day_key = floor((occurred_at_micros + 8h) / 1d)`;周/月/季/年映射表应优先沿用这一业务日口径,除非产品另行确认。
|
||||||
|
9. 如果新增正式后端表,需要同步:
|
||||||
|
- 表定义
|
||||||
|
- reducer/procedure
|
||||||
|
- migration.rs
|
||||||
|
- 生成绑定
|
||||||
|
- spacetime-client facade
|
||||||
|
- shared-contracts / API DTO,如有接口暴露
|
||||||
|
|
||||||
|
## 关键假设
|
||||||
|
|
||||||
|
在未定位现有埋点模块前,先按以下假设规划:
|
||||||
|
|
||||||
|
1. 当前已有某种事件明细表或统计事实表,例如:
|
||||||
|
- `telemetry_event`
|
||||||
|
- `analytics_event`
|
||||||
|
- `metric_event`
|
||||||
|
- `narrative_telemetry`
|
||||||
|
- 或类似命名
|
||||||
|
2. 新增的“映射表”用于把具体日期或事件时间映射到时间维度 bucket。
|
||||||
|
3. 映射维度包括:
|
||||||
|
- 周:week
|
||||||
|
- 月:month
|
||||||
|
- 季:quarter
|
||||||
|
- 年:year
|
||||||
|
4. 已明确选择“一张通用日期维度映射表”方案:`analytics_date_dimension`。
|
||||||
|
5. 统计口径需要明确:
|
||||||
|
- 周从周一还是周日开始
|
||||||
|
- 是否使用 ISO week
|
||||||
|
- 季度是自然季度还是财务季度
|
||||||
|
- 时区使用 UTC 还是业务本地时区
|
||||||
|
|
||||||
|
## 推荐设计方向
|
||||||
|
|
||||||
|
### 方案 A:单一时间维度映射表,推荐
|
||||||
|
|
||||||
|
新增一张日历维度表,每一行对应一个自然日,并包含它归属的周、月、季、年。
|
||||||
|
|
||||||
|
表概念:
|
||||||
|
|
||||||
|
```text
|
||||||
|
analytics_date_dimension
|
||||||
|
```
|
||||||
|
|
||||||
|
建议字段:
|
||||||
|
|
||||||
|
```text
|
||||||
|
date_key string 例如 2026-05-04
|
||||||
|
calendar_date string 真实日期,按 YYYY-MM-DD 存储
|
||||||
|
weekday u8 1-7 或 0-6,需要统一约定
|
||||||
|
iso_week_key string 例如 2026-W19
|
||||||
|
week_start_date_key string 例如 2026-05-04
|
||||||
|
week_end_date_key string 例如 2026-05-10
|
||||||
|
month_key string 例如 2026-05
|
||||||
|
month_start_date_key string
|
||||||
|
month_end_date_key string
|
||||||
|
quarter_key string 例如 2026-Q2
|
||||||
|
year_key string 例如 2026
|
||||||
|
created_at timestamp/string
|
||||||
|
updated_at timestamp/string
|
||||||
|
```
|
||||||
|
|
||||||
|
优点:
|
||||||
|
|
||||||
|
- 一张表即可支持日、周、月、季、年映射。
|
||||||
|
- 便于后续新增半月、财年、节假日、自然周等维度。
|
||||||
|
- 查询逻辑简单:事件日期 join/date_key 映射到目标粒度。
|
||||||
|
- 数据量很小,按 20 年也只有约 7300 行。
|
||||||
|
|
||||||
|
缺点:
|
||||||
|
|
||||||
|
- 需要在事件时间写入或统计查询时把 timestamp 归一为 date_key。
|
||||||
|
- 如果要支持多时区,可能需要增加 timezone 字段或多套 calendar。
|
||||||
|
|
||||||
|
### 方案 B:四张独立映射表
|
||||||
|
|
||||||
|
分别新增:
|
||||||
|
|
||||||
|
```text
|
||||||
|
analytics_week_dimension
|
||||||
|
analytics_month_dimension
|
||||||
|
analytics_quarter_dimension
|
||||||
|
analytics_year_dimension
|
||||||
|
```
|
||||||
|
|
||||||
|
优点:
|
||||||
|
|
||||||
|
- 每个粒度表结构更纯粹。
|
||||||
|
- 查询时可以直接针对目标粒度表。
|
||||||
|
|
||||||
|
缺点:
|
||||||
|
|
||||||
|
- 表更多,维护复杂。
|
||||||
|
- 日期归属关系仍然需要额外处理。
|
||||||
|
- 容易出现周/月/季/年口径漂移。
|
||||||
|
|
||||||
|
### 最终选择
|
||||||
|
|
||||||
|
本计划采用方案 A:单一 `analytics_date_dimension` 日期维表,而不是四张独立映射表。
|
||||||
|
|
||||||
|
如业务未来明确要求“周、月、季、年各自有独立映射表”,也应优先在日期维表基础上派生视图或物化派生表,而不是一开始拆成四张重复表。
|
||||||
|
|
||||||
|
## 后端设计建议
|
||||||
|
|
||||||
|
### 1. 明确埋点领域归属
|
||||||
|
|
||||||
|
先定位现有埋点模块。如果没有独立模块,建议新增或归入:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/module-analytics/
|
||||||
|
```
|
||||||
|
|
||||||
|
或如果当前项目已有 telemetry 命名,则保持已有命名,例如:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/module-telemetry/
|
||||||
|
```
|
||||||
|
|
||||||
|
领域层职责:
|
||||||
|
|
||||||
|
- 时间粒度定义
|
||||||
|
- date_key/week_key/month_key/quarter_key/year_key 生成规则
|
||||||
|
- 时间维度校验
|
||||||
|
- 事件聚合查询输入的纯规则
|
||||||
|
|
||||||
|
不应包含:
|
||||||
|
|
||||||
|
- SpacetimeDB 表读写
|
||||||
|
- Axum handler
|
||||||
|
- HTTP response
|
||||||
|
|
||||||
|
### 2. SpacetimeDB 表设计
|
||||||
|
|
||||||
|
在 `spacetime-module` 中新增时间维度表。
|
||||||
|
|
||||||
|
建议表名:
|
||||||
|
|
||||||
|
```text
|
||||||
|
analytics_date_dimension
|
||||||
|
```
|
||||||
|
|
||||||
|
建议主键:
|
||||||
|
|
||||||
|
```text
|
||||||
|
date_key
|
||||||
|
```
|
||||||
|
|
||||||
|
建议索引:
|
||||||
|
|
||||||
|
```text
|
||||||
|
iso_week_key
|
||||||
|
month_key
|
||||||
|
quarter_key
|
||||||
|
year_key
|
||||||
|
```
|
||||||
|
|
||||||
|
如果 SpacetimeDB 表定义已有统一命名规范,应按现有规范命名。
|
||||||
|
|
||||||
|
### 3. 初始化/补全 reducer
|
||||||
|
|
||||||
|
新增 reducer 或内部 procedure,用于生成指定日期范围内的维度数据。
|
||||||
|
|
||||||
|
建议能力:
|
||||||
|
|
||||||
|
```text
|
||||||
|
seed_analytics_date_dimensions(start_date, end_date)
|
||||||
|
ensure_analytics_date_dimension_for_date(date_key)
|
||||||
|
ensure_analytics_date_dimensions_for_range(start_date, end_date)
|
||||||
|
```
|
||||||
|
|
||||||
|
设计原则:
|
||||||
|
|
||||||
|
- 可幂等执行。
|
||||||
|
- 已存在 date_key 时不重复插入。
|
||||||
|
- 支持一次补一段日期。
|
||||||
|
- 避免一次补太大范围导致事务过重。
|
||||||
|
- 生产环境建议按年份或月份分批。
|
||||||
|
|
||||||
|
### 4. 事件表和映射表关系
|
||||||
|
|
||||||
|
如果事件表目前只有 timestamp,建议新增或计算出:
|
||||||
|
|
||||||
|
```text
|
||||||
|
event_date_key
|
||||||
|
```
|
||||||
|
|
||||||
|
可选策略:
|
||||||
|
|
||||||
|
1. 写入事件时同步写 `event_date_key`。
|
||||||
|
2. 查询统计时从 timestamp 临时计算 date_key。
|
||||||
|
3. 后台迁移为历史事件补 `event_date_key`。
|
||||||
|
|
||||||
|
推荐:
|
||||||
|
|
||||||
|
- 新事件写入时保存 `event_date_key`。
|
||||||
|
- 历史事件通过批量迁移 reducer 分批补齐。
|
||||||
|
|
||||||
|
### 5. 聚合查询设计
|
||||||
|
|
||||||
|
支持按粒度查询时,API 或 facade 可以接收:
|
||||||
|
|
||||||
|
```text
|
||||||
|
granularity = day | week | month | quarter | year
|
||||||
|
start_date
|
||||||
|
end_date
|
||||||
|
metric/event_name
|
||||||
|
filters
|
||||||
|
```
|
||||||
|
|
||||||
|
内部根据粒度选择 bucket key:
|
||||||
|
|
||||||
|
```text
|
||||||
|
day -> date_key
|
||||||
|
week -> iso_week_key 或 week_key
|
||||||
|
month -> month_key
|
||||||
|
quarter -> quarter_key
|
||||||
|
year -> year_key
|
||||||
|
```
|
||||||
|
|
||||||
|
返回结构建议统一:
|
||||||
|
|
||||||
|
```text
|
||||||
|
bucket_key
|
||||||
|
bucket_label
|
||||||
|
bucket_start_date
|
||||||
|
bucket_end_date
|
||||||
|
value
|
||||||
|
```
|
||||||
|
|
||||||
|
## 可能涉及的文件
|
||||||
|
|
||||||
|
由于当前尚未定位明确埋点模块,以下是预计文件范围。
|
||||||
|
|
||||||
|
### 必查文件/目录
|
||||||
|
|
||||||
|
```text
|
||||||
|
./Genarrative/server-rs/crates/
|
||||||
|
./Genarrative/server-rs/crates/spacetime-module/src/
|
||||||
|
./Genarrative/server-rs/crates/spacetime-client/src/
|
||||||
|
./Genarrative/server-rs/crates/shared-contracts/src/
|
||||||
|
./Genarrative/server-rs/crates/api-server/src/
|
||||||
|
./Genarrative/packages/shared/src/contracts/
|
||||||
|
./Genarrative/src/services/
|
||||||
|
```
|
||||||
|
|
||||||
|
### 可能新增文件
|
||||||
|
|
||||||
|
如果采用 analytics 命名:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/module-analytics/src/domain.rs
|
||||||
|
server-rs/crates/module-analytics/src/commands.rs
|
||||||
|
server-rs/crates/module-analytics/src/application.rs
|
||||||
|
server-rs/crates/module-analytics/src/errors.rs
|
||||||
|
server-rs/crates/module-analytics/src/events.rs
|
||||||
|
server-rs/crates/shared-contracts/src/analytics.rs
|
||||||
|
server-rs/crates/spacetime-client/src/analytics.rs
|
||||||
|
server-rs/crates/api-server/src/analytics.rs
|
||||||
|
packages/shared/src/contracts/analytics.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
如果只是新增 SpacetimeDB 映射表且暂不暴露 API,则可能只需:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/spacetime-module/src/**
|
||||||
|
server-rs/crates/spacetime-module/src/migration.rs
|
||||||
|
server-rs/crates/spacetime-client/src/** # 如果查询会被 api-server 使用
|
||||||
|
```
|
||||||
|
|
||||||
|
## 详细实施步骤
|
||||||
|
|
||||||
|
### Step 1:复核现有埋点系统与任务配置链路
|
||||||
|
|
||||||
|
当前已定位真实链路,实施前再做一次只读复核,确认远端最新代码没有继续变化。
|
||||||
|
|
||||||
|
已知核心表:
|
||||||
|
|
||||||
|
```text
|
||||||
|
tracking_event # 原始埋点明细
|
||||||
|
tracking_daily_stat # 日聚合投影
|
||||||
|
profile_task_config # 个人任务配置
|
||||||
|
profile_task_progress # 个人任务进度
|
||||||
|
profile_task_reward_claim # 领奖记录
|
||||||
|
```
|
||||||
|
|
||||||
|
已知核心文件:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/spacetime-module/src/runtime/profile.rs
|
||||||
|
server-rs/crates/module-runtime/src/domain.rs
|
||||||
|
server-rs/crates/module-runtime/src/application.rs
|
||||||
|
server-rs/crates/api-server/src/runtime_profile.rs
|
||||||
|
apps/admin-web/src/pages/AdminTaskConfigPage.tsx
|
||||||
|
apps/admin-web/src/api/adminApiTypes.ts
|
||||||
|
apps/admin-web/src/config/trackingEventDefinitions.ts
|
||||||
|
docs/technical/PROFILE_TASK_AND_TRACKING_SYSTEM_2026-05-03.md
|
||||||
|
docs/tracking/TRACKING_QUERY_PLAYBOOK_2026-05-03.md
|
||||||
|
```
|
||||||
|
|
||||||
|
重点确认:
|
||||||
|
|
||||||
|
1. `tracking_event` 是否仍包含 `event_key/scope_kind/scope_id/day_key/user_id/occurred_at`。
|
||||||
|
2. `tracking_daily_stat` 是否仍按 `event_key + scope_kind + scope_id + day_key` 生成 `stat_id`。
|
||||||
|
3. `profile_task_config` 是否仍包含 `scope_kind` 和 `sort_order`。
|
||||||
|
4. 后台 `AdminTaskConfigPage` 是否仍暴露“埋点范围”下拉。
|
||||||
|
5. `profile_task_tracking_scope_id` 中 `Work => user_id` 的错误映射是否仍存在。
|
||||||
|
|
||||||
|
### Step 1.5:先收紧个人任务配置的埋点范围,采用方案 B
|
||||||
|
|
||||||
|
在做周/月/季/年维度映射前,先修正个人任务配置边界,避免后续在错误配置模型上继续扩展。
|
||||||
|
|
||||||
|
目标行为:
|
||||||
|
|
||||||
|
```text
|
||||||
|
个人任务配置只支持用户维度埋点。
|
||||||
|
后台页面不再展示“埋点范围”。
|
||||||
|
后端不允许 profile_task_config 被写入 site/work/module 维度。
|
||||||
|
```
|
||||||
|
|
||||||
|
建议实现:
|
||||||
|
|
||||||
|
1. 前端隐藏 `AdminTaskConfigPage` 的“埋点范围”选择。
|
||||||
|
- 文件:`apps/admin-web/src/pages/AdminTaskConfigPage.tsx`
|
||||||
|
- 移除或隐藏:`scopeKinds` 下拉 UI。
|
||||||
|
- 保存请求仍可兼容传 `scopeKind: 'user'`,避免一次性改动 API contract。
|
||||||
|
2. 后端 upsert 校验 `scopeKind` 必须为 `RuntimeTrackingScopeKind::User`。
|
||||||
|
- 文件:`server-rs/crates/api-server/src/runtime_profile.rs`
|
||||||
|
- 或更底层:`server-rs/crates/module-runtime/src/domain.rs` / `server-rs/crates/spacetime-module/src/runtime/profile.rs` 的输入构造函数。
|
||||||
|
- 推荐在领域输入构造处兜底校验,API 层返回清晰错误。
|
||||||
|
3. 若暂不改 API DTO,则保持字段存在但限定值只能是 `user`。
|
||||||
|
- 文件:`apps/admin-web/src/api/adminApiTypes.ts`
|
||||||
|
- `AdminUpsertProfileTaskConfigRequest.scopeKind` 可保留,前端固定传 `user`。
|
||||||
|
4. 更新后台埋点定义注册表的语义:
|
||||||
|
- 文件:`apps/admin-web/src/config/trackingEventDefinitions.ts`
|
||||||
|
- 当前每个 event definition 包含 `scopeKind`,如果个人任务统一 `user`,可以保留为只读内部默认值;但不要让运营在页面改。
|
||||||
|
5. 更新技术文档:
|
||||||
|
- `docs/technical/PROFILE_TASK_AND_TRACKING_SYSTEM_2026-05-03.md`
|
||||||
|
- 明确“个人任务首版只支持用户维度埋点,后台不开放 scope_kind 配置”。
|
||||||
|
|
||||||
|
验收:
|
||||||
|
|
||||||
|
```text
|
||||||
|
后台任务配置页不再出现“埋点范围”选择。
|
||||||
|
保存 daily_login 后落库 scope_kind 仍为 User。
|
||||||
|
直接调用后台 upsert 接口传 site/work/module 时被拒绝,或最终不会落库为非 User;推荐拒绝。
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 1.6:修复 Work 范围错误返回 user_id 的语义问题
|
||||||
|
|
||||||
|
当前函数:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/spacetime-module/src/runtime/profile.rs
|
||||||
|
profile_task_tracking_scope_id(user_id, config)
|
||||||
|
```
|
||||||
|
|
||||||
|
当前问题:
|
||||||
|
|
||||||
|
```rust
|
||||||
|
RuntimeTrackingScopeKind::Work => user_id.to_string()
|
||||||
|
```
|
||||||
|
|
||||||
|
这会把 work 维度错误映射为用户 ID。虽然个人任务将限制为 User,但保留这个分支会误导后续扩展。
|
||||||
|
|
||||||
|
推荐修复策略:
|
||||||
|
|
||||||
|
1. 对个人任务进度计算来说,`Work` 不应进入该函数。
|
||||||
|
2. 将 `profile_task_tracking_scope_id` 改为返回 `Result<String, String>` 或 `Option<String>`。
|
||||||
|
3. 对不支持的范围返回错误,而不是伪造 scope_id:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Site -> "site",如果个人任务仍不允许 site,则上游先拒绝
|
||||||
|
Module -> "profile",如果个人任务仍不允许 module,则上游先拒绝
|
||||||
|
User -> user_id
|
||||||
|
Work -> error: personal task progress does not support work scope without work_id
|
||||||
|
```
|
||||||
|
|
||||||
|
更严格的推荐:
|
||||||
|
|
||||||
|
```text
|
||||||
|
个人任务链路只接受 User。
|
||||||
|
Work/Site/Module 在 profile_task_progress_count 前就被拒绝。
|
||||||
|
profile_task_tracking_scope_id 只保留 User 分支,或者非 User 返回错误。
|
||||||
|
```
|
||||||
|
|
||||||
|
需要同步调整调用点:
|
||||||
|
|
||||||
|
```text
|
||||||
|
profile_task_progress_count
|
||||||
|
refresh_profile_task_progress
|
||||||
|
build_profile_task_center_snapshot
|
||||||
|
claim_profile_task_reward
|
||||||
|
```
|
||||||
|
|
||||||
|
避免因为函数返回 `Result` 后调用链未处理错误。
|
||||||
|
|
||||||
|
验收:
|
||||||
|
|
||||||
|
```text
|
||||||
|
不存在 Work => user_id 的映射。
|
||||||
|
个人任务配置非 User 时不会静默算出错误进度。
|
||||||
|
相关测试覆盖:User 正常;Work/Site/Module 被拒绝。
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 2:确定时间口径
|
||||||
|
|
||||||
|
必须先确认:
|
||||||
|
|
||||||
|
1. 周维度是否使用 ISO week。
|
||||||
|
2. 周开始日是周一还是周日。
|
||||||
|
3. 月/季/年是否按自然日历。
|
||||||
|
4. 统计时区是 UTC、服务器时区,还是用户本地时区。
|
||||||
|
5. 跨年周如何命名,例如 `2025-W01` 可能开始于 2024 年末。
|
||||||
|
|
||||||
|
推荐默认:
|
||||||
|
|
||||||
|
```text
|
||||||
|
时区:UTC,除非产品明确要求中国时区
|
||||||
|
周:ISO week,周一开始
|
||||||
|
月:自然月
|
||||||
|
季:自然季度
|
||||||
|
年:自然年
|
||||||
|
```
|
||||||
|
|
||||||
|
如果业务面向国内用户,建议考虑:
|
||||||
|
|
||||||
|
```text
|
||||||
|
时区:Asia/Shanghai
|
||||||
|
周:周一开始
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 3:设计 date dimension 表
|
||||||
|
|
||||||
|
设计字段和 key 格式,写入技术文档。
|
||||||
|
|
||||||
|
建议 key 格式:
|
||||||
|
|
||||||
|
```text
|
||||||
|
date_key: 2026-05-04
|
||||||
|
week_key: 2026-W19
|
||||||
|
month_key: 2026-05
|
||||||
|
quarter_key: 2026-Q2
|
||||||
|
year_key: 2026
|
||||||
|
```
|
||||||
|
|
||||||
|
注意:
|
||||||
|
|
||||||
|
- `week_key` 建议使用 ISO week-year,不一定等于 calendar year。
|
||||||
|
- `quarter_key` 使用 calendar year。
|
||||||
|
|
||||||
|
### Step 4:新增领域纯函数
|
||||||
|
|
||||||
|
在领域层或 shared-kernel 中实现纯函数:
|
||||||
|
|
||||||
|
```text
|
||||||
|
resolve_date_dimension(date, timezone) -> AnalyticsDateDimension
|
||||||
|
resolve_bucket_key(date_dimension, granularity) -> String
|
||||||
|
resolve_bucket_range(bucket_key, granularity) -> start/end date
|
||||||
|
```
|
||||||
|
|
||||||
|
要求:
|
||||||
|
|
||||||
|
- 有单元测试。
|
||||||
|
- 覆盖跨年周。
|
||||||
|
- 覆盖闰年 2 月。
|
||||||
|
- 覆盖季度边界。
|
||||||
|
|
||||||
|
### Step 5:新增 SpacetimeDB 表
|
||||||
|
|
||||||
|
在 `spacetime-module` 中新增表。
|
||||||
|
|
||||||
|
遵守约束:
|
||||||
|
|
||||||
|
- 新增表通常安全。
|
||||||
|
- 不修改已有表字段。
|
||||||
|
- 如果必须给已有事件表加 `event_date_key`,必须加在表定义末尾并提供 default。
|
||||||
|
- 若要补历史数据,使用 reducer 分批迁移。
|
||||||
|
|
||||||
|
### Step 6:新增 seed/ensure reducer
|
||||||
|
|
||||||
|
新增幂等 reducer:
|
||||||
|
|
||||||
|
```text
|
||||||
|
seed_analytics_date_dimensions(start_date, end_date)
|
||||||
|
ensure_analytics_date_dimension_for_date(date_key)
|
||||||
|
```
|
||||||
|
|
||||||
|
验证点:
|
||||||
|
|
||||||
|
- 重复执行不会重复插入。
|
||||||
|
- 日期范围非法时返回稳定错误。
|
||||||
|
- 单次范围过大时拒绝或分页。
|
||||||
|
|
||||||
|
### Step 7:接入事件写入链路
|
||||||
|
|
||||||
|
如果现有事件写入链路存在,新增:
|
||||||
|
|
||||||
|
```text
|
||||||
|
event_date_key
|
||||||
|
```
|
||||||
|
|
||||||
|
策略:
|
||||||
|
|
||||||
|
- 新事件写入时同步计算并保存。
|
||||||
|
- 写入前确保对应 date dimension 存在。
|
||||||
|
- 历史事件通过迁移 reducer 补齐。
|
||||||
|
|
||||||
|
如果暂不改事件表,也可以在查询阶段临时映射,但性能和一致性较差。
|
||||||
|
|
||||||
|
### Step 8:接入聚合查询
|
||||||
|
|
||||||
|
如已有统计接口,扩展请求参数:
|
||||||
|
|
||||||
|
```text
|
||||||
|
granularity: day | week | month | quarter | year
|
||||||
|
```
|
||||||
|
|
||||||
|
查询逻辑改为:
|
||||||
|
|
||||||
|
```text
|
||||||
|
事件/事实表
|
||||||
|
→ event_date_key
|
||||||
|
→ analytics_date_dimension
|
||||||
|
→ 取对应 bucket key
|
||||||
|
→ group by bucket key
|
||||||
|
```
|
||||||
|
|
||||||
|
返回 bucket 时包含:
|
||||||
|
|
||||||
|
```text
|
||||||
|
bucket_key
|
||||||
|
bucket_start_date
|
||||||
|
bucket_end_date
|
||||||
|
value
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 9:补 shared contracts 和前端 contracts
|
||||||
|
|
||||||
|
如果有 API 暴露,需要补:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/shared-contracts/src/analytics.rs
|
||||||
|
packages/shared/src/contracts/analytics.ts
|
||||||
|
```
|
||||||
|
|
||||||
|
建议 DTO:
|
||||||
|
|
||||||
|
```text
|
||||||
|
AnalyticsGranularity = day | week | month | quarter | year
|
||||||
|
AnalyticsBucketMetric
|
||||||
|
AnalyticsMetricQueryRequest
|
||||||
|
AnalyticsMetricQueryResponse
|
||||||
|
```
|
||||||
|
|
||||||
|
### Step 10:补测试
|
||||||
|
|
||||||
|
测试范围:
|
||||||
|
|
||||||
|
1. 领域日期映射测试
|
||||||
|
2. SpacetimeDB reducer 幂等测试
|
||||||
|
3. API 查询维度测试
|
||||||
|
4. 历史事件迁移测试,如涉及
|
||||||
|
5. 跨边界日期测试
|
||||||
|
6. 个人任务配置 scope 限制测试
|
||||||
|
7. `Work => user_id` 错误映射回归测试
|
||||||
|
|
||||||
|
重点用例:
|
||||||
|
|
||||||
|
```text
|
||||||
|
2024-02-29 闰年
|
||||||
|
2025-12-29 ISO week 可能属于 2026-W01
|
||||||
|
2026-01-01 跨年周
|
||||||
|
2026-03-31 Q1 结束
|
||||||
|
2026-04-01 Q2 开始
|
||||||
|
2026-12-31 年末
|
||||||
|
```
|
||||||
|
|
||||||
|
任务配置重点用例:
|
||||||
|
|
||||||
|
```text
|
||||||
|
admin upsert daily_login + scopeKind=user -> 成功
|
||||||
|
admin upsert daily_login + scopeKind=site -> 失败,错误信息说明个人任务仅支持 user
|
||||||
|
admin upsert daily_login + scopeKind=module -> 失败
|
||||||
|
admin upsert daily_login + scopeKind=work -> 失败
|
||||||
|
任务中心读取 daily_login -> 按 User + 当前 user_id 查询进度
|
||||||
|
代码中不存在 Work => user_id 的静默映射
|
||||||
|
```
|
||||||
|
|
||||||
|
## 测试与验证命令
|
||||||
|
|
||||||
|
具体命令需在定位模块后确认。初步建议:
|
||||||
|
|
||||||
|
```text
|
||||||
|
npm run typecheck
|
||||||
|
npm test
|
||||||
|
```
|
||||||
|
|
||||||
|
后端如涉及 Rust:
|
||||||
|
|
||||||
|
```text
|
||||||
|
cargo test -p module-analytics
|
||||||
|
cargo test -p spacetime-module
|
||||||
|
cargo test -p api-server
|
||||||
|
```
|
||||||
|
|
||||||
|
涉及 API smoke:
|
||||||
|
|
||||||
|
```text
|
||||||
|
npm run api-server
|
||||||
|
```
|
||||||
|
|
||||||
|
然后验证:
|
||||||
|
|
||||||
|
```text
|
||||||
|
GET /healthz
|
||||||
|
```
|
||||||
|
|
||||||
|
涉及 SpacetimeDB schema:
|
||||||
|
|
||||||
|
- 需要生成绑定。
|
||||||
|
- 需要确认 migration.rs 对齐。
|
||||||
|
- 需要确认 publish 不触发不安全 schema 变更。
|
||||||
|
|
||||||
|
## 风险与权衡
|
||||||
|
|
||||||
|
### 风险 1:个人任务 scope_kind 被误配置导致进度异常
|
||||||
|
|
||||||
|
当前个人任务系统本质上按用户维度计算进度。如果允许运营配置 `site/work/module`,可能导致任务进度查错 `tracking_daily_stat` 聚合桶,出现任务永远不可领取或错误可领取。
|
||||||
|
|
||||||
|
缓解:
|
||||||
|
|
||||||
|
```text
|
||||||
|
采用方案 B:后台隐藏埋点范围,后端限制个人任务配置只能写入 User。
|
||||||
|
```
|
||||||
|
|
||||||
|
### 风险 2:Work 维度缺少 work_id,上游却静默用 user_id 代替
|
||||||
|
|
||||||
|
当前 `profile_task_tracking_scope_id` 中 `Work => user_id` 是错误语义。若后续扩展作品任务,会把作品维度统计错误映射到用户维度。
|
||||||
|
|
||||||
|
缓解:
|
||||||
|
|
||||||
|
```text
|
||||||
|
移除 Work => user_id 映射;非 User 的个人任务配置应被拒绝。未来做作品任务时新增明确 work_id 来源和任务类型。
|
||||||
|
```
|
||||||
|
|
||||||
|
### 风险 3:时区口径影响统计结果
|
||||||
|
|
||||||
|
周/月/季/年映射对时区敏感。当前日桶使用北京时间自然日:`floor((occurred_at_micros + 8h) / 1d)`。新增映射表应明确沿用北京时间业务日,还是切换为 UTC/用户本地时区。
|
||||||
|
|
||||||
|
### 风险 4:ISO week 跨年
|
||||||
|
|
||||||
|
ISO week-year 与自然年不同。若前端展示按自然年理解,可能产生认知差异。
|
||||||
|
|
||||||
|
### 风险 5:修改已有事件表可能触发 SpacetimeDB 迁移限制
|
||||||
|
|
||||||
|
如果已有事件表需要新增字段:
|
||||||
|
|
||||||
|
- 字段必须加末尾。
|
||||||
|
- 必须提供 default。
|
||||||
|
- 历史数据要分批迁移。
|
||||||
|
|
||||||
|
### 风险 5:表设计过早绑定单一业务
|
||||||
|
|
||||||
|
建议用通用 date dimension,而不是为某个单一埋点写死周/月/季/年表,避免后续复用困难。
|
||||||
|
|
||||||
|
## 待确认问题
|
||||||
|
|
||||||
|
1. 周维度使用 ISO week 还是自然周?周一开始还是周日开始?
|
||||||
|
2. 周/月/季/年映射是否沿用当前北京时间业务日口径?
|
||||||
|
3. 这个映射表服务的是所有埋点,还是只服务个人任务/运营后台统计?
|
||||||
|
4. 是否需要 API 暴露这些映射关系,还是只用于后端聚合?
|
||||||
|
5. 是否需要回填历史事件?历史数据规模多大?
|
||||||
|
6. 未来是否会存在非个人任务,例如整站任务、模块任务、作品任务?如果会,应另行设计任务类型和 `scope_id` 来源,不应复用当前个人任务配置页直接开放 scope。
|
||||||
|
|
||||||
|
## 建议结论
|
||||||
|
|
||||||
|
优先采用“一张通用日期维度映射表”的设计:
|
||||||
|
|
||||||
|
```text
|
||||||
|
analytics_date_dimension
|
||||||
|
```
|
||||||
|
|
||||||
|
通过字段同时提供:
|
||||||
|
|
||||||
|
```text
|
||||||
|
day / week / month / quarter / year
|
||||||
|
```
|
||||||
|
|
||||||
|
后续统计按 `granularity` 选择 bucket key 聚合。这样比直接新增四张独立映射表更稳定、更容易复用,也更容易处理跨年周、季度边界和历史回填。
|
||||||
20
docs/experience/ADMIN_TASK_CONFIG_SCOPE_LOCK_2026-05-04.md
Normal file
20
docs/experience/ADMIN_TASK_CONFIG_SCOPE_LOCK_2026-05-04.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# AdminTaskConfigPage 埋点范围收口记录(2026-05-04)
|
||||||
|
|
||||||
|
## 变更目标
|
||||||
|
- 前端隐藏「埋点范围」选择项。
|
||||||
|
- 保存任务配置时固定传递 `scopeKind=user`,避免运营在后台选择其他范围。
|
||||||
|
|
||||||
|
## 落地结果
|
||||||
|
- `apps/admin-web/src/pages/AdminTaskConfigPage.tsx`
|
||||||
|
- 移除了「埋点范围」下拉选择 UI。
|
||||||
|
- 保存时改为固定提交 `scopeKind: 'user'`。
|
||||||
|
- 回填表单时不再读取或维护 `scopeKind` 的可编辑状态。
|
||||||
|
|
||||||
|
## 验证结果
|
||||||
|
- 已检查页面源码,确认不再存在「埋点范围」字段与可编辑逻辑。
|
||||||
|
- 已执行 `npm run admin-web:typecheck`。
|
||||||
|
- 当前验证失败原因为环境缺少 `node_modules/typescript/bin/tsc`,属于依赖安装状态问题,不是本次前端改动引入的代码错误。
|
||||||
|
|
||||||
|
## 遗留说明
|
||||||
|
- `apps/admin-web/src/api/adminApiTypes.ts` 中仍保留 `TrackingScopeKind` 类型,供接口契约与其他前端模块兼容使用。
|
||||||
|
- `apps/admin-web/src/config/trackingEventDefinitions.ts` 仍保留事件定义中的 `scopeKind` 元数据,但页面不再允许运营修改。
|
||||||
@@ -0,0 +1,288 @@
|
|||||||
|
# Analytics Date Dimension 与个人任务埋点范围收口记录(2026-05-04)
|
||||||
|
|
||||||
|
## 背景
|
||||||
|
|
||||||
|
本记录用于收口 `.hermes/plans/2026-05-04_022223-analytics-time-dimension-mapping.md` 中当前阶段已经落地的内容,并明确尚未执行的后续范围。
|
||||||
|
|
||||||
|
本阶段目标不是完整上线运营统计查询,而是先完成两件基础工作:
|
||||||
|
|
||||||
|
1. 收紧个人任务系统的埋点范围,避免运营或接口把个人任务错误配置为 `site`、`module`、`work` 等非用户维度。
|
||||||
|
2. 新增统一日期维表 `analytics_date_dimension`,为后续按周、月、季、年聚合埋点数据提供稳定的日期 bucket 映射。
|
||||||
|
|
||||||
|
## 当前已完成范围
|
||||||
|
|
||||||
|
### 1. 个人任务埋点范围锁定为 User
|
||||||
|
|
||||||
|
当前个人任务系统首版只支持用户维度埋点。
|
||||||
|
|
||||||
|
已完成:
|
||||||
|
|
||||||
|
- Admin 任务配置页不再展示“埋点范围”选择。
|
||||||
|
- Admin 保存任务配置时固定传 `scopeKind: 'user'`。
|
||||||
|
- API 层拒绝非 `user` 的个人任务配置。
|
||||||
|
- 领域输入构造层拒绝非 `User` 的个人任务配置。
|
||||||
|
- `Work => user_id` 的错误映射已移除。
|
||||||
|
- 任务进度刷新、任务中心快照、领奖链路遇到非 `User` 的异常个人任务配置时显式报错,不再静默按 0 进度处理。
|
||||||
|
|
||||||
|
相关文件:
|
||||||
|
|
||||||
|
```text
|
||||||
|
apps/admin-web/src/pages/AdminTaskConfigPage.tsx
|
||||||
|
apps/admin-web/src/api/adminApiTypes.ts
|
||||||
|
server-rs/crates/api-server/src/runtime_profile.rs
|
||||||
|
server-rs/crates/module-runtime/src/commands.rs
|
||||||
|
server-rs/crates/module-runtime/src/errors.rs
|
||||||
|
server-rs/crates/spacetime-module/src/runtime/profile.rs
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 日期维表领域模型与纯函数
|
||||||
|
|
||||||
|
已在 `module-runtime` 中补充日期维表快照和纯函数。
|
||||||
|
|
||||||
|
日期维表使用现有北京时间业务日 `day_key` 语义:
|
||||||
|
|
||||||
|
```text
|
||||||
|
date_key = floor((occurred_at_micros + 8h) / 1d)
|
||||||
|
```
|
||||||
|
|
||||||
|
已完成能力:
|
||||||
|
|
||||||
|
- 从 `YYYY-MM-DD` 解析业务日 `date_key`。
|
||||||
|
- 从 `date_key` 构造日期维表快照。
|
||||||
|
- 生成 ISO weekday:周一=1,周日=7。
|
||||||
|
- 生成 ISO week key:`YYYYWW`,跨年周按 ISO week-year。
|
||||||
|
- 生成 week/month/quarter/year 的 key 和起止 `date_key`。
|
||||||
|
- 限制日期维表支持范围为:
|
||||||
|
- `2000-01-01`
|
||||||
|
- 到 `2100-12-31`
|
||||||
|
|
||||||
|
相关文件:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/module-runtime/src/domain.rs
|
||||||
|
server-rs/crates/module-runtime/src/application.rs
|
||||||
|
server-rs/crates/module-runtime/src/lib.rs
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. SpacetimeDB 日期维表与 reducer
|
||||||
|
|
||||||
|
已新增 SpacetimeDB 表:
|
||||||
|
|
||||||
|
```text
|
||||||
|
analytics_date_dimension
|
||||||
|
```
|
||||||
|
|
||||||
|
表字段包括:
|
||||||
|
|
||||||
|
```text
|
||||||
|
date_key
|
||||||
|
calendar_date
|
||||||
|
weekday
|
||||||
|
iso_week_key
|
||||||
|
week_start_date_key
|
||||||
|
week_end_date_key
|
||||||
|
month_key
|
||||||
|
month_start_date_key
|
||||||
|
month_end_date_key
|
||||||
|
quarter_key
|
||||||
|
quarter_start_date_key
|
||||||
|
quarter_end_date_key
|
||||||
|
year_key
|
||||||
|
year_start_date_key
|
||||||
|
year_end_date_key
|
||||||
|
created_at
|
||||||
|
updated_at
|
||||||
|
```
|
||||||
|
|
||||||
|
已新增索引:
|
||||||
|
|
||||||
|
```text
|
||||||
|
iso_week_key
|
||||||
|
month_key
|
||||||
|
quarter_key
|
||||||
|
year_key
|
||||||
|
```
|
||||||
|
|
||||||
|
已新增 reducer:
|
||||||
|
|
||||||
|
```text
|
||||||
|
ensure_analytics_date_dimension_for_date
|
||||||
|
seed_analytics_date_dimensions
|
||||||
|
```
|
||||||
|
|
||||||
|
当前 reducer 行为:
|
||||||
|
|
||||||
|
- `ensure` 单日幂等补齐。
|
||||||
|
- `seed` 按日期范围幂等补齐。
|
||||||
|
- `seed` 拒绝 `start_date > end_date`。
|
||||||
|
- `seed` 单次最多允许 `ANALYTICS_DATE_DIMENSION_MAX_SEED_DAYS = 3660` 天。
|
||||||
|
- 裸 `date_key` 进入 ensure 前先做支持范围校验,避免极端整数进入日历算法。
|
||||||
|
|
||||||
|
相关文件:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/spacetime-module/src/runtime/analytics_date_dimension.rs
|
||||||
|
server-rs/crates/spacetime-module/src/runtime/mod.rs
|
||||||
|
server-rs/crates/spacetime-module/src/migration.rs
|
||||||
|
docs/technical/SPACETIMEDB_TABLE_CATALOG.md
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. SpacetimeDB Rust client bindings
|
||||||
|
|
||||||
|
已按项目脚本生成 Rust bindings,并在生成参数中显式包含 private tables/functions:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
PATH="/tmp/spacetime-bin:$PATH" npm run spacetime:generate -- --rust-only
|
||||||
|
```
|
||||||
|
|
||||||
|
本次已修改生成脚本:
|
||||||
|
|
||||||
|
```text
|
||||||
|
scripts/generate-spacetime-bindings.mjs
|
||||||
|
```
|
||||||
|
|
||||||
|
在 `spacetime generate` 参数中加入:
|
||||||
|
|
||||||
|
```text
|
||||||
|
--include-private
|
||||||
|
```
|
||||||
|
|
||||||
|
说明:SpacetimeDB CLI 2.1.0 的参数名是 `--include-private`,不是 `--non-private`。该参数含义是将 private tables/functions 也包含进生成代码,满足 api-server 通过 Rust bindings 访问 module private table/reducer 的需求。
|
||||||
|
|
||||||
|
```text
|
||||||
|
spacetimedb tool version 2.1.0; spacetimedb-lib version 2.1.0
|
||||||
|
```
|
||||||
|
|
||||||
|
生成脚本:
|
||||||
|
|
||||||
|
```text
|
||||||
|
scripts/generate-spacetime-bindings.mjs
|
||||||
|
```
|
||||||
|
|
||||||
|
已新增 analytics date dimension 相关 bindings:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_ensure_input_type.rs
|
||||||
|
server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_seed_input_type.rs
|
||||||
|
server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_type.rs
|
||||||
|
server-rs/crates/spacetime-client/src/module_bindings/analytics_date_dimension_table.rs
|
||||||
|
server-rs/crates/spacetime-client/src/module_bindings/ensure_analytics_date_dimension_for_date_reducer.rs
|
||||||
|
server-rs/crates/spacetime-client/src/module_bindings/seed_analytics_date_dimensions_reducer.rs
|
||||||
|
```
|
||||||
|
|
||||||
|
并更新了:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/spacetime-client/src/module_bindings/mod.rs
|
||||||
|
```
|
||||||
|
|
||||||
|
注意:
|
||||||
|
|
||||||
|
- `analytics_date_dimension` 表当前是 private table;由于生成脚本已加 `--include-private`,本次 codegen 已生成 `analytics_date_dimension_table.rs`,可通过 `ctx.db.analytics_date_dimension()` 访问 client cache / query builder。
|
||||||
|
- bindings 目录是自动生成产物,本次以项目脚本整体刷新,除新增 analytics 文件外,也带来了大量已存在 table/reducer/procedure 文件的格式化/生成器输出差异。
|
||||||
|
|
||||||
|
### 5. 测试覆盖
|
||||||
|
|
||||||
|
已新增测试:
|
||||||
|
|
||||||
|
```text
|
||||||
|
server-rs/crates/module-runtime/tests/analytics_date_dimension.rs
|
||||||
|
server-rs/crates/module-runtime/tests/profile_task_scope.rs
|
||||||
|
server-rs/crates/shared-contracts/tests/profile_task_contract.rs
|
||||||
|
```
|
||||||
|
|
||||||
|
覆盖重点:
|
||||||
|
|
||||||
|
- `2024-02-29` 闰年。
|
||||||
|
- `2025-12-29` ISO week 跨年。
|
||||||
|
- `2026-01-01` 跨年周。
|
||||||
|
- `2026-03-31` Q1 结束。
|
||||||
|
- `2026-04-01` Q2 开始。
|
||||||
|
- `2026-12-31` 年末。
|
||||||
|
- 非法日期解析失败。
|
||||||
|
- 超出日期维表支持范围失败。
|
||||||
|
- 个人任务 `scopeKind=user` 成功。
|
||||||
|
- 个人任务 `scopeKind=site/module/work` 失败。
|
||||||
|
- `work` scope 不会静默映射到 `user_id`。
|
||||||
|
- Admin 个人任务配置 contract 保持 `scopeKind: user`。
|
||||||
|
|
||||||
|
## 已验证命令
|
||||||
|
|
||||||
|
从 `server-rs/` 执行:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cargo fmt -p module-runtime -p spacetime-module -p spacetime-client
|
||||||
|
cargo test -p spacetime-client --no-run
|
||||||
|
cargo test -p spacetime-module --no-run
|
||||||
|
cargo test -p module-runtime --test analytics_date_dimension
|
||||||
|
cargo test -p module-runtime --test profile_task_scope
|
||||||
|
cargo test -p shared-contracts --test profile_task_contract
|
||||||
|
```
|
||||||
|
|
||||||
|
从项目根目录执行:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run admin-web:typecheck
|
||||||
|
```
|
||||||
|
|
||||||
|
当前结果:
|
||||||
|
|
||||||
|
- `spacetime-client --no-run` 编译通过。
|
||||||
|
- `spacetime-module --no-run` 编译通过。
|
||||||
|
- `analytics_date_dimension` 测试通过:8 passed。
|
||||||
|
- `profile_task_scope` 测试通过:3 passed。
|
||||||
|
- `profile_task_contract` 测试通过:2 passed。
|
||||||
|
- `admin-web:typecheck` 通过。
|
||||||
|
|
||||||
|
已知非本阶段阻塞:
|
||||||
|
|
||||||
|
- 完整运行 `cargo test -p spacetime-module` 时,曾出现既有 puzzle 测试失败:
|
||||||
|
|
||||||
|
```text
|
||||||
|
puzzle::tests::puzzle_preview_is_publishable_with_complete_draft FAILED
|
||||||
|
assertion failed: preview.publish_ready
|
||||||
|
```
|
||||||
|
|
||||||
|
该失败与当前埋点范围和日期维表改动无直接关系,本阶段以 `cargo test -p spacetime-module --no-run` 作为编译门禁。
|
||||||
|
|
||||||
|
## 当前未完成 / 暂缓项
|
||||||
|
|
||||||
|
### 1. 暂未新增 spacetime-client facade
|
||||||
|
|
||||||
|
当前没有新增:
|
||||||
|
|
||||||
|
```text
|
||||||
|
SpacetimeClient::ensure_analytics_date_dimension_for_date
|
||||||
|
SpacetimeClient::seed_analytics_date_dimensions
|
||||||
|
```
|
||||||
|
|
||||||
|
原因:
|
||||||
|
|
||||||
|
- 生成脚本已加入 `--include-private`,private reducer/type/table bindings 已可用于后续 facade 实现。
|
||||||
|
- 但 Step 7/8/9 暂缓,尚未由 `api-server` 或统计查询链路调用该能力。
|
||||||
|
- 如后续只是 SpacetimeDB module 内部写入统计时 ensure,可以直接复用 module 内部 helper,不一定需要远程 client facade。
|
||||||
|
- 若后续需要由 API 或运维接口触发 seed/ensure,可基于本次已生成的 reducer bindings 再补 facade。
|
||||||
|
|
||||||
|
### 2. Step 7/8/9 暂缓
|
||||||
|
|
||||||
|
本阶段未接入:
|
||||||
|
|
||||||
|
- 事件写入链路自动 ensure 日期维表。
|
||||||
|
- 聚合查询 API 的 `granularity = day | week | month | quarter | year`。
|
||||||
|
- shared contracts / 前端 analytics contracts。
|
||||||
|
- 历史事件回填。
|
||||||
|
|
||||||
|
这些应作为后续阶段单独设计和落地。
|
||||||
|
|
||||||
|
## 后续建议顺序
|
||||||
|
|
||||||
|
1. 如需提交本阶段改动,确认是否接受 `module_bindings` 整体刷新带来的大量生成文件 diff。
|
||||||
|
2. 如希望 diff 更小,可评估仅提交 analytics date dimension 相关生成文件与 `mod.rs`;但需要非常谨慎,因为 `module_bindings` 是自动生成产物。
|
||||||
|
3. 如需要由 `api-server` 触发 seed/ensure,再补 `spacetime-client` facade。
|
||||||
|
4. 进入 Step 7/8/9:事件写入链路、聚合查询 API、前端 contracts。
|
||||||
|
|
||||||
|
## 阶段结论
|
||||||
|
|
||||||
|
当前阶段已经完成“个人任务埋点范围收紧”和“日期维表 module 侧能力”的核心落地,并已生成 SpacetimeDB Rust client bindings。
|
||||||
|
|
||||||
|
剩余工作不再是 bindings 环境阻塞,而是后续业务接入范围:是否增加 `spacetime-client` facade,以及是否继续推进事件写入链路、聚合查询 API 和前端 analytics contracts。
|
||||||
18
docs/technical/RUNTIME_PROFILE_TASK_SCOPE_2026-05-04.md
Normal file
18
docs/technical/RUNTIME_PROFILE_TASK_SCOPE_2026-05-04.md
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# 个人任务 scope 限制说明(2026-05-04)
|
||||||
|
|
||||||
|
## 背景
|
||||||
|
|
||||||
|
个人任务配置首版只支持按用户维度统计进度,即 `RuntimeTrackingScopeKind::User` / API `scopeKind: "user"`。`site`、`module`、`work` 未来可作为全站、模块或作品维度任务扩展,但当前不应被个人任务配置接受。
|
||||||
|
|
||||||
|
## 后端约束
|
||||||
|
|
||||||
|
- HTTP 管理接口 `admin_upsert_profile_task_config` 在解析 `scopeKind` 后立即校验:非 `user` 返回 400,并提示“个人任务 scopeKind 首版仅支持 user”。
|
||||||
|
- 领域构造函数 `build_runtime_profile_task_config_admin_upsert_input` 兜底校验:非 `RuntimeTrackingScopeKind::User` 返回 `RuntimeProfileFieldError::UnsupportedProfileTaskScopeKind`。
|
||||||
|
- SpacetimeDB 模块内 `profile_task_tracking_scope_id` 不再把 `Work` 静默映射到 `user_id`;非 User scope 返回 `None`,个人任务进度读取按 0 处理,避免错误串桶。
|
||||||
|
|
||||||
|
## 测试覆盖
|
||||||
|
|
||||||
|
`module-runtime` 单元测试覆盖:
|
||||||
|
|
||||||
|
- `User` scope 可成功构造个人任务配置输入。
|
||||||
|
- `Site` / `Module` / `Work` scope 均被拒绝,错误为 `UnsupportedProfileTaskScopeKind`。
|
||||||
@@ -142,6 +142,7 @@ function buildGenerateArgs(target, outDir) {
|
|||||||
outDir,
|
outDir,
|
||||||
'--module-path',
|
'--module-path',
|
||||||
MODULE_PATH,
|
MODULE_PATH,
|
||||||
|
'--include-private',
|
||||||
'--yes',
|
'--yes',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,148 @@
|
|||||||
|
use module_runtime::{
|
||||||
|
AnalyticsDateDimensionSnapshot, RuntimeProfileFieldError,
|
||||||
|
build_analytics_date_dimension_from_date_key, parse_analytics_calendar_date_key,
|
||||||
|
validate_analytics_date_dimension_date_key,
|
||||||
|
};
|
||||||
|
|
||||||
|
fn dimension(calendar_date: &str) -> AnalyticsDateDimensionSnapshot {
|
||||||
|
let date_key = parse_analytics_calendar_date_key(calendar_date).expect("日期应可解析");
|
||||||
|
build_analytics_date_dimension_from_date_key(date_key)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn date_key(calendar_date: &str) -> i64 {
|
||||||
|
parse_analytics_calendar_date_key(calendar_date).expect("日期应可解析")
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn analytics_date_dimension_handles_leap_day() {
|
||||||
|
// 中文注释:2024 是闰年,2 月应包含 29 日且属于 ISO 第 9 周。
|
||||||
|
let snapshot = dimension("2024-02-29");
|
||||||
|
|
||||||
|
assert_eq!(snapshot.calendar_date, "2024-02-29");
|
||||||
|
assert_eq!(snapshot.weekday, 4);
|
||||||
|
assert_eq!(snapshot.iso_week_key, 202409);
|
||||||
|
assert_eq!(snapshot.week_start_date_key, date_key("2024-02-26"));
|
||||||
|
assert_eq!(snapshot.week_end_date_key, date_key("2024-03-03"));
|
||||||
|
assert_eq!(snapshot.month_key, 202402);
|
||||||
|
assert_eq!(snapshot.month_start_date_key, date_key("2024-02-01"));
|
||||||
|
assert_eq!(snapshot.month_end_date_key, date_key("2024-02-29"));
|
||||||
|
assert_eq!(snapshot.quarter_key, 20241);
|
||||||
|
assert_eq!(snapshot.year_key, 2024);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn analytics_date_dimension_uses_iso_week_year_across_year_boundary() {
|
||||||
|
// 中文注释:2025-12-29 是周一,但 ISO week-year 已经进入 2026-W01。
|
||||||
|
let snapshot = dimension("2025-12-29");
|
||||||
|
|
||||||
|
assert_eq!(snapshot.calendar_date, "2025-12-29");
|
||||||
|
assert_eq!(snapshot.weekday, 1);
|
||||||
|
assert_eq!(snapshot.iso_week_key, 202601);
|
||||||
|
assert_eq!(snapshot.week_start_date_key, date_key("2025-12-29"));
|
||||||
|
assert_eq!(snapshot.week_end_date_key, date_key("2026-01-04"));
|
||||||
|
assert_eq!(snapshot.month_key, 202512);
|
||||||
|
assert_eq!(snapshot.quarter_key, 20254);
|
||||||
|
assert_eq!(snapshot.year_key, 2025);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn analytics_date_dimension_handles_new_year_inside_iso_week() {
|
||||||
|
// 中文注释:2026-01-01 仍落在 2026-W01,周范围跨自然年。
|
||||||
|
let snapshot = dimension("2026-01-01");
|
||||||
|
|
||||||
|
assert_eq!(snapshot.calendar_date, "2026-01-01");
|
||||||
|
assert_eq!(snapshot.weekday, 4);
|
||||||
|
assert_eq!(snapshot.iso_week_key, 202601);
|
||||||
|
assert_eq!(snapshot.week_start_date_key, date_key("2025-12-29"));
|
||||||
|
assert_eq!(snapshot.week_end_date_key, date_key("2026-01-04"));
|
||||||
|
assert_eq!(snapshot.month_key, 202601);
|
||||||
|
assert_eq!(snapshot.month_start_date_key, date_key("2026-01-01"));
|
||||||
|
assert_eq!(snapshot.month_end_date_key, date_key("2026-01-31"));
|
||||||
|
assert_eq!(snapshot.quarter_key, 20261);
|
||||||
|
assert_eq!(snapshot.year_key, 2026);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn analytics_date_dimension_handles_q1_end() {
|
||||||
|
// 中文注释:Q1 结束日应映射到 2026Q1,季度边界为 1 月 1 日到 3 月 31 日。
|
||||||
|
let snapshot = dimension("2026-03-31");
|
||||||
|
|
||||||
|
assert_eq!(snapshot.calendar_date, "2026-03-31");
|
||||||
|
assert_eq!(snapshot.weekday, 2);
|
||||||
|
assert_eq!(snapshot.iso_week_key, 202614);
|
||||||
|
assert_eq!(snapshot.month_key, 202603);
|
||||||
|
assert_eq!(snapshot.month_start_date_key, date_key("2026-03-01"));
|
||||||
|
assert_eq!(snapshot.month_end_date_key, date_key("2026-03-31"));
|
||||||
|
assert_eq!(snapshot.quarter_key, 20261);
|
||||||
|
assert_eq!(snapshot.quarter_start_date_key, date_key("2026-01-01"));
|
||||||
|
assert_eq!(snapshot.quarter_end_date_key, date_key("2026-03-31"));
|
||||||
|
assert_eq!(snapshot.year_key, 2026);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn analytics_date_dimension_handles_q2_start() {
|
||||||
|
// 中文注释:Q2 开始日应映射到 2026Q2,季度边界为 4 月 1 日到 6 月 30 日。
|
||||||
|
let snapshot = dimension("2026-04-01");
|
||||||
|
|
||||||
|
assert_eq!(snapshot.calendar_date, "2026-04-01");
|
||||||
|
assert_eq!(snapshot.weekday, 3);
|
||||||
|
assert_eq!(snapshot.iso_week_key, 202614);
|
||||||
|
assert_eq!(snapshot.month_key, 202604);
|
||||||
|
assert_eq!(snapshot.month_start_date_key, date_key("2026-04-01"));
|
||||||
|
assert_eq!(snapshot.month_end_date_key, date_key("2026-04-30"));
|
||||||
|
assert_eq!(snapshot.quarter_key, 20262);
|
||||||
|
assert_eq!(snapshot.quarter_start_date_key, date_key("2026-04-01"));
|
||||||
|
assert_eq!(snapshot.quarter_end_date_key, date_key("2026-06-30"));
|
||||||
|
assert_eq!(snapshot.year_key, 2026);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn analytics_date_dimension_handles_year_end() {
|
||||||
|
// 中文注释:2026 年末属于 2026-W53,且所有自然年边界应保持在 2026 年内。
|
||||||
|
let snapshot = dimension("2026-12-31");
|
||||||
|
|
||||||
|
assert_eq!(snapshot.calendar_date, "2026-12-31");
|
||||||
|
assert_eq!(snapshot.weekday, 4);
|
||||||
|
assert_eq!(snapshot.iso_week_key, 202653);
|
||||||
|
assert_eq!(snapshot.week_start_date_key, date_key("2026-12-28"));
|
||||||
|
assert_eq!(snapshot.week_end_date_key, date_key("2027-01-03"));
|
||||||
|
assert_eq!(snapshot.month_key, 202612);
|
||||||
|
assert_eq!(snapshot.month_start_date_key, date_key("2026-12-01"));
|
||||||
|
assert_eq!(snapshot.month_end_date_key, date_key("2026-12-31"));
|
||||||
|
assert_eq!(snapshot.quarter_key, 20264);
|
||||||
|
assert_eq!(snapshot.quarter_start_date_key, date_key("2026-10-01"));
|
||||||
|
assert_eq!(snapshot.quarter_end_date_key, date_key("2026-12-31"));
|
||||||
|
assert_eq!(snapshot.year_key, 2026);
|
||||||
|
assert_eq!(snapshot.year_start_date_key, date_key("2026-01-01"));
|
||||||
|
assert_eq!(snapshot.year_end_date_key, date_key("2026-12-31"));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn analytics_date_key_parser_rejects_invalid_calendar_dates() {
|
||||||
|
// 中文注释:非法日期和非 YYYY-MM-DD 字符串都必须解析失败,避免写入脏维表。
|
||||||
|
assert_eq!(
|
||||||
|
parse_analytics_calendar_date_key("2026-02-30"),
|
||||||
|
Err(RuntimeProfileFieldError::InvalidAnalyticsCalendarDate)
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
parse_analytics_calendar_date_key("bad"),
|
||||||
|
Err(RuntimeProfileFieldError::InvalidAnalyticsCalendarDate)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn analytics_date_dimension_rejects_out_of_supported_range() {
|
||||||
|
// 中文注释:维表只允许受控业务日期范围,避免裸 date_key 极值进入 reducer 日历算法。
|
||||||
|
assert_eq!(
|
||||||
|
parse_analytics_calendar_date_key("1999-12-31"),
|
||||||
|
Err(RuntimeProfileFieldError::InvalidAnalyticsCalendarDate)
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
parse_analytics_calendar_date_key("2101-01-01"),
|
||||||
|
Err(RuntimeProfileFieldError::InvalidAnalyticsCalendarDate)
|
||||||
|
);
|
||||||
|
assert_eq!(
|
||||||
|
validate_analytics_date_dimension_date_key(i64::MAX),
|
||||||
|
Err(RuntimeProfileFieldError::InvalidAnalyticsCalendarDate)
|
||||||
|
);
|
||||||
|
}
|
||||||
83
server-rs/crates/module-runtime/tests/profile_task_scope.rs
Normal file
83
server-rs/crates/module-runtime/tests/profile_task_scope.rs
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
use module_runtime::{
|
||||||
|
RuntimeProfileFieldError, RuntimeProfileTaskCycle, RuntimeTrackingScopeKind,
|
||||||
|
build_runtime_profile_task_config_admin_upsert_input, build_runtime_tracking_daily_stat_id,
|
||||||
|
};
|
||||||
|
|
||||||
|
fn build_task_scope_input(
|
||||||
|
scope_kind: RuntimeTrackingScopeKind,
|
||||||
|
) -> Result<module_runtime::RuntimeProfileTaskConfigAdminUpsertInput, RuntimeProfileFieldError> {
|
||||||
|
build_runtime_profile_task_config_admin_upsert_input(
|
||||||
|
"admin-1".to_string(),
|
||||||
|
"daily-login".to_string(),
|
||||||
|
"每日登录".to_string(),
|
||||||
|
"".to_string(),
|
||||||
|
"daily_login".to_string(),
|
||||||
|
RuntimeProfileTaskCycle::Daily,
|
||||||
|
scope_kind,
|
||||||
|
1,
|
||||||
|
10,
|
||||||
|
true,
|
||||||
|
10,
|
||||||
|
1_000,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn admin_upsert_build_input_accepts_user_scope() {
|
||||||
|
let input = build_task_scope_input(RuntimeTrackingScopeKind::User)
|
||||||
|
.expect("个人任务 user scope 应允许保存");
|
||||||
|
|
||||||
|
assert_eq!(input.scope_kind, RuntimeTrackingScopeKind::User);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn admin_upsert_build_input_rejects_non_user_scope_with_clear_message() {
|
||||||
|
for scope_kind in [
|
||||||
|
RuntimeTrackingScopeKind::Site,
|
||||||
|
RuntimeTrackingScopeKind::Module,
|
||||||
|
RuntimeTrackingScopeKind::Work,
|
||||||
|
] {
|
||||||
|
let error = build_task_scope_input(scope_kind).expect_err("非 user scope 应拒绝保存");
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
error,
|
||||||
|
RuntimeProfileFieldError::UnsupportedProfileTaskScopeKind
|
||||||
|
);
|
||||||
|
assert!(
|
||||||
|
error.to_string().contains("仅支持 user"),
|
||||||
|
"错误信息应明确说明个人任务仅支持 user,实际为:{}",
|
||||||
|
error
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn tracking_daily_stat_id_keeps_work_scope_separate_from_user_scope() {
|
||||||
|
let user_id = "user-1";
|
||||||
|
let work_id = "work-1";
|
||||||
|
let day_key = 20_000;
|
||||||
|
|
||||||
|
let user_stat_id = build_runtime_tracking_daily_stat_id(
|
||||||
|
"daily_login",
|
||||||
|
RuntimeTrackingScopeKind::User,
|
||||||
|
user_id,
|
||||||
|
day_key,
|
||||||
|
);
|
||||||
|
let work_stat_id = build_runtime_tracking_daily_stat_id(
|
||||||
|
"daily_login",
|
||||||
|
RuntimeTrackingScopeKind::Work,
|
||||||
|
work_id,
|
||||||
|
day_key,
|
||||||
|
);
|
||||||
|
let invalid_work_with_user_id_stat_id = build_runtime_tracking_daily_stat_id(
|
||||||
|
"daily_login",
|
||||||
|
RuntimeTrackingScopeKind::Work,
|
||||||
|
user_id,
|
||||||
|
day_key,
|
||||||
|
);
|
||||||
|
|
||||||
|
// 中文注释:Work 维度必须保留独立 scope_kind,不允许被静默当作 user_id 查询用户桶。
|
||||||
|
assert!(user_stat_id.contains(":user:user-1:"));
|
||||||
|
assert!(work_stat_id.contains(":work:work-1:"));
|
||||||
|
assert_ne!(user_stat_id, invalid_work_with_user_id_stat_id);
|
||||||
|
}
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
use serde_json::json;
|
||||||
|
use shared_contracts::runtime::{
|
||||||
|
AdminUpsertProfileTaskConfigRequest, ProfileTaskConfigAdminResponse, TRACKING_SCOPE_KIND_USER,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn admin_upsert_profile_task_config_keeps_personal_task_scope_user() {
|
||||||
|
let request: AdminUpsertProfileTaskConfigRequest = serde_json::from_value(json!({
|
||||||
|
"taskId": "daily_login",
|
||||||
|
"title": "每日登录",
|
||||||
|
"description": "",
|
||||||
|
"eventKey": "daily_login",
|
||||||
|
"cycle": "daily",
|
||||||
|
"scopeKind": "user",
|
||||||
|
"threshold": 1,
|
||||||
|
"rewardPoints": 10,
|
||||||
|
"enabled": true,
|
||||||
|
"sortOrder": 10
|
||||||
|
}))
|
||||||
|
.expect("个人任务配置请求应接受 user scope");
|
||||||
|
|
||||||
|
assert_eq!(request.scope_kind, TRACKING_SCOPE_KIND_USER);
|
||||||
|
|
||||||
|
let value = serde_json::to_value(request).expect("个人任务配置请求应可序列化");
|
||||||
|
assert_eq!(value["scopeKind"], json!(TRACKING_SCOPE_KIND_USER));
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn profile_task_config_admin_response_serializes_scope_kind_as_user() {
|
||||||
|
let response = ProfileTaskConfigAdminResponse {
|
||||||
|
task_id: "daily_login".to_string(),
|
||||||
|
title: "每日登录".to_string(),
|
||||||
|
description: "".to_string(),
|
||||||
|
event_key: "daily_login".to_string(),
|
||||||
|
cycle: "daily".to_string(),
|
||||||
|
scope_kind: TRACKING_SCOPE_KIND_USER.to_string(),
|
||||||
|
threshold: 1,
|
||||||
|
reward_points: 10,
|
||||||
|
enabled: true,
|
||||||
|
sort_order: 10,
|
||||||
|
created_by: "admin".to_string(),
|
||||||
|
created_at: "2026-05-04T00:00:00Z".to_string(),
|
||||||
|
updated_by: "admin".to_string(),
|
||||||
|
updated_at: "2026-05-04T00:00:00Z".to_string(),
|
||||||
|
};
|
||||||
|
|
||||||
|
let value = serde_json::to_value(response).expect("个人任务配置响应应可序列化");
|
||||||
|
assert_eq!(value["scopeKind"], json!(TRACKING_SCOPE_KIND_USER));
|
||||||
|
assert_eq!(value["taskId"], json!("daily_login"));
|
||||||
|
assert_eq!(value["rewardPoints"], json!(10));
|
||||||
|
}
|
||||||
@@ -47,10 +47,8 @@ pub trait accept_quest {
|
|||||||
&self,
|
&self,
|
||||||
input: QuestRecordInput,
|
input: QuestRecordInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl accept_quest for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: QuestRecordInput,
|
input: QuestRecordInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait acknowledge_quest_completion {
|
|||||||
&self,
|
&self,
|
||||||
input: QuestCompletionAckInput,
|
input: QuestCompletionAckInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl acknowledge_quest_completion for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: QuestCompletionAckInput,
|
input: QuestCompletionAckInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -0,0 +1,166 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::ai_result_reference_kind_type::AiResultReferenceKind;
|
||||||
|
use super::ai_result_reference_type::AiResultReference;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `ai_result_reference`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`AiResultReferenceTableAccess::ai_result_reference`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.ai_result_reference()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.ai_result_reference().on_insert(...)`.
|
||||||
|
pub struct AiResultReferenceTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<AiResultReference>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `ai_result_reference`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait AiResultReferenceTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`AiResultReferenceTableHandle`], which mediates access to the table `ai_result_reference`.
|
||||||
|
fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AiResultReferenceTableAccess for super::RemoteTables {
|
||||||
|
fn ai_result_reference(&self) -> AiResultReferenceTableHandle<'_> {
|
||||||
|
AiResultReferenceTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<AiResultReference>("ai_result_reference"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AiResultReferenceInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct AiResultReferenceDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for AiResultReferenceTableHandle<'ctx> {
|
||||||
|
type Row = AiResultReference;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = AiResultReference> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = AiResultReferenceInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiResultReferenceInsertCallbackId {
|
||||||
|
AiResultReferenceInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: AiResultReferenceInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = AiResultReferenceDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiResultReferenceDeleteCallbackId {
|
||||||
|
AiResultReferenceDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: AiResultReferenceDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AiResultReferenceUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for AiResultReferenceTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = AiResultReferenceUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiResultReferenceUpdateCallbackId {
|
||||||
|
AiResultReferenceUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: AiResultReferenceUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `result_reference_row_id` unique index on the table `ai_result_reference`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`AiResultReferenceResultReferenceRowIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.ai_result_reference().result_reference_row_id().find(...)`.
|
||||||
|
pub struct AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<AiResultReference, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiResultReferenceTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `result_reference_row_id` unique index on the table `ai_result_reference`.
|
||||||
|
pub fn result_reference_row_id(&self) -> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||||
|
AiResultReferenceResultReferenceRowIdUnique {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_unique_constraint::<String>("result_reference_row_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiResultReferenceResultReferenceRowIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `result_reference_row_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AiResultReference> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<AiResultReference>("ai_result_reference");
|
||||||
|
_table.add_unique_constraint::<String>("result_reference_row_id", |row| {
|
||||||
|
&row.result_reference_row_id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<AiResultReference>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<AiResultReference>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `AiResultReference`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait ai_result_referenceQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `AiResultReference`.
|
||||||
|
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ai_result_referenceQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn ai_result_reference(&self) -> __sdk::__query_builder::Table<AiResultReference> {
|
||||||
|
__sdk::__query_builder::Table::new("ai_result_reference")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
|
use super::ai_task_stage_status_type::AiTaskStageStatus;
|
||||||
|
use super::ai_task_stage_type::AiTaskStage;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `ai_task_stage`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`AiTaskStageTableAccess::ai_task_stage`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.ai_task_stage()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.ai_task_stage().on_insert(...)`.
|
||||||
|
pub struct AiTaskStageTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<AiTaskStage>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `ai_task_stage`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait AiTaskStageTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`AiTaskStageTableHandle`], which mediates access to the table `ai_task_stage`.
|
||||||
|
fn ai_task_stage(&self) -> AiTaskStageTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AiTaskStageTableAccess for super::RemoteTables {
|
||||||
|
fn ai_task_stage(&self) -> AiTaskStageTableHandle<'_> {
|
||||||
|
AiTaskStageTableHandle {
|
||||||
|
imp: self.imp.get_table::<AiTaskStage>("ai_task_stage"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AiTaskStageInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct AiTaskStageDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for AiTaskStageTableHandle<'ctx> {
|
||||||
|
type Row = AiTaskStage;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = AiTaskStage> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = AiTaskStageInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiTaskStageInsertCallbackId {
|
||||||
|
AiTaskStageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: AiTaskStageInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = AiTaskStageDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiTaskStageDeleteCallbackId {
|
||||||
|
AiTaskStageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: AiTaskStageDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AiTaskStageUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskStageTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = AiTaskStageUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiTaskStageUpdateCallbackId {
|
||||||
|
AiTaskStageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: AiTaskStageUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `task_stage_id` unique index on the table `ai_task_stage`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`AiTaskStageTaskStageIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.ai_task_stage().task_stage_id().find(...)`.
|
||||||
|
pub struct AiTaskStageTaskStageIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<AiTaskStage, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiTaskStageTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `task_stage_id` unique index on the table `ai_task_stage`.
|
||||||
|
pub fn task_stage_id(&self) -> AiTaskStageTaskStageIdUnique<'ctx> {
|
||||||
|
AiTaskStageTaskStageIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("task_stage_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiTaskStageTaskStageIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `task_stage_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AiTaskStage> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<AiTaskStage>("ai_task_stage");
|
||||||
|
_table.add_unique_constraint::<String>("task_stage_id", |row| &row.task_stage_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<AiTaskStage>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<AiTaskStage>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `AiTaskStage`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait ai_task_stageQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `AiTaskStage`.
|
||||||
|
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ai_task_stageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn ai_task_stage(&self) -> __sdk::__query_builder::Table<AiTaskStage> {
|
||||||
|
__sdk::__query_builder::Table::new("ai_task_stage")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::ai_task_kind_type::AiTaskKind;
|
||||||
|
use super::ai_task_status_type::AiTaskStatus;
|
||||||
|
use super::ai_task_type::AiTask;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `ai_task`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`AiTaskTableAccess::ai_task`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.ai_task()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.ai_task().on_insert(...)`.
|
||||||
|
pub struct AiTaskTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<AiTask>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `ai_task`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait AiTaskTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`AiTaskTableHandle`], which mediates access to the table `ai_task`.
|
||||||
|
fn ai_task(&self) -> AiTaskTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AiTaskTableAccess for super::RemoteTables {
|
||||||
|
fn ai_task(&self) -> AiTaskTableHandle<'_> {
|
||||||
|
AiTaskTableHandle {
|
||||||
|
imp: self.imp.get_table::<AiTask>("ai_task"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AiTaskInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct AiTaskDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for AiTaskTableHandle<'ctx> {
|
||||||
|
type Row = AiTask;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = AiTask> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = AiTaskInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiTaskInsertCallbackId {
|
||||||
|
AiTaskInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: AiTaskInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = AiTaskDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiTaskDeleteCallbackId {
|
||||||
|
AiTaskDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: AiTaskDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AiTaskUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for AiTaskTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = AiTaskUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiTaskUpdateCallbackId {
|
||||||
|
AiTaskUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: AiTaskUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `task_id` unique index on the table `ai_task`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`AiTaskTaskIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.ai_task().task_id().find(...)`.
|
||||||
|
pub struct AiTaskTaskIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<AiTask, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiTaskTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `task_id` unique index on the table `ai_task`.
|
||||||
|
pub fn task_id(&self) -> AiTaskTaskIdUnique<'ctx> {
|
||||||
|
AiTaskTaskIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("task_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiTaskTaskIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `task_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AiTask> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<AiTask>("ai_task");
|
||||||
|
_table.add_unique_constraint::<String>("task_id", |row| &row.task_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<AiTask>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<AiTask>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `AiTask`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait ai_taskQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `AiTask`.
|
||||||
|
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ai_taskQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn ai_task(&self) -> __sdk::__query_builder::Table<AiTask> {
|
||||||
|
__sdk::__query_builder::Table::new("ai_task")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::ai_task_stage_kind_type::AiTaskStageKind;
|
||||||
|
use super::ai_text_chunk_type::AiTextChunk;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `ai_text_chunk`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`AiTextChunkTableAccess::ai_text_chunk`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.ai_text_chunk()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.ai_text_chunk().on_insert(...)`.
|
||||||
|
pub struct AiTextChunkTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<AiTextChunk>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `ai_text_chunk`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait AiTextChunkTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`AiTextChunkTableHandle`], which mediates access to the table `ai_text_chunk`.
|
||||||
|
fn ai_text_chunk(&self) -> AiTextChunkTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AiTextChunkTableAccess for super::RemoteTables {
|
||||||
|
fn ai_text_chunk(&self) -> AiTextChunkTableHandle<'_> {
|
||||||
|
AiTextChunkTableHandle {
|
||||||
|
imp: self.imp.get_table::<AiTextChunk>("ai_text_chunk"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AiTextChunkInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct AiTextChunkDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for AiTextChunkTableHandle<'ctx> {
|
||||||
|
type Row = AiTextChunk;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = AiTextChunk> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = AiTextChunkInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiTextChunkInsertCallbackId {
|
||||||
|
AiTextChunkInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: AiTextChunkInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = AiTextChunkDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiTextChunkDeleteCallbackId {
|
||||||
|
AiTextChunkDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: AiTextChunkDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AiTextChunkUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for AiTextChunkTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = AiTextChunkUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> AiTextChunkUpdateCallbackId {
|
||||||
|
AiTextChunkUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: AiTextChunkUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `text_chunk_row_id` unique index on the table `ai_text_chunk`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`AiTextChunkTextChunkRowIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.ai_text_chunk().text_chunk_row_id().find(...)`.
|
||||||
|
pub struct AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<AiTextChunk, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiTextChunkTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `text_chunk_row_id` unique index on the table `ai_text_chunk`.
|
||||||
|
pub fn text_chunk_row_id(&self) -> AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||||
|
AiTextChunkTextChunkRowIdUnique {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_unique_constraint::<String>("text_chunk_row_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AiTextChunkTextChunkRowIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `text_chunk_row_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AiTextChunk> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<AiTextChunk>("ai_text_chunk");
|
||||||
|
_table.add_unique_constraint::<String>("text_chunk_row_id", |row| &row.text_chunk_row_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<AiTextChunk>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<AiTextChunk>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `AiTextChunk`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait ai_text_chunkQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `AiTextChunk`.
|
||||||
|
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ai_text_chunkQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn ai_text_chunk(&self) -> __sdk::__query_builder::Table<AiTextChunk> {
|
||||||
|
__sdk::__query_builder::Table::new("ai_text_chunk")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
|
#[sats(crate = __lib)]
|
||||||
|
pub struct AnalyticsDateDimensionEnsureInput {
|
||||||
|
pub date_key: i64,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl __sdk::InModule for AnalyticsDateDimensionEnsureInput {
|
||||||
|
type Module = super::RemoteModule;
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
|
#[sats(crate = __lib)]
|
||||||
|
pub struct AnalyticsDateDimensionSeedInput {
|
||||||
|
pub start_date: String,
|
||||||
|
pub end_date: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl __sdk::InModule for AnalyticsDateDimensionSeedInput {
|
||||||
|
type Module = super::RemoteModule;
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::analytics_date_dimension_type::AnalyticsDateDimension;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `analytics_date_dimension`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`AnalyticsDateDimensionTableAccess::analytics_date_dimension`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.analytics_date_dimension()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.analytics_date_dimension().on_insert(...)`.
|
||||||
|
pub struct AnalyticsDateDimensionTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<AnalyticsDateDimension>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `analytics_date_dimension`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait AnalyticsDateDimensionTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`AnalyticsDateDimensionTableHandle`], which mediates access to the table `analytics_date_dimension`.
|
||||||
|
fn analytics_date_dimension(&self) -> AnalyticsDateDimensionTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AnalyticsDateDimensionTableAccess for super::RemoteTables {
|
||||||
|
fn analytics_date_dimension(&self) -> AnalyticsDateDimensionTableHandle<'_> {
|
||||||
|
AnalyticsDateDimensionTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<AnalyticsDateDimension>("analytics_date_dimension"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AnalyticsDateDimensionInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct AnalyticsDateDimensionDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for AnalyticsDateDimensionTableHandle<'ctx> {
|
||||||
|
type Row = AnalyticsDateDimension;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = AnalyticsDateDimension> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = AnalyticsDateDimensionInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AnalyticsDateDimensionInsertCallbackId {
|
||||||
|
AnalyticsDateDimensionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: AnalyticsDateDimensionInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = AnalyticsDateDimensionDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AnalyticsDateDimensionDeleteCallbackId {
|
||||||
|
AnalyticsDateDimensionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: AnalyticsDateDimensionDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AnalyticsDateDimensionUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for AnalyticsDateDimensionTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = AnalyticsDateDimensionUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> AnalyticsDateDimensionUpdateCallbackId {
|
||||||
|
AnalyticsDateDimensionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: AnalyticsDateDimensionUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `date_key` unique index on the table `analytics_date_dimension`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`AnalyticsDateDimensionDateKeyUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.analytics_date_dimension().date_key().find(...)`.
|
||||||
|
pub struct AnalyticsDateDimensionDateKeyUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<AnalyticsDateDimension, i64>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AnalyticsDateDimensionTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `date_key` unique index on the table `analytics_date_dimension`.
|
||||||
|
pub fn date_key(&self) -> AnalyticsDateDimensionDateKeyUnique<'ctx> {
|
||||||
|
AnalyticsDateDimensionDateKeyUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<i64>("date_key"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AnalyticsDateDimensionDateKeyUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `date_key` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &i64) -> Option<AnalyticsDateDimension> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<AnalyticsDateDimension>("analytics_date_dimension");
|
||||||
|
_table.add_unique_constraint::<i64>("date_key", |row| &row.date_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<AnalyticsDateDimension>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<AnalyticsDateDimension>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `AnalyticsDateDimension`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait analytics_date_dimensionQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `AnalyticsDateDimension`.
|
||||||
|
fn analytics_date_dimension(&self) -> __sdk::__query_builder::Table<AnalyticsDateDimension>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl analytics_date_dimensionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn analytics_date_dimension(&self) -> __sdk::__query_builder::Table<AnalyticsDateDimension> {
|
||||||
|
__sdk::__query_builder::Table::new("analytics_date_dimension")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,120 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
|
#[sats(crate = __lib)]
|
||||||
|
pub struct AnalyticsDateDimension {
|
||||||
|
pub date_key: i64,
|
||||||
|
pub calendar_date: String,
|
||||||
|
pub weekday: u8,
|
||||||
|
pub iso_week_key: i32,
|
||||||
|
pub week_start_date_key: i64,
|
||||||
|
pub week_end_date_key: i64,
|
||||||
|
pub month_key: i32,
|
||||||
|
pub month_start_date_key: i64,
|
||||||
|
pub month_end_date_key: i64,
|
||||||
|
pub quarter_key: i32,
|
||||||
|
pub quarter_start_date_key: i64,
|
||||||
|
pub quarter_end_date_key: i64,
|
||||||
|
pub year_key: i32,
|
||||||
|
pub year_start_date_key: i64,
|
||||||
|
pub year_end_date_key: i64,
|
||||||
|
pub created_at: __sdk::Timestamp,
|
||||||
|
pub updated_at: __sdk::Timestamp,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl __sdk::InModule for AnalyticsDateDimension {
|
||||||
|
type Module = super::RemoteModule;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Column accessor struct for the table `AnalyticsDateDimension`.
|
||||||
|
///
|
||||||
|
/// Provides typed access to columns for query building.
|
||||||
|
pub struct AnalyticsDateDimensionCols {
|
||||||
|
pub date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
|
||||||
|
pub calendar_date: __sdk::__query_builder::Col<AnalyticsDateDimension, String>,
|
||||||
|
pub weekday: __sdk::__query_builder::Col<AnalyticsDateDimension, u8>,
|
||||||
|
pub iso_week_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i32>,
|
||||||
|
pub week_start_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
|
||||||
|
pub week_end_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
|
||||||
|
pub month_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i32>,
|
||||||
|
pub month_start_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
|
||||||
|
pub month_end_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
|
||||||
|
pub quarter_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i32>,
|
||||||
|
pub quarter_start_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
|
||||||
|
pub quarter_end_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
|
||||||
|
pub year_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i32>,
|
||||||
|
pub year_start_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
|
||||||
|
pub year_end_date_key: __sdk::__query_builder::Col<AnalyticsDateDimension, i64>,
|
||||||
|
pub created_at: __sdk::__query_builder::Col<AnalyticsDateDimension, __sdk::Timestamp>,
|
||||||
|
pub updated_at: __sdk::__query_builder::Col<AnalyticsDateDimension, __sdk::Timestamp>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl __sdk::__query_builder::HasCols for AnalyticsDateDimension {
|
||||||
|
type Cols = AnalyticsDateDimensionCols;
|
||||||
|
fn cols(table_name: &'static str) -> Self::Cols {
|
||||||
|
AnalyticsDateDimensionCols {
|
||||||
|
date_key: __sdk::__query_builder::Col::new(table_name, "date_key"),
|
||||||
|
calendar_date: __sdk::__query_builder::Col::new(table_name, "calendar_date"),
|
||||||
|
weekday: __sdk::__query_builder::Col::new(table_name, "weekday"),
|
||||||
|
iso_week_key: __sdk::__query_builder::Col::new(table_name, "iso_week_key"),
|
||||||
|
week_start_date_key: __sdk::__query_builder::Col::new(
|
||||||
|
table_name,
|
||||||
|
"week_start_date_key",
|
||||||
|
),
|
||||||
|
week_end_date_key: __sdk::__query_builder::Col::new(table_name, "week_end_date_key"),
|
||||||
|
month_key: __sdk::__query_builder::Col::new(table_name, "month_key"),
|
||||||
|
month_start_date_key: __sdk::__query_builder::Col::new(
|
||||||
|
table_name,
|
||||||
|
"month_start_date_key",
|
||||||
|
),
|
||||||
|
month_end_date_key: __sdk::__query_builder::Col::new(table_name, "month_end_date_key"),
|
||||||
|
quarter_key: __sdk::__query_builder::Col::new(table_name, "quarter_key"),
|
||||||
|
quarter_start_date_key: __sdk::__query_builder::Col::new(
|
||||||
|
table_name,
|
||||||
|
"quarter_start_date_key",
|
||||||
|
),
|
||||||
|
quarter_end_date_key: __sdk::__query_builder::Col::new(
|
||||||
|
table_name,
|
||||||
|
"quarter_end_date_key",
|
||||||
|
),
|
||||||
|
year_key: __sdk::__query_builder::Col::new(table_name, "year_key"),
|
||||||
|
year_start_date_key: __sdk::__query_builder::Col::new(
|
||||||
|
table_name,
|
||||||
|
"year_start_date_key",
|
||||||
|
),
|
||||||
|
year_end_date_key: __sdk::__query_builder::Col::new(table_name, "year_end_date_key"),
|
||||||
|
created_at: __sdk::__query_builder::Col::new(table_name, "created_at"),
|
||||||
|
updated_at: __sdk::__query_builder::Col::new(table_name, "updated_at"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Indexed column accessor struct for the table `AnalyticsDateDimension`.
|
||||||
|
///
|
||||||
|
/// Provides typed access to indexed columns for query building.
|
||||||
|
pub struct AnalyticsDateDimensionIxCols {
|
||||||
|
pub date_key: __sdk::__query_builder::IxCol<AnalyticsDateDimension, i64>,
|
||||||
|
pub iso_week_key: __sdk::__query_builder::IxCol<AnalyticsDateDimension, i32>,
|
||||||
|
pub month_key: __sdk::__query_builder::IxCol<AnalyticsDateDimension, i32>,
|
||||||
|
pub quarter_key: __sdk::__query_builder::IxCol<AnalyticsDateDimension, i32>,
|
||||||
|
pub year_key: __sdk::__query_builder::IxCol<AnalyticsDateDimension, i32>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl __sdk::__query_builder::HasIxCols for AnalyticsDateDimension {
|
||||||
|
type IxCols = AnalyticsDateDimensionIxCols;
|
||||||
|
fn ix_cols(table_name: &'static str) -> Self::IxCols {
|
||||||
|
AnalyticsDateDimensionIxCols {
|
||||||
|
date_key: __sdk::__query_builder::IxCol::new(table_name, "date_key"),
|
||||||
|
iso_week_key: __sdk::__query_builder::IxCol::new(table_name, "iso_week_key"),
|
||||||
|
month_key: __sdk::__query_builder::IxCol::new(table_name, "month_key"),
|
||||||
|
quarter_key: __sdk::__query_builder::IxCol::new(table_name, "quarter_key"),
|
||||||
|
year_key: __sdk::__query_builder::IxCol::new(table_name, "year_key"),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl __sdk::__query_builder::CanBeLookupTable for AnalyticsDateDimension {}
|
||||||
@@ -50,10 +50,8 @@ pub trait apply_chapter_progression_ledger_entry {
|
|||||||
&self,
|
&self,
|
||||||
input: ChapterProgressionLedgerInput,
|
input: ChapterProgressionLedgerInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -63,10 +61,8 @@ impl apply_chapter_progression_ledger_entry for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: ChapterProgressionLedgerInput,
|
input: ChapterProgressionLedgerInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp.invoke_reducer_with_callback(
|
self.imp.invoke_reducer_with_callback(
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait apply_inventory_mutation {
|
|||||||
&self,
|
&self,
|
||||||
input: InventoryMutationInput,
|
input: InventoryMutationInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl apply_inventory_mutation for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: InventoryMutationInput,
|
input: InventoryMutationInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait apply_quest_signal {
|
|||||||
&self,
|
&self,
|
||||||
input: QuestSignalApplyInput,
|
input: QuestSignalApplyInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl apply_quest_signal for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: QuestSignalApplyInput,
|
input: QuestSignalApplyInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -0,0 +1,161 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::asset_entity_binding_type::AssetEntityBinding;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `asset_entity_binding`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`AssetEntityBindingTableAccess::asset_entity_binding`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.asset_entity_binding()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.asset_entity_binding().on_insert(...)`.
|
||||||
|
pub struct AssetEntityBindingTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<AssetEntityBinding>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `asset_entity_binding`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait AssetEntityBindingTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`AssetEntityBindingTableHandle`], which mediates access to the table `asset_entity_binding`.
|
||||||
|
fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AssetEntityBindingTableAccess for super::RemoteTables {
|
||||||
|
fn asset_entity_binding(&self) -> AssetEntityBindingTableHandle<'_> {
|
||||||
|
AssetEntityBindingTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<AssetEntityBinding>("asset_entity_binding"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AssetEntityBindingInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct AssetEntityBindingDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for AssetEntityBindingTableHandle<'ctx> {
|
||||||
|
type Row = AssetEntityBinding;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = AssetEntityBinding> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = AssetEntityBindingInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AssetEntityBindingInsertCallbackId {
|
||||||
|
AssetEntityBindingInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: AssetEntityBindingInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = AssetEntityBindingDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AssetEntityBindingDeleteCallbackId {
|
||||||
|
AssetEntityBindingDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: AssetEntityBindingDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AssetEntityBindingUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for AssetEntityBindingTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = AssetEntityBindingUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> AssetEntityBindingUpdateCallbackId {
|
||||||
|
AssetEntityBindingUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: AssetEntityBindingUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `binding_id` unique index on the table `asset_entity_binding`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`AssetEntityBindingBindingIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.asset_entity_binding().binding_id().find(...)`.
|
||||||
|
pub struct AssetEntityBindingBindingIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<AssetEntityBinding, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AssetEntityBindingTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `binding_id` unique index on the table `asset_entity_binding`.
|
||||||
|
pub fn binding_id(&self) -> AssetEntityBindingBindingIdUnique<'ctx> {
|
||||||
|
AssetEntityBindingBindingIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("binding_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AssetEntityBindingBindingIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `binding_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AssetEntityBinding> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<AssetEntityBinding>("asset_entity_binding");
|
||||||
|
_table.add_unique_constraint::<String>("binding_id", |row| &row.binding_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<AssetEntityBinding>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<AssetEntityBinding>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `AssetEntityBinding`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait asset_entity_bindingQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `AssetEntityBinding`.
|
||||||
|
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl asset_entity_bindingQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn asset_entity_binding(&self) -> __sdk::__query_builder::Table<AssetEntityBinding> {
|
||||||
|
__sdk::__query_builder::Table::new("asset_entity_binding")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::asset_object_access_policy_type::AssetObjectAccessPolicy;
|
||||||
|
use super::asset_object_type::AssetObject;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `asset_object`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`AssetObjectTableAccess::asset_object`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.asset_object()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.asset_object().on_insert(...)`.
|
||||||
|
pub struct AssetObjectTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<AssetObject>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `asset_object`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait AssetObjectTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`AssetObjectTableHandle`], which mediates access to the table `asset_object`.
|
||||||
|
fn asset_object(&self) -> AssetObjectTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AssetObjectTableAccess for super::RemoteTables {
|
||||||
|
fn asset_object(&self) -> AssetObjectTableHandle<'_> {
|
||||||
|
AssetObjectTableHandle {
|
||||||
|
imp: self.imp.get_table::<AssetObject>("asset_object"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AssetObjectInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct AssetObjectDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for AssetObjectTableHandle<'ctx> {
|
||||||
|
type Row = AssetObject;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = AssetObject> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = AssetObjectInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AssetObjectInsertCallbackId {
|
||||||
|
AssetObjectInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: AssetObjectInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = AssetObjectDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AssetObjectDeleteCallbackId {
|
||||||
|
AssetObjectDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: AssetObjectDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AssetObjectUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for AssetObjectTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = AssetObjectUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> AssetObjectUpdateCallbackId {
|
||||||
|
AssetObjectUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: AssetObjectUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `asset_object_id` unique index on the table `asset_object`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`AssetObjectAssetObjectIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.asset_object().asset_object_id().find(...)`.
|
||||||
|
pub struct AssetObjectAssetObjectIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<AssetObject, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AssetObjectTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `asset_object_id` unique index on the table `asset_object`.
|
||||||
|
pub fn asset_object_id(&self) -> AssetObjectAssetObjectIdUnique<'ctx> {
|
||||||
|
AssetObjectAssetObjectIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("asset_object_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AssetObjectAssetObjectIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `asset_object_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AssetObject> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<AssetObject>("asset_object");
|
||||||
|
_table.add_unique_constraint::<String>("asset_object_id", |row| &row.asset_object_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<AssetObject>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<AssetObject>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `AssetObject`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait asset_objectQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `AssetObject`.
|
||||||
|
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl asset_objectQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn asset_object(&self) -> __sdk::__query_builder::Table<AssetObject> {
|
||||||
|
__sdk::__query_builder::Table::new("asset_object")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::auth_identity_type::AuthIdentity;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `auth_identity`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`AuthIdentityTableAccess::auth_identity`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.auth_identity()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.auth_identity().on_insert(...)`.
|
||||||
|
pub struct AuthIdentityTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<AuthIdentity>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `auth_identity`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait AuthIdentityTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`AuthIdentityTableHandle`], which mediates access to the table `auth_identity`.
|
||||||
|
fn auth_identity(&self) -> AuthIdentityTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AuthIdentityTableAccess for super::RemoteTables {
|
||||||
|
fn auth_identity(&self) -> AuthIdentityTableHandle<'_> {
|
||||||
|
AuthIdentityTableHandle {
|
||||||
|
imp: self.imp.get_table::<AuthIdentity>("auth_identity"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AuthIdentityInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct AuthIdentityDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for AuthIdentityTableHandle<'ctx> {
|
||||||
|
type Row = AuthIdentity;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = AuthIdentity> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = AuthIdentityInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AuthIdentityInsertCallbackId {
|
||||||
|
AuthIdentityInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: AuthIdentityInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = AuthIdentityDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AuthIdentityDeleteCallbackId {
|
||||||
|
AuthIdentityDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: AuthIdentityDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AuthIdentityUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for AuthIdentityTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = AuthIdentityUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> AuthIdentityUpdateCallbackId {
|
||||||
|
AuthIdentityUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: AuthIdentityUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `identity_id` unique index on the table `auth_identity`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`AuthIdentityIdentityIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.auth_identity().identity_id().find(...)`.
|
||||||
|
pub struct AuthIdentityIdentityIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<AuthIdentity, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AuthIdentityTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `identity_id` unique index on the table `auth_identity`.
|
||||||
|
pub fn identity_id(&self) -> AuthIdentityIdentityIdUnique<'ctx> {
|
||||||
|
AuthIdentityIdentityIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("identity_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AuthIdentityIdentityIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `identity_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AuthIdentity> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<AuthIdentity>("auth_identity");
|
||||||
|
_table.add_unique_constraint::<String>("identity_id", |row| &row.identity_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<AuthIdentity>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<AuthIdentity>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `AuthIdentity`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait auth_identityQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `AuthIdentity`.
|
||||||
|
fn auth_identity(&self) -> __sdk::__query_builder::Table<AuthIdentity>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl auth_identityQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn auth_identity(&self) -> __sdk::__query_builder::Table<AuthIdentity> {
|
||||||
|
__sdk::__query_builder::Table::new("auth_identity")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::auth_store_snapshot_type::AuthStoreSnapshot;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `auth_store_snapshot`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`AuthStoreSnapshotTableAccess::auth_store_snapshot`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.auth_store_snapshot()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.auth_store_snapshot().on_insert(...)`.
|
||||||
|
pub struct AuthStoreSnapshotTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<AuthStoreSnapshot>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `auth_store_snapshot`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait AuthStoreSnapshotTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`AuthStoreSnapshotTableHandle`], which mediates access to the table `auth_store_snapshot`.
|
||||||
|
fn auth_store_snapshot(&self) -> AuthStoreSnapshotTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl AuthStoreSnapshotTableAccess for super::RemoteTables {
|
||||||
|
fn auth_store_snapshot(&self) -> AuthStoreSnapshotTableHandle<'_> {
|
||||||
|
AuthStoreSnapshotTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<AuthStoreSnapshot>("auth_store_snapshot"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AuthStoreSnapshotInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct AuthStoreSnapshotDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for AuthStoreSnapshotTableHandle<'ctx> {
|
||||||
|
type Row = AuthStoreSnapshot;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = AuthStoreSnapshot> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = AuthStoreSnapshotInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AuthStoreSnapshotInsertCallbackId {
|
||||||
|
AuthStoreSnapshotInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: AuthStoreSnapshotInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = AuthStoreSnapshotDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> AuthStoreSnapshotDeleteCallbackId {
|
||||||
|
AuthStoreSnapshotDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: AuthStoreSnapshotDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct AuthStoreSnapshotUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for AuthStoreSnapshotTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = AuthStoreSnapshotUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> AuthStoreSnapshotUpdateCallbackId {
|
||||||
|
AuthStoreSnapshotUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: AuthStoreSnapshotUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `snapshot_id` unique index on the table `auth_store_snapshot`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`AuthStoreSnapshotSnapshotIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.auth_store_snapshot().snapshot_id().find(...)`.
|
||||||
|
pub struct AuthStoreSnapshotSnapshotIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<AuthStoreSnapshot, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AuthStoreSnapshotTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `snapshot_id` unique index on the table `auth_store_snapshot`.
|
||||||
|
pub fn snapshot_id(&self) -> AuthStoreSnapshotSnapshotIdUnique<'ctx> {
|
||||||
|
AuthStoreSnapshotSnapshotIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("snapshot_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> AuthStoreSnapshotSnapshotIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `snapshot_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<AuthStoreSnapshot> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<AuthStoreSnapshot>("auth_store_snapshot");
|
||||||
|
_table.add_unique_constraint::<String>("snapshot_id", |row| &row.snapshot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<AuthStoreSnapshot>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<AuthStoreSnapshot>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `AuthStoreSnapshot`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait auth_store_snapshotQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `AuthStoreSnapshot`.
|
||||||
|
fn auth_store_snapshot(&self) -> __sdk::__query_builder::Table<AuthStoreSnapshot>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl auth_store_snapshotQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn auth_store_snapshot(&self) -> __sdk::__query_builder::Table<AuthStoreSnapshot> {
|
||||||
|
__sdk::__query_builder::Table::new("auth_store_snapshot")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::battle_mode_type::BattleMode;
|
||||||
|
use super::battle_state_type::BattleState;
|
||||||
|
use super::battle_status_type::BattleStatus;
|
||||||
|
use super::combat_outcome_type::CombatOutcome;
|
||||||
|
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `battle_state`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`BattleStateTableAccess::battle_state`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.battle_state()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.battle_state().on_insert(...)`.
|
||||||
|
pub struct BattleStateTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<BattleState>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `battle_state`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait BattleStateTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`BattleStateTableHandle`], which mediates access to the table `battle_state`.
|
||||||
|
fn battle_state(&self) -> BattleStateTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl BattleStateTableAccess for super::RemoteTables {
|
||||||
|
fn battle_state(&self) -> BattleStateTableHandle<'_> {
|
||||||
|
BattleStateTableHandle {
|
||||||
|
imp: self.imp.get_table::<BattleState>("battle_state"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct BattleStateInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct BattleStateDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for BattleStateTableHandle<'ctx> {
|
||||||
|
type Row = BattleState;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = BattleState> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = BattleStateInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> BattleStateInsertCallbackId {
|
||||||
|
BattleStateInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: BattleStateInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = BattleStateDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> BattleStateDeleteCallbackId {
|
||||||
|
BattleStateDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: BattleStateDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct BattleStateUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for BattleStateTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = BattleStateUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> BattleStateUpdateCallbackId {
|
||||||
|
BattleStateUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: BattleStateUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `battle_state_id` unique index on the table `battle_state`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`BattleStateBattleStateIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.battle_state().battle_state_id().find(...)`.
|
||||||
|
pub struct BattleStateBattleStateIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<BattleState, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> BattleStateTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `battle_state_id` unique index on the table `battle_state`.
|
||||||
|
pub fn battle_state_id(&self) -> BattleStateBattleStateIdUnique<'ctx> {
|
||||||
|
BattleStateBattleStateIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("battle_state_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> BattleStateBattleStateIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `battle_state_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<BattleState> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<BattleState>("battle_state");
|
||||||
|
_table.add_unique_constraint::<String>("battle_state_id", |row| &row.battle_state_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<BattleState>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<BattleState>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `BattleState`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait battle_stateQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `BattleState`.
|
||||||
|
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl battle_stateQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn battle_state(&self) -> __sdk::__query_builder::Table<BattleState> {
|
||||||
|
__sdk::__query_builder::Table::new("battle_state")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,10 +47,8 @@ pub trait begin_story_session {
|
|||||||
&self,
|
&self,
|
||||||
input: StorySessionInput,
|
input: StorySessionInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl begin_story_session for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: StorySessionInput,
|
input: StorySessionInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::big_fish_agent_message_kind_type::BigFishAgentMessageKind;
|
||||||
|
use super::big_fish_agent_message_role_type::BigFishAgentMessageRole;
|
||||||
|
use super::big_fish_agent_message_type::BigFishAgentMessage;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `big_fish_agent_message`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`BigFishAgentMessageTableAccess::big_fish_agent_message`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.big_fish_agent_message()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.big_fish_agent_message().on_insert(...)`.
|
||||||
|
pub struct BigFishAgentMessageTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<BigFishAgentMessage>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `big_fish_agent_message`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait BigFishAgentMessageTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`BigFishAgentMessageTableHandle`], which mediates access to the table `big_fish_agent_message`.
|
||||||
|
fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl BigFishAgentMessageTableAccess for super::RemoteTables {
|
||||||
|
fn big_fish_agent_message(&self) -> BigFishAgentMessageTableHandle<'_> {
|
||||||
|
BigFishAgentMessageTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<BigFishAgentMessage>("big_fish_agent_message"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct BigFishAgentMessageInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct BigFishAgentMessageDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for BigFishAgentMessageTableHandle<'ctx> {
|
||||||
|
type Row = BigFishAgentMessage;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = BigFishAgentMessage> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = BigFishAgentMessageInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishAgentMessageInsertCallbackId {
|
||||||
|
BigFishAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: BigFishAgentMessageInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = BigFishAgentMessageDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishAgentMessageDeleteCallbackId {
|
||||||
|
BigFishAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: BigFishAgentMessageDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct BigFishAgentMessageUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAgentMessageTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = BigFishAgentMessageUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishAgentMessageUpdateCallbackId {
|
||||||
|
BigFishAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: BigFishAgentMessageUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `message_id` unique index on the table `big_fish_agent_message`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`BigFishAgentMessageMessageIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.big_fish_agent_message().message_id().find(...)`.
|
||||||
|
pub struct BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<BigFishAgentMessage, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> BigFishAgentMessageTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `message_id` unique index on the table `big_fish_agent_message`.
|
||||||
|
pub fn message_id(&self) -> BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
BigFishAgentMessageMessageIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("message_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> BigFishAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<BigFishAgentMessage> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<BigFishAgentMessage>("big_fish_agent_message");
|
||||||
|
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<BigFishAgentMessage>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<BigFishAgentMessage>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `BigFishAgentMessage`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait big_fish_agent_messageQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `BigFishAgentMessage`.
|
||||||
|
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl big_fish_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn big_fish_agent_message(&self) -> __sdk::__query_builder::Table<BigFishAgentMessage> {
|
||||||
|
__sdk::__query_builder::Table::new("big_fish_agent_message")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::big_fish_asset_kind_type::BigFishAssetKind;
|
||||||
|
use super::big_fish_asset_slot_type::BigFishAssetSlot;
|
||||||
|
use super::big_fish_asset_status_type::BigFishAssetStatus;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `big_fish_asset_slot`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`BigFishAssetSlotTableAccess::big_fish_asset_slot`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.big_fish_asset_slot()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.big_fish_asset_slot().on_insert(...)`.
|
||||||
|
pub struct BigFishAssetSlotTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<BigFishAssetSlot>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `big_fish_asset_slot`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait BigFishAssetSlotTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`BigFishAssetSlotTableHandle`], which mediates access to the table `big_fish_asset_slot`.
|
||||||
|
fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl BigFishAssetSlotTableAccess for super::RemoteTables {
|
||||||
|
fn big_fish_asset_slot(&self) -> BigFishAssetSlotTableHandle<'_> {
|
||||||
|
BigFishAssetSlotTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<BigFishAssetSlot>("big_fish_asset_slot"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct BigFishAssetSlotInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct BigFishAssetSlotDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for BigFishAssetSlotTableHandle<'ctx> {
|
||||||
|
type Row = BigFishAssetSlot;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = BigFishAssetSlot> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = BigFishAssetSlotInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishAssetSlotInsertCallbackId {
|
||||||
|
BigFishAssetSlotInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: BigFishAssetSlotInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = BigFishAssetSlotDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishAssetSlotDeleteCallbackId {
|
||||||
|
BigFishAssetSlotDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: BigFishAssetSlotDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct BigFishAssetSlotUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishAssetSlotTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = BigFishAssetSlotUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishAssetSlotUpdateCallbackId {
|
||||||
|
BigFishAssetSlotUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: BigFishAssetSlotUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `slot_id` unique index on the table `big_fish_asset_slot`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`BigFishAssetSlotSlotIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.big_fish_asset_slot().slot_id().find(...)`.
|
||||||
|
pub struct BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<BigFishAssetSlot, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> BigFishAssetSlotTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `slot_id` unique index on the table `big_fish_asset_slot`.
|
||||||
|
pub fn slot_id(&self) -> BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||||
|
BigFishAssetSlotSlotIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("slot_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> BigFishAssetSlotSlotIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `slot_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<BigFishAssetSlot> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<BigFishAssetSlot>("big_fish_asset_slot");
|
||||||
|
_table.add_unique_constraint::<String>("slot_id", |row| &row.slot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<BigFishAssetSlot>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<BigFishAssetSlot>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `BigFishAssetSlot`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait big_fish_asset_slotQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `BigFishAssetSlot`.
|
||||||
|
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl big_fish_asset_slotQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn big_fish_asset_slot(&self) -> __sdk::__query_builder::Table<BigFishAssetSlot> {
|
||||||
|
__sdk::__query_builder::Table::new("big_fish_asset_slot")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::big_fish_creation_session_type::BigFishCreationSession;
|
||||||
|
use super::big_fish_creation_stage_type::BigFishCreationStage;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `big_fish_creation_session`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`BigFishCreationSessionTableAccess::big_fish_creation_session`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.big_fish_creation_session()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.big_fish_creation_session().on_insert(...)`.
|
||||||
|
pub struct BigFishCreationSessionTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<BigFishCreationSession>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `big_fish_creation_session`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait BigFishCreationSessionTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`BigFishCreationSessionTableHandle`], which mediates access to the table `big_fish_creation_session`.
|
||||||
|
fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl BigFishCreationSessionTableAccess for super::RemoteTables {
|
||||||
|
fn big_fish_creation_session(&self) -> BigFishCreationSessionTableHandle<'_> {
|
||||||
|
BigFishCreationSessionTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<BigFishCreationSession>("big_fish_creation_session"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct BigFishCreationSessionInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct BigFishCreationSessionDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for BigFishCreationSessionTableHandle<'ctx> {
|
||||||
|
type Row = BigFishCreationSession;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = BigFishCreationSession> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = BigFishCreationSessionInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishCreationSessionInsertCallbackId {
|
||||||
|
BigFishCreationSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: BigFishCreationSessionInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = BigFishCreationSessionDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishCreationSessionDeleteCallbackId {
|
||||||
|
BigFishCreationSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: BigFishCreationSessionDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct BigFishCreationSessionUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishCreationSessionTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = BigFishCreationSessionUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishCreationSessionUpdateCallbackId {
|
||||||
|
BigFishCreationSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: BigFishCreationSessionUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `session_id` unique index on the table `big_fish_creation_session`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`BigFishCreationSessionSessionIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.big_fish_creation_session().session_id().find(...)`.
|
||||||
|
pub struct BigFishCreationSessionSessionIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<BigFishCreationSession, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> BigFishCreationSessionTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `session_id` unique index on the table `big_fish_creation_session`.
|
||||||
|
pub fn session_id(&self) -> BigFishCreationSessionSessionIdUnique<'ctx> {
|
||||||
|
BigFishCreationSessionSessionIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("session_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> BigFishCreationSessionSessionIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<BigFishCreationSession> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<BigFishCreationSession>("big_fish_creation_session");
|
||||||
|
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<BigFishCreationSession>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<BigFishCreationSession>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `BigFishCreationSession`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait big_fish_creation_sessionQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `BigFishCreationSession`.
|
||||||
|
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl big_fish_creation_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn big_fish_creation_session(&self) -> __sdk::__query_builder::Table<BigFishCreationSession> {
|
||||||
|
__sdk::__query_builder::Table::new("big_fish_creation_session")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::big_fish_run_status_type::BigFishRunStatus;
|
||||||
|
use super::big_fish_runtime_run_type::BigFishRuntimeRun;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `big_fish_runtime_run`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`BigFishRuntimeRunTableAccess::big_fish_runtime_run`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.big_fish_runtime_run()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.big_fish_runtime_run().on_insert(...)`.
|
||||||
|
pub struct BigFishRuntimeRunTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<BigFishRuntimeRun>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `big_fish_runtime_run`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait BigFishRuntimeRunTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`BigFishRuntimeRunTableHandle`], which mediates access to the table `big_fish_runtime_run`.
|
||||||
|
fn big_fish_runtime_run(&self) -> BigFishRuntimeRunTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl BigFishRuntimeRunTableAccess for super::RemoteTables {
|
||||||
|
fn big_fish_runtime_run(&self) -> BigFishRuntimeRunTableHandle<'_> {
|
||||||
|
BigFishRuntimeRunTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<BigFishRuntimeRun>("big_fish_runtime_run"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct BigFishRuntimeRunInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct BigFishRuntimeRunDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for BigFishRuntimeRunTableHandle<'ctx> {
|
||||||
|
type Row = BigFishRuntimeRun;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = BigFishRuntimeRun> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = BigFishRuntimeRunInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishRuntimeRunInsertCallbackId {
|
||||||
|
BigFishRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: BigFishRuntimeRunInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = BigFishRuntimeRunDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishRuntimeRunDeleteCallbackId {
|
||||||
|
BigFishRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: BigFishRuntimeRunDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct BigFishRuntimeRunUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for BigFishRuntimeRunTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = BigFishRuntimeRunUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> BigFishRuntimeRunUpdateCallbackId {
|
||||||
|
BigFishRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: BigFishRuntimeRunUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `run_id` unique index on the table `big_fish_runtime_run`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`BigFishRuntimeRunRunIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.big_fish_runtime_run().run_id().find(...)`.
|
||||||
|
pub struct BigFishRuntimeRunRunIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<BigFishRuntimeRun, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> BigFishRuntimeRunTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `run_id` unique index on the table `big_fish_runtime_run`.
|
||||||
|
pub fn run_id(&self) -> BigFishRuntimeRunRunIdUnique<'ctx> {
|
||||||
|
BigFishRuntimeRunRunIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("run_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> BigFishRuntimeRunRunIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `run_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<BigFishRuntimeRun> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<BigFishRuntimeRun>("big_fish_runtime_run");
|
||||||
|
_table.add_unique_constraint::<String>("run_id", |row| &row.run_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<BigFishRuntimeRun>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<BigFishRuntimeRun>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `BigFishRuntimeRun`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait big_fish_runtime_runQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `BigFishRuntimeRun`.
|
||||||
|
fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table<BigFishRuntimeRun>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl big_fish_runtime_runQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn big_fish_runtime_run(&self) -> __sdk::__query_builder::Table<BigFishRuntimeRun> {
|
||||||
|
__sdk::__query_builder::Table::new("big_fish_runtime_run")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,10 +47,8 @@ pub trait bind_asset_object_to_entity {
|
|||||||
&self,
|
&self,
|
||||||
input: AssetEntityBindingInput,
|
input: AssetEntityBindingInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl bind_asset_object_to_entity for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: AssetEntityBindingInput,
|
input: AssetEntityBindingInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -0,0 +1,166 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::chapter_pace_band_type::ChapterPaceBand;
|
||||||
|
use super::chapter_progression_type::ChapterProgression;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `chapter_progression`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ChapterProgressionTableAccess::chapter_progression`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.chapter_progression()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.chapter_progression().on_insert(...)`.
|
||||||
|
pub struct ChapterProgressionTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ChapterProgression>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `chapter_progression`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ChapterProgressionTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ChapterProgressionTableHandle`], which mediates access to the table `chapter_progression`.
|
||||||
|
fn chapter_progression(&self) -> ChapterProgressionTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ChapterProgressionTableAccess for super::RemoteTables {
|
||||||
|
fn chapter_progression(&self) -> ChapterProgressionTableHandle<'_> {
|
||||||
|
ChapterProgressionTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ChapterProgression>("chapter_progression"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ChapterProgressionInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ChapterProgressionDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ChapterProgressionTableHandle<'ctx> {
|
||||||
|
type Row = ChapterProgression;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ChapterProgression> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ChapterProgressionInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ChapterProgressionInsertCallbackId {
|
||||||
|
ChapterProgressionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ChapterProgressionInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ChapterProgressionDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ChapterProgressionDeleteCallbackId {
|
||||||
|
ChapterProgressionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ChapterProgressionDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ChapterProgressionUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ChapterProgressionTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ChapterProgressionUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ChapterProgressionUpdateCallbackId {
|
||||||
|
ChapterProgressionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ChapterProgressionUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `chapter_progression_id` unique index on the table `chapter_progression`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ChapterProgressionChapterProgressionIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.chapter_progression().chapter_progression_id().find(...)`.
|
||||||
|
pub struct ChapterProgressionChapterProgressionIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ChapterProgression, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ChapterProgressionTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `chapter_progression_id` unique index on the table `chapter_progression`.
|
||||||
|
pub fn chapter_progression_id(&self) -> ChapterProgressionChapterProgressionIdUnique<'ctx> {
|
||||||
|
ChapterProgressionChapterProgressionIdUnique {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_unique_constraint::<String>("chapter_progression_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ChapterProgressionChapterProgressionIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `chapter_progression_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ChapterProgression> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<ChapterProgression>("chapter_progression");
|
||||||
|
_table.add_unique_constraint::<String>("chapter_progression_id", |row| {
|
||||||
|
&row.chapter_progression_id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ChapterProgression>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ChapterProgression>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ChapterProgression`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait chapter_progressionQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ChapterProgression`.
|
||||||
|
fn chapter_progression(&self) -> __sdk::__query_builder::Table<ChapterProgression>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl chapter_progressionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn chapter_progression(&self) -> __sdk::__query_builder::Table<ChapterProgression> {
|
||||||
|
__sdk::__query_builder::Table::new("chapter_progression")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,10 +47,8 @@ pub trait confirm_asset_object {
|
|||||||
&self,
|
&self,
|
||||||
input: AssetObjectUpsertInput,
|
input: AssetObjectUpsertInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl confirm_asset_object for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: AssetObjectUpsertInput,
|
input: AssetObjectUpsertInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait continue_story {
|
|||||||
&self,
|
&self,
|
||||||
input: StoryContinueInput,
|
input: StoryContinueInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl continue_story for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: StoryContinueInput,
|
input: StoryContinueInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait create_ai_task {
|
|||||||
&self,
|
&self,
|
||||||
input: AiTaskCreateInput,
|
input: AiTaskCreateInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl create_ai_task for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: AiTaskCreateInput,
|
input: AiTaskCreateInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait create_battle_state {
|
|||||||
&self,
|
&self,
|
||||||
input: BattleStateInput,
|
input: BattleStateInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl create_battle_state for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: BattleStateInput,
|
input: BattleStateInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -0,0 +1,164 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::custom_world_agent_message_type::CustomWorldAgentMessage;
|
||||||
|
use super::rpg_agent_message_kind_type::RpgAgentMessageKind;
|
||||||
|
use super::rpg_agent_message_role_type::RpgAgentMessageRole;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `custom_world_agent_message`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`CustomWorldAgentMessageTableAccess::custom_world_agent_message`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.custom_world_agent_message()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_agent_message().on_insert(...)`.
|
||||||
|
pub struct CustomWorldAgentMessageTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<CustomWorldAgentMessage>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `custom_world_agent_message`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait CustomWorldAgentMessageTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`CustomWorldAgentMessageTableHandle`], which mediates access to the table `custom_world_agent_message`.
|
||||||
|
fn custom_world_agent_message(&self) -> CustomWorldAgentMessageTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CustomWorldAgentMessageTableAccess for super::RemoteTables {
|
||||||
|
fn custom_world_agent_message(&self) -> CustomWorldAgentMessageTableHandle<'_> {
|
||||||
|
CustomWorldAgentMessageTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<CustomWorldAgentMessage>("custom_world_agent_message"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldAgentMessageInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct CustomWorldAgentMessageDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for CustomWorldAgentMessageTableHandle<'ctx> {
|
||||||
|
type Row = CustomWorldAgentMessage;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = CustomWorldAgentMessage> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = CustomWorldAgentMessageInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldAgentMessageInsertCallbackId {
|
||||||
|
CustomWorldAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: CustomWorldAgentMessageInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = CustomWorldAgentMessageDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldAgentMessageDeleteCallbackId {
|
||||||
|
CustomWorldAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: CustomWorldAgentMessageDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldAgentMessageUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentMessageTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = CustomWorldAgentMessageUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldAgentMessageUpdateCallbackId {
|
||||||
|
CustomWorldAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: CustomWorldAgentMessageUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `message_id` unique index on the table `custom_world_agent_message`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`CustomWorldAgentMessageMessageIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_agent_message().message_id().find(...)`.
|
||||||
|
pub struct CustomWorldAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<CustomWorldAgentMessage, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldAgentMessageTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `message_id` unique index on the table `custom_world_agent_message`.
|
||||||
|
pub fn message_id(&self) -> CustomWorldAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
CustomWorldAgentMessageMessageIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("message_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<CustomWorldAgentMessage> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<CustomWorldAgentMessage>("custom_world_agent_message");
|
||||||
|
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldAgentMessage>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldAgentMessage>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `CustomWorldAgentMessage`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait custom_world_agent_messageQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `CustomWorldAgentMessage`.
|
||||||
|
fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table<CustomWorldAgentMessage>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl custom_world_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn custom_world_agent_message(&self) -> __sdk::__query_builder::Table<CustomWorldAgentMessage> {
|
||||||
|
__sdk::__query_builder::Table::new("custom_world_agent_message")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::custom_world_agent_operation_type::CustomWorldAgentOperation;
|
||||||
|
use super::rpg_agent_operation_status_type::RpgAgentOperationStatus;
|
||||||
|
use super::rpg_agent_operation_type_type::RpgAgentOperationType;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `custom_world_agent_operation`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`CustomWorldAgentOperationTableAccess::custom_world_agent_operation`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.custom_world_agent_operation()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_agent_operation().on_insert(...)`.
|
||||||
|
pub struct CustomWorldAgentOperationTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<CustomWorldAgentOperation>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `custom_world_agent_operation`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait CustomWorldAgentOperationTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`CustomWorldAgentOperationTableHandle`], which mediates access to the table `custom_world_agent_operation`.
|
||||||
|
fn custom_world_agent_operation(&self) -> CustomWorldAgentOperationTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CustomWorldAgentOperationTableAccess for super::RemoteTables {
|
||||||
|
fn custom_world_agent_operation(&self) -> CustomWorldAgentOperationTableHandle<'_> {
|
||||||
|
CustomWorldAgentOperationTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<CustomWorldAgentOperation>("custom_world_agent_operation"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldAgentOperationInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct CustomWorldAgentOperationDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for CustomWorldAgentOperationTableHandle<'ctx> {
|
||||||
|
type Row = CustomWorldAgentOperation;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = CustomWorldAgentOperation> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = CustomWorldAgentOperationInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldAgentOperationInsertCallbackId {
|
||||||
|
CustomWorldAgentOperationInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: CustomWorldAgentOperationInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = CustomWorldAgentOperationDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldAgentOperationDeleteCallbackId {
|
||||||
|
CustomWorldAgentOperationDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: CustomWorldAgentOperationDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldAgentOperationUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentOperationTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = CustomWorldAgentOperationUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldAgentOperationUpdateCallbackId {
|
||||||
|
CustomWorldAgentOperationUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: CustomWorldAgentOperationUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `operation_id` unique index on the table `custom_world_agent_operation`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`CustomWorldAgentOperationOperationIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_agent_operation().operation_id().find(...)`.
|
||||||
|
pub struct CustomWorldAgentOperationOperationIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<CustomWorldAgentOperation, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldAgentOperationTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `operation_id` unique index on the table `custom_world_agent_operation`.
|
||||||
|
pub fn operation_id(&self) -> CustomWorldAgentOperationOperationIdUnique<'ctx> {
|
||||||
|
CustomWorldAgentOperationOperationIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("operation_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldAgentOperationOperationIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `operation_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<CustomWorldAgentOperation> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<CustomWorldAgentOperation>("custom_world_agent_operation");
|
||||||
|
_table.add_unique_constraint::<String>("operation_id", |row| &row.operation_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldAgentOperation>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldAgentOperation>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `CustomWorldAgentOperation`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait custom_world_agent_operationQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `CustomWorldAgentOperation`.
|
||||||
|
fn custom_world_agent_operation(
|
||||||
|
&self,
|
||||||
|
) -> __sdk::__query_builder::Table<CustomWorldAgentOperation>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl custom_world_agent_operationQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn custom_world_agent_operation(
|
||||||
|
&self,
|
||||||
|
) -> __sdk::__query_builder::Table<CustomWorldAgentOperation> {
|
||||||
|
__sdk::__query_builder::Table::new("custom_world_agent_operation")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::custom_world_agent_session_type::CustomWorldAgentSession;
|
||||||
|
use super::rpg_agent_stage_type::RpgAgentStage;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `custom_world_agent_session`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`CustomWorldAgentSessionTableAccess::custom_world_agent_session`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.custom_world_agent_session()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_agent_session().on_insert(...)`.
|
||||||
|
pub struct CustomWorldAgentSessionTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<CustomWorldAgentSession>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `custom_world_agent_session`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait CustomWorldAgentSessionTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`CustomWorldAgentSessionTableHandle`], which mediates access to the table `custom_world_agent_session`.
|
||||||
|
fn custom_world_agent_session(&self) -> CustomWorldAgentSessionTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CustomWorldAgentSessionTableAccess for super::RemoteTables {
|
||||||
|
fn custom_world_agent_session(&self) -> CustomWorldAgentSessionTableHandle<'_> {
|
||||||
|
CustomWorldAgentSessionTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<CustomWorldAgentSession>("custom_world_agent_session"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldAgentSessionInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct CustomWorldAgentSessionDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for CustomWorldAgentSessionTableHandle<'ctx> {
|
||||||
|
type Row = CustomWorldAgentSession;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = CustomWorldAgentSession> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = CustomWorldAgentSessionInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldAgentSessionInsertCallbackId {
|
||||||
|
CustomWorldAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: CustomWorldAgentSessionInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = CustomWorldAgentSessionDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldAgentSessionDeleteCallbackId {
|
||||||
|
CustomWorldAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: CustomWorldAgentSessionDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldAgentSessionUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldAgentSessionTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = CustomWorldAgentSessionUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldAgentSessionUpdateCallbackId {
|
||||||
|
CustomWorldAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: CustomWorldAgentSessionUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `session_id` unique index on the table `custom_world_agent_session`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`CustomWorldAgentSessionSessionIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_agent_session().session_id().find(...)`.
|
||||||
|
pub struct CustomWorldAgentSessionSessionIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<CustomWorldAgentSession, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldAgentSessionTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `session_id` unique index on the table `custom_world_agent_session`.
|
||||||
|
pub fn session_id(&self) -> CustomWorldAgentSessionSessionIdUnique<'ctx> {
|
||||||
|
CustomWorldAgentSessionSessionIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("session_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldAgentSessionSessionIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<CustomWorldAgentSession> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<CustomWorldAgentSession>("custom_world_agent_session");
|
||||||
|
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldAgentSession>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldAgentSession>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `CustomWorldAgentSession`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait custom_world_agent_sessionQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `CustomWorldAgentSession`.
|
||||||
|
fn custom_world_agent_session(&self) -> __sdk::__query_builder::Table<CustomWorldAgentSession>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl custom_world_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn custom_world_agent_session(&self) -> __sdk::__query_builder::Table<CustomWorldAgentSession> {
|
||||||
|
__sdk::__query_builder::Table::new("custom_world_agent_session")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::custom_world_draft_card_type::CustomWorldDraftCard;
|
||||||
|
use super::custom_world_role_asset_status_type::CustomWorldRoleAssetStatus;
|
||||||
|
use super::rpg_agent_draft_card_kind_type::RpgAgentDraftCardKind;
|
||||||
|
use super::rpg_agent_draft_card_status_type::RpgAgentDraftCardStatus;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `custom_world_draft_card`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`CustomWorldDraftCardTableAccess::custom_world_draft_card`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.custom_world_draft_card()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_draft_card().on_insert(...)`.
|
||||||
|
pub struct CustomWorldDraftCardTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<CustomWorldDraftCard>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `custom_world_draft_card`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait CustomWorldDraftCardTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`CustomWorldDraftCardTableHandle`], which mediates access to the table `custom_world_draft_card`.
|
||||||
|
fn custom_world_draft_card(&self) -> CustomWorldDraftCardTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CustomWorldDraftCardTableAccess for super::RemoteTables {
|
||||||
|
fn custom_world_draft_card(&self) -> CustomWorldDraftCardTableHandle<'_> {
|
||||||
|
CustomWorldDraftCardTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<CustomWorldDraftCard>("custom_world_draft_card"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldDraftCardInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct CustomWorldDraftCardDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for CustomWorldDraftCardTableHandle<'ctx> {
|
||||||
|
type Row = CustomWorldDraftCard;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = CustomWorldDraftCard> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = CustomWorldDraftCardInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldDraftCardInsertCallbackId {
|
||||||
|
CustomWorldDraftCardInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: CustomWorldDraftCardInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = CustomWorldDraftCardDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldDraftCardDeleteCallbackId {
|
||||||
|
CustomWorldDraftCardDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: CustomWorldDraftCardDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldDraftCardUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldDraftCardTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = CustomWorldDraftCardUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldDraftCardUpdateCallbackId {
|
||||||
|
CustomWorldDraftCardUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: CustomWorldDraftCardUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `card_id` unique index on the table `custom_world_draft_card`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`CustomWorldDraftCardCardIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_draft_card().card_id().find(...)`.
|
||||||
|
pub struct CustomWorldDraftCardCardIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<CustomWorldDraftCard, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldDraftCardTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `card_id` unique index on the table `custom_world_draft_card`.
|
||||||
|
pub fn card_id(&self) -> CustomWorldDraftCardCardIdUnique<'ctx> {
|
||||||
|
CustomWorldDraftCardCardIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("card_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldDraftCardCardIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `card_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<CustomWorldDraftCard> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<CustomWorldDraftCard>("custom_world_draft_card");
|
||||||
|
_table.add_unique_constraint::<String>("card_id", |row| &row.card_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldDraftCard>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldDraftCard>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `CustomWorldDraftCard`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait custom_world_draft_cardQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `CustomWorldDraftCard`.
|
||||||
|
fn custom_world_draft_card(&self) -> __sdk::__query_builder::Table<CustomWorldDraftCard>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl custom_world_draft_cardQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn custom_world_draft_card(&self) -> __sdk::__query_builder::Table<CustomWorldDraftCard> {
|
||||||
|
__sdk::__query_builder::Table::new("custom_world_draft_card")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::custom_world_profile_type::CustomWorldProfile;
|
||||||
|
use super::custom_world_publication_status_type::CustomWorldPublicationStatus;
|
||||||
|
use super::custom_world_theme_mode_type::CustomWorldThemeMode;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `custom_world_profile`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`CustomWorldProfileTableAccess::custom_world_profile`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.custom_world_profile()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_profile().on_insert(...)`.
|
||||||
|
pub struct CustomWorldProfileTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<CustomWorldProfile>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `custom_world_profile`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait CustomWorldProfileTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`CustomWorldProfileTableHandle`], which mediates access to the table `custom_world_profile`.
|
||||||
|
fn custom_world_profile(&self) -> CustomWorldProfileTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CustomWorldProfileTableAccess for super::RemoteTables {
|
||||||
|
fn custom_world_profile(&self) -> CustomWorldProfileTableHandle<'_> {
|
||||||
|
CustomWorldProfileTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<CustomWorldProfile>("custom_world_profile"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldProfileInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct CustomWorldProfileDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for CustomWorldProfileTableHandle<'ctx> {
|
||||||
|
type Row = CustomWorldProfile;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = CustomWorldProfile> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = CustomWorldProfileInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldProfileInsertCallbackId {
|
||||||
|
CustomWorldProfileInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: CustomWorldProfileInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = CustomWorldProfileDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldProfileDeleteCallbackId {
|
||||||
|
CustomWorldProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: CustomWorldProfileDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldProfileUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldProfileTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = CustomWorldProfileUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldProfileUpdateCallbackId {
|
||||||
|
CustomWorldProfileUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: CustomWorldProfileUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `profile_id` unique index on the table `custom_world_profile`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`CustomWorldProfileProfileIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_profile().profile_id().find(...)`.
|
||||||
|
pub struct CustomWorldProfileProfileIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<CustomWorldProfile, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldProfileTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `profile_id` unique index on the table `custom_world_profile`.
|
||||||
|
pub fn profile_id(&self) -> CustomWorldProfileProfileIdUnique<'ctx> {
|
||||||
|
CustomWorldProfileProfileIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("profile_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldProfileProfileIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `profile_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<CustomWorldProfile> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<CustomWorldProfile>("custom_world_profile");
|
||||||
|
_table.add_unique_constraint::<String>("profile_id", |row| &row.profile_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldProfile>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldProfile>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `CustomWorldProfile`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait custom_world_profileQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `CustomWorldProfile`.
|
||||||
|
fn custom_world_profile(&self) -> __sdk::__query_builder::Table<CustomWorldProfile>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl custom_world_profileQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn custom_world_profile(&self) -> __sdk::__query_builder::Table<CustomWorldProfile> {
|
||||||
|
__sdk::__query_builder::Table::new("custom_world_profile")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::custom_world_generation_mode_type::CustomWorldGenerationMode;
|
||||||
|
use super::custom_world_session_status_type::CustomWorldSessionStatus;
|
||||||
|
use super::custom_world_session_type::CustomWorldSession;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `custom_world_session`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`CustomWorldSessionTableAccess::custom_world_session`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.custom_world_session()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_session().on_insert(...)`.
|
||||||
|
pub struct CustomWorldSessionTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<CustomWorldSession>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `custom_world_session`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait CustomWorldSessionTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`CustomWorldSessionTableHandle`], which mediates access to the table `custom_world_session`.
|
||||||
|
fn custom_world_session(&self) -> CustomWorldSessionTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl CustomWorldSessionTableAccess for super::RemoteTables {
|
||||||
|
fn custom_world_session(&self) -> CustomWorldSessionTableHandle<'_> {
|
||||||
|
CustomWorldSessionTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<CustomWorldSession>("custom_world_session"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldSessionInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct CustomWorldSessionDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for CustomWorldSessionTableHandle<'ctx> {
|
||||||
|
type Row = CustomWorldSession;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = CustomWorldSession> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = CustomWorldSessionInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldSessionInsertCallbackId {
|
||||||
|
CustomWorldSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: CustomWorldSessionInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = CustomWorldSessionDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldSessionDeleteCallbackId {
|
||||||
|
CustomWorldSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: CustomWorldSessionDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct CustomWorldSessionUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for CustomWorldSessionTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = CustomWorldSessionUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> CustomWorldSessionUpdateCallbackId {
|
||||||
|
CustomWorldSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: CustomWorldSessionUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `session_id` unique index on the table `custom_world_session`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`CustomWorldSessionSessionIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.custom_world_session().session_id().find(...)`.
|
||||||
|
pub struct CustomWorldSessionSessionIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<CustomWorldSession, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldSessionTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `session_id` unique index on the table `custom_world_session`.
|
||||||
|
pub fn session_id(&self) -> CustomWorldSessionSessionIdUnique<'ctx> {
|
||||||
|
CustomWorldSessionSessionIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("session_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> CustomWorldSessionSessionIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<CustomWorldSession> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<CustomWorldSession>("custom_world_session");
|
||||||
|
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<CustomWorldSession>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<CustomWorldSession>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `CustomWorldSession`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait custom_world_sessionQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `CustomWorldSession`.
|
||||||
|
fn custom_world_session(&self) -> __sdk::__query_builder::Table<CustomWorldSession>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl custom_world_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn custom_world_session(&self) -> __sdk::__query_builder::Table<CustomWorldSession> {
|
||||||
|
__sdk::__query_builder::Table::new("custom_world_session")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,169 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::database_migration_import_chunk_type::DatabaseMigrationImportChunk;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `database_migration_import_chunk`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`DatabaseMigrationImportChunkTableAccess::database_migration_import_chunk`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.database_migration_import_chunk()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.database_migration_import_chunk().on_insert(...)`.
|
||||||
|
pub struct DatabaseMigrationImportChunkTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<DatabaseMigrationImportChunk>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `database_migration_import_chunk`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait DatabaseMigrationImportChunkTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`DatabaseMigrationImportChunkTableHandle`], which mediates access to the table `database_migration_import_chunk`.
|
||||||
|
fn database_migration_import_chunk(&self) -> DatabaseMigrationImportChunkTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl DatabaseMigrationImportChunkTableAccess for super::RemoteTables {
|
||||||
|
fn database_migration_import_chunk(&self) -> DatabaseMigrationImportChunkTableHandle<'_> {
|
||||||
|
DatabaseMigrationImportChunkTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<DatabaseMigrationImportChunk>("database_migration_import_chunk"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct DatabaseMigrationImportChunkInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct DatabaseMigrationImportChunkDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for DatabaseMigrationImportChunkTableHandle<'ctx> {
|
||||||
|
type Row = DatabaseMigrationImportChunk;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = DatabaseMigrationImportChunk> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = DatabaseMigrationImportChunkInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> DatabaseMigrationImportChunkInsertCallbackId {
|
||||||
|
DatabaseMigrationImportChunkInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: DatabaseMigrationImportChunkInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = DatabaseMigrationImportChunkDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> DatabaseMigrationImportChunkDeleteCallbackId {
|
||||||
|
DatabaseMigrationImportChunkDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: DatabaseMigrationImportChunkDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct DatabaseMigrationImportChunkUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for DatabaseMigrationImportChunkTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = DatabaseMigrationImportChunkUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> DatabaseMigrationImportChunkUpdateCallbackId {
|
||||||
|
DatabaseMigrationImportChunkUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: DatabaseMigrationImportChunkUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `chunk_key` unique index on the table `database_migration_import_chunk`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`DatabaseMigrationImportChunkChunkKeyUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.database_migration_import_chunk().chunk_key().find(...)`.
|
||||||
|
pub struct DatabaseMigrationImportChunkChunkKeyUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<DatabaseMigrationImportChunk, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> DatabaseMigrationImportChunkTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `chunk_key` unique index on the table `database_migration_import_chunk`.
|
||||||
|
pub fn chunk_key(&self) -> DatabaseMigrationImportChunkChunkKeyUnique<'ctx> {
|
||||||
|
DatabaseMigrationImportChunkChunkKeyUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("chunk_key"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> DatabaseMigrationImportChunkChunkKeyUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `chunk_key` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<DatabaseMigrationImportChunk> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache
|
||||||
|
.get_or_make_table::<DatabaseMigrationImportChunk>("database_migration_import_chunk");
|
||||||
|
_table.add_unique_constraint::<String>("chunk_key", |row| &row.chunk_key);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<DatabaseMigrationImportChunk>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse(
|
||||||
|
"TableUpdate<DatabaseMigrationImportChunk>",
|
||||||
|
"TableUpdate",
|
||||||
|
)
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `DatabaseMigrationImportChunk`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait database_migration_import_chunkQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `DatabaseMigrationImportChunk`.
|
||||||
|
fn database_migration_import_chunk(
|
||||||
|
&self,
|
||||||
|
) -> __sdk::__query_builder::Table<DatabaseMigrationImportChunk>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl database_migration_import_chunkQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn database_migration_import_chunk(
|
||||||
|
&self,
|
||||||
|
) -> __sdk::__query_builder::Table<DatabaseMigrationImportChunk> {
|
||||||
|
__sdk::__query_builder::Table::new("database_migration_import_chunk")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,170 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::database_migration_operator_type::DatabaseMigrationOperator;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `database_migration_operator`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`DatabaseMigrationOperatorTableAccess::database_migration_operator`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.database_migration_operator()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.database_migration_operator().on_insert(...)`.
|
||||||
|
pub struct DatabaseMigrationOperatorTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<DatabaseMigrationOperator>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `database_migration_operator`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait DatabaseMigrationOperatorTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`DatabaseMigrationOperatorTableHandle`], which mediates access to the table `database_migration_operator`.
|
||||||
|
fn database_migration_operator(&self) -> DatabaseMigrationOperatorTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl DatabaseMigrationOperatorTableAccess for super::RemoteTables {
|
||||||
|
fn database_migration_operator(&self) -> DatabaseMigrationOperatorTableHandle<'_> {
|
||||||
|
DatabaseMigrationOperatorTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<DatabaseMigrationOperator>("database_migration_operator"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct DatabaseMigrationOperatorInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct DatabaseMigrationOperatorDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for DatabaseMigrationOperatorTableHandle<'ctx> {
|
||||||
|
type Row = DatabaseMigrationOperator;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = DatabaseMigrationOperator> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = DatabaseMigrationOperatorInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> DatabaseMigrationOperatorInsertCallbackId {
|
||||||
|
DatabaseMigrationOperatorInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: DatabaseMigrationOperatorInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = DatabaseMigrationOperatorDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> DatabaseMigrationOperatorDeleteCallbackId {
|
||||||
|
DatabaseMigrationOperatorDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: DatabaseMigrationOperatorDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct DatabaseMigrationOperatorUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for DatabaseMigrationOperatorTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = DatabaseMigrationOperatorUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> DatabaseMigrationOperatorUpdateCallbackId {
|
||||||
|
DatabaseMigrationOperatorUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: DatabaseMigrationOperatorUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `operator_identity` unique index on the table `database_migration_operator`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`DatabaseMigrationOperatorOperatorIdentityUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.database_migration_operator().operator_identity().find(...)`.
|
||||||
|
pub struct DatabaseMigrationOperatorOperatorIdentityUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<DatabaseMigrationOperator, __sdk::Identity>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> DatabaseMigrationOperatorTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `operator_identity` unique index on the table `database_migration_operator`.
|
||||||
|
pub fn operator_identity(&self) -> DatabaseMigrationOperatorOperatorIdentityUnique<'ctx> {
|
||||||
|
DatabaseMigrationOperatorOperatorIdentityUnique {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_unique_constraint::<__sdk::Identity>("operator_identity"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> DatabaseMigrationOperatorOperatorIdentityUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `operator_identity` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &__sdk::Identity) -> Option<DatabaseMigrationOperator> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<DatabaseMigrationOperator>("database_migration_operator");
|
||||||
|
_table.add_unique_constraint::<__sdk::Identity>("operator_identity", |row| {
|
||||||
|
&row.operator_identity
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<DatabaseMigrationOperator>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<DatabaseMigrationOperator>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `DatabaseMigrationOperator`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait database_migration_operatorQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `DatabaseMigrationOperator`.
|
||||||
|
fn database_migration_operator(
|
||||||
|
&self,
|
||||||
|
) -> __sdk::__query_builder::Table<DatabaseMigrationOperator>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl database_migration_operatorQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn database_migration_operator(
|
||||||
|
&self,
|
||||||
|
) -> __sdk::__query_builder::Table<DatabaseMigrationOperator> {
|
||||||
|
__sdk::__query_builder::Table::new("database_migration_operator")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
use super::analytics_date_dimension_ensure_input_type::AnalyticsDateDimensionEnsureInput;
|
||||||
|
|
||||||
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
|
#[sats(crate = __lib)]
|
||||||
|
pub(super) struct EnsureAnalyticsDateDimensionForDateArgs {
|
||||||
|
pub input: AnalyticsDateDimensionEnsureInput,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<EnsureAnalyticsDateDimensionForDateArgs> for super::Reducer {
|
||||||
|
fn from(args: EnsureAnalyticsDateDimensionForDateArgs) -> Self {
|
||||||
|
Self::EnsureAnalyticsDateDimensionForDate { input: args.input }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl __sdk::InModule for EnsureAnalyticsDateDimensionForDateArgs {
|
||||||
|
type Module = super::RemoteModule;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the reducer `ensure_analytics_date_dimension_for_date`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteReducers`].
|
||||||
|
pub trait ensure_analytics_date_dimension_for_date {
|
||||||
|
/// Request that the remote module invoke the reducer `ensure_analytics_date_dimension_for_date` to run as soon as possible.
|
||||||
|
///
|
||||||
|
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||||
|
/// The reducer will run asynchronously in the future,
|
||||||
|
/// and this method provides no way to listen for its completion status.
|
||||||
|
/// /// Use [`ensure_analytics_date_dimension_for_date:ensure_analytics_date_dimension_for_date_then`] to run a callback after the reducer completes.
|
||||||
|
fn ensure_analytics_date_dimension_for_date(
|
||||||
|
&self,
|
||||||
|
input: AnalyticsDateDimensionEnsureInput,
|
||||||
|
) -> __sdk::Result<()> {
|
||||||
|
self.ensure_analytics_date_dimension_for_date_then(input, |_, _| {})
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Request that the remote module invoke the reducer `ensure_analytics_date_dimension_for_date` to run as soon as possible,
|
||||||
|
/// registering `callback` to run when we are notified that the reducer completed.
|
||||||
|
///
|
||||||
|
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||||
|
/// The reducer will run asynchronously in the future,
|
||||||
|
/// and its status can be observed with the `callback`.
|
||||||
|
fn ensure_analytics_date_dimension_for_date_then(
|
||||||
|
&self,
|
||||||
|
input: AnalyticsDateDimensionEnsureInput,
|
||||||
|
|
||||||
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
|
+ Send
|
||||||
|
+ 'static,
|
||||||
|
) -> __sdk::Result<()>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ensure_analytics_date_dimension_for_date for super::RemoteReducers {
|
||||||
|
fn ensure_analytics_date_dimension_for_date_then(
|
||||||
|
&self,
|
||||||
|
input: AnalyticsDateDimensionEnsureInput,
|
||||||
|
|
||||||
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
|
+ Send
|
||||||
|
+ 'static,
|
||||||
|
) -> __sdk::Result<()> {
|
||||||
|
self.imp.invoke_reducer_with_callback(
|
||||||
|
EnsureAnalyticsDateDimensionForDateArgs { input },
|
||||||
|
callback,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,10 +50,8 @@ pub trait grant_player_progression_experience {
|
|||||||
&self,
|
&self,
|
||||||
input: PlayerProgressionGrantInput,
|
input: PlayerProgressionGrantInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -63,10 +61,8 @@ impl grant_player_progression_experience for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: PlayerProgressionGrantInput,
|
input: PlayerProgressionGrantInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::inventory_container_kind_type::InventoryContainerKind;
|
||||||
|
use super::inventory_equipment_slot_type::InventoryEquipmentSlot;
|
||||||
|
use super::inventory_item_rarity_type::InventoryItemRarity;
|
||||||
|
use super::inventory_item_source_kind_type::InventoryItemSourceKind;
|
||||||
|
use super::inventory_slot_type::InventorySlot;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `inventory_slot`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`InventorySlotTableAccess::inventory_slot`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.inventory_slot()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.inventory_slot().on_insert(...)`.
|
||||||
|
pub struct InventorySlotTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<InventorySlot>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `inventory_slot`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait InventorySlotTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`InventorySlotTableHandle`], which mediates access to the table `inventory_slot`.
|
||||||
|
fn inventory_slot(&self) -> InventorySlotTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl InventorySlotTableAccess for super::RemoteTables {
|
||||||
|
fn inventory_slot(&self) -> InventorySlotTableHandle<'_> {
|
||||||
|
InventorySlotTableHandle {
|
||||||
|
imp: self.imp.get_table::<InventorySlot>("inventory_slot"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct InventorySlotInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct InventorySlotDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for InventorySlotTableHandle<'ctx> {
|
||||||
|
type Row = InventorySlot;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = InventorySlot> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = InventorySlotInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> InventorySlotInsertCallbackId {
|
||||||
|
InventorySlotInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: InventorySlotInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = InventorySlotDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> InventorySlotDeleteCallbackId {
|
||||||
|
InventorySlotDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: InventorySlotDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct InventorySlotUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for InventorySlotTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = InventorySlotUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> InventorySlotUpdateCallbackId {
|
||||||
|
InventorySlotUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: InventorySlotUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `slot_id` unique index on the table `inventory_slot`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`InventorySlotSlotIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.inventory_slot().slot_id().find(...)`.
|
||||||
|
pub struct InventorySlotSlotIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<InventorySlot, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> InventorySlotTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `slot_id` unique index on the table `inventory_slot`.
|
||||||
|
pub fn slot_id(&self) -> InventorySlotSlotIdUnique<'ctx> {
|
||||||
|
InventorySlotSlotIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("slot_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> InventorySlotSlotIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `slot_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<InventorySlot> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<InventorySlot>("inventory_slot");
|
||||||
|
_table.add_unique_constraint::<String>("slot_id", |row| &row.slot_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<InventorySlot>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<InventorySlot>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `InventorySlot`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait inventory_slotQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `InventorySlot`.
|
||||||
|
fn inventory_slot(&self) -> __sdk::__query_builder::Table<InventorySlot>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl inventory_slotQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn inventory_slot(&self) -> __sdk::__query_builder::Table<InventorySlot> {
|
||||||
|
__sdk::__query_builder::Table::new("inventory_slot")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::match_3_d_agent_message_row_type::Match3DAgentMessageRow;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `match_3_d_agent_message`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`Match3DAgentMessageTableAccess::match_3_d_agent_message`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.match_3_d_agent_message()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.match_3_d_agent_message().on_insert(...)`.
|
||||||
|
pub struct Match3DAgentMessageTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<Match3DAgentMessageRow>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `match_3_d_agent_message`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait Match3DAgentMessageTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`Match3DAgentMessageTableHandle`], which mediates access to the table `match_3_d_agent_message`.
|
||||||
|
fn match_3_d_agent_message(&self) -> Match3DAgentMessageTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Match3DAgentMessageTableAccess for super::RemoteTables {
|
||||||
|
fn match_3_d_agent_message(&self) -> Match3DAgentMessageTableHandle<'_> {
|
||||||
|
Match3DAgentMessageTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<Match3DAgentMessageRow>("match_3_d_agent_message"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Match3DAgentMessageInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct Match3DAgentMessageDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for Match3DAgentMessageTableHandle<'ctx> {
|
||||||
|
type Row = Match3DAgentMessageRow;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = Match3DAgentMessageRow> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = Match3DAgentMessageInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DAgentMessageInsertCallbackId {
|
||||||
|
Match3DAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: Match3DAgentMessageInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = Match3DAgentMessageDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DAgentMessageDeleteCallbackId {
|
||||||
|
Match3DAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: Match3DAgentMessageDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Match3DAgentMessageUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for Match3DAgentMessageTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = Match3DAgentMessageUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DAgentMessageUpdateCallbackId {
|
||||||
|
Match3DAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: Match3DAgentMessageUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `message_id` unique index on the table `match_3_d_agent_message`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`Match3DAgentMessageMessageIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.match_3_d_agent_message().message_id().find(...)`.
|
||||||
|
pub struct Match3DAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<Match3DAgentMessageRow, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> Match3DAgentMessageTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `message_id` unique index on the table `match_3_d_agent_message`.
|
||||||
|
pub fn message_id(&self) -> Match3DAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
Match3DAgentMessageMessageIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("message_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> Match3DAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<Match3DAgentMessageRow> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<Match3DAgentMessageRow>("match_3_d_agent_message");
|
||||||
|
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<Match3DAgentMessageRow>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<Match3DAgentMessageRow>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `Match3DAgentMessageRow`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait match_3_d_agent_messageQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `Match3DAgentMessageRow`.
|
||||||
|
fn match_3_d_agent_message(&self) -> __sdk::__query_builder::Table<Match3DAgentMessageRow>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl match_3_d_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn match_3_d_agent_message(&self) -> __sdk::__query_builder::Table<Match3DAgentMessageRow> {
|
||||||
|
__sdk::__query_builder::Table::new("match_3_d_agent_message")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::match_3_d_agent_session_row_type::Match3DAgentSessionRow;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `match_3_d_agent_session`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`Match3DAgentSessionTableAccess::match_3_d_agent_session`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.match_3_d_agent_session()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.match_3_d_agent_session().on_insert(...)`.
|
||||||
|
pub struct Match3DAgentSessionTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<Match3DAgentSessionRow>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `match_3_d_agent_session`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait Match3DAgentSessionTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`Match3DAgentSessionTableHandle`], which mediates access to the table `match_3_d_agent_session`.
|
||||||
|
fn match_3_d_agent_session(&self) -> Match3DAgentSessionTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Match3DAgentSessionTableAccess for super::RemoteTables {
|
||||||
|
fn match_3_d_agent_session(&self) -> Match3DAgentSessionTableHandle<'_> {
|
||||||
|
Match3DAgentSessionTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<Match3DAgentSessionRow>("match_3_d_agent_session"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Match3DAgentSessionInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct Match3DAgentSessionDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for Match3DAgentSessionTableHandle<'ctx> {
|
||||||
|
type Row = Match3DAgentSessionRow;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = Match3DAgentSessionRow> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = Match3DAgentSessionInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DAgentSessionInsertCallbackId {
|
||||||
|
Match3DAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: Match3DAgentSessionInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = Match3DAgentSessionDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DAgentSessionDeleteCallbackId {
|
||||||
|
Match3DAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: Match3DAgentSessionDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Match3DAgentSessionUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for Match3DAgentSessionTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = Match3DAgentSessionUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DAgentSessionUpdateCallbackId {
|
||||||
|
Match3DAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: Match3DAgentSessionUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `session_id` unique index on the table `match_3_d_agent_session`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`Match3DAgentSessionSessionIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.match_3_d_agent_session().session_id().find(...)`.
|
||||||
|
pub struct Match3DAgentSessionSessionIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<Match3DAgentSessionRow, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> Match3DAgentSessionTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `session_id` unique index on the table `match_3_d_agent_session`.
|
||||||
|
pub fn session_id(&self) -> Match3DAgentSessionSessionIdUnique<'ctx> {
|
||||||
|
Match3DAgentSessionSessionIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("session_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> Match3DAgentSessionSessionIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<Match3DAgentSessionRow> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<Match3DAgentSessionRow>("match_3_d_agent_session");
|
||||||
|
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<Match3DAgentSessionRow>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<Match3DAgentSessionRow>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `Match3DAgentSessionRow`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait match_3_d_agent_sessionQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `Match3DAgentSessionRow`.
|
||||||
|
fn match_3_d_agent_session(&self) -> __sdk::__query_builder::Table<Match3DAgentSessionRow>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl match_3_d_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn match_3_d_agent_session(&self) -> __sdk::__query_builder::Table<Match3DAgentSessionRow> {
|
||||||
|
__sdk::__query_builder::Table::new("match_3_d_agent_session")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::match_3_d_runtime_run_row_type::Match3DRuntimeRunRow;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `match_3_d_runtime_run`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`Match3DRuntimeRunTableAccess::match_3_d_runtime_run`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.match_3_d_runtime_run()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.match_3_d_runtime_run().on_insert(...)`.
|
||||||
|
pub struct Match3DRuntimeRunTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<Match3DRuntimeRunRow>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `match_3_d_runtime_run`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait Match3DRuntimeRunTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`Match3DRuntimeRunTableHandle`], which mediates access to the table `match_3_d_runtime_run`.
|
||||||
|
fn match_3_d_runtime_run(&self) -> Match3DRuntimeRunTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Match3DRuntimeRunTableAccess for super::RemoteTables {
|
||||||
|
fn match_3_d_runtime_run(&self) -> Match3DRuntimeRunTableHandle<'_> {
|
||||||
|
Match3DRuntimeRunTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<Match3DRuntimeRunRow>("match_3_d_runtime_run"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Match3DRuntimeRunInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct Match3DRuntimeRunDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for Match3DRuntimeRunTableHandle<'ctx> {
|
||||||
|
type Row = Match3DRuntimeRunRow;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = Match3DRuntimeRunRow> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = Match3DRuntimeRunInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DRuntimeRunInsertCallbackId {
|
||||||
|
Match3DRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: Match3DRuntimeRunInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = Match3DRuntimeRunDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DRuntimeRunDeleteCallbackId {
|
||||||
|
Match3DRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: Match3DRuntimeRunDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Match3DRuntimeRunUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for Match3DRuntimeRunTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = Match3DRuntimeRunUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DRuntimeRunUpdateCallbackId {
|
||||||
|
Match3DRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: Match3DRuntimeRunUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `run_id` unique index on the table `match_3_d_runtime_run`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`Match3DRuntimeRunRunIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.match_3_d_runtime_run().run_id().find(...)`.
|
||||||
|
pub struct Match3DRuntimeRunRunIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<Match3DRuntimeRunRow, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> Match3DRuntimeRunTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `run_id` unique index on the table `match_3_d_runtime_run`.
|
||||||
|
pub fn run_id(&self) -> Match3DRuntimeRunRunIdUnique<'ctx> {
|
||||||
|
Match3DRuntimeRunRunIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("run_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> Match3DRuntimeRunRunIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `run_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<Match3DRuntimeRunRow> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<Match3DRuntimeRunRow>("match_3_d_runtime_run");
|
||||||
|
_table.add_unique_constraint::<String>("run_id", |row| &row.run_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<Match3DRuntimeRunRow>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<Match3DRuntimeRunRow>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `Match3DRuntimeRunRow`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait match_3_d_runtime_runQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `Match3DRuntimeRunRow`.
|
||||||
|
fn match_3_d_runtime_run(&self) -> __sdk::__query_builder::Table<Match3DRuntimeRunRow>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl match_3_d_runtime_runQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn match_3_d_runtime_run(&self) -> __sdk::__query_builder::Table<Match3DRuntimeRunRow> {
|
||||||
|
__sdk::__query_builder::Table::new("match_3_d_runtime_run")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::match_3_d_work_profile_row_type::Match3DWorkProfileRow;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `match_3_d_work_profile`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`Match3DWorkProfileTableAccess::match_3_d_work_profile`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.match_3_d_work_profile()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.match_3_d_work_profile().on_insert(...)`.
|
||||||
|
pub struct Match3DWorkProfileTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<Match3DWorkProfileRow>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `match_3_d_work_profile`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait Match3DWorkProfileTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`Match3DWorkProfileTableHandle`], which mediates access to the table `match_3_d_work_profile`.
|
||||||
|
fn match_3_d_work_profile(&self) -> Match3DWorkProfileTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Match3DWorkProfileTableAccess for super::RemoteTables {
|
||||||
|
fn match_3_d_work_profile(&self) -> Match3DWorkProfileTableHandle<'_> {
|
||||||
|
Match3DWorkProfileTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<Match3DWorkProfileRow>("match_3_d_work_profile"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Match3DWorkProfileInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct Match3DWorkProfileDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for Match3DWorkProfileTableHandle<'ctx> {
|
||||||
|
type Row = Match3DWorkProfileRow;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = Match3DWorkProfileRow> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = Match3DWorkProfileInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DWorkProfileInsertCallbackId {
|
||||||
|
Match3DWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: Match3DWorkProfileInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = Match3DWorkProfileDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DWorkProfileDeleteCallbackId {
|
||||||
|
Match3DWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: Match3DWorkProfileDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct Match3DWorkProfileUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for Match3DWorkProfileTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = Match3DWorkProfileUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> Match3DWorkProfileUpdateCallbackId {
|
||||||
|
Match3DWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: Match3DWorkProfileUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `profile_id` unique index on the table `match_3_d_work_profile`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`Match3DWorkProfileProfileIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.match_3_d_work_profile().profile_id().find(...)`.
|
||||||
|
pub struct Match3DWorkProfileProfileIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<Match3DWorkProfileRow, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> Match3DWorkProfileTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `profile_id` unique index on the table `match_3_d_work_profile`.
|
||||||
|
pub fn profile_id(&self) -> Match3DWorkProfileProfileIdUnique<'ctx> {
|
||||||
|
Match3DWorkProfileProfileIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("profile_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> Match3DWorkProfileProfileIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `profile_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<Match3DWorkProfileRow> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<Match3DWorkProfileRow>("match_3_d_work_profile");
|
||||||
|
_table.add_unique_constraint::<String>("profile_id", |row| &row.profile_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<Match3DWorkProfileRow>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<Match3DWorkProfileRow>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `Match3DWorkProfileRow`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait match_3_d_work_profileQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `Match3DWorkProfileRow`.
|
||||||
|
fn match_3_d_work_profile(&self) -> __sdk::__query_builder::Table<Match3DWorkProfileRow>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl match_3_d_work_profileQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn match_3_d_work_profile(&self) -> __sdk::__query_builder::Table<Match3DWorkProfileRow> {
|
||||||
|
__sdk::__query_builder::Table::new("match_3_d_work_profile")
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,161 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::npc_relation_state_type::NpcRelationState;
|
||||||
|
use super::npc_stance_profile_type::NpcStanceProfile;
|
||||||
|
use super::npc_state_type::NpcState;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `npc_state`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`NpcStateTableAccess::npc_state`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.npc_state()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.npc_state().on_insert(...)`.
|
||||||
|
pub struct NpcStateTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<NpcState>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `npc_state`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait NpcStateTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`NpcStateTableHandle`], which mediates access to the table `npc_state`.
|
||||||
|
fn npc_state(&self) -> NpcStateTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl NpcStateTableAccess for super::RemoteTables {
|
||||||
|
fn npc_state(&self) -> NpcStateTableHandle<'_> {
|
||||||
|
NpcStateTableHandle {
|
||||||
|
imp: self.imp.get_table::<NpcState>("npc_state"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct NpcStateInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct NpcStateDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for NpcStateTableHandle<'ctx> {
|
||||||
|
type Row = NpcState;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = NpcState> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = NpcStateInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> NpcStateInsertCallbackId {
|
||||||
|
NpcStateInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: NpcStateInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = NpcStateDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> NpcStateDeleteCallbackId {
|
||||||
|
NpcStateDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: NpcStateDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct NpcStateUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for NpcStateTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = NpcStateUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> NpcStateUpdateCallbackId {
|
||||||
|
NpcStateUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: NpcStateUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `npc_state_id` unique index on the table `npc_state`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`NpcStateNpcStateIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.npc_state().npc_state_id().find(...)`.
|
||||||
|
pub struct NpcStateNpcStateIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<NpcState, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> NpcStateTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `npc_state_id` unique index on the table `npc_state`.
|
||||||
|
pub fn npc_state_id(&self) -> NpcStateNpcStateIdUnique<'ctx> {
|
||||||
|
NpcStateNpcStateIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("npc_state_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> NpcStateNpcStateIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `npc_state_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<NpcState> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<NpcState>("npc_state");
|
||||||
|
_table.add_unique_constraint::<String>("npc_state_id", |row| &row.npc_state_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<NpcState>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<NpcState>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `NpcState`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait npc_stateQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `NpcState`.
|
||||||
|
fn npc_state(&self) -> __sdk::__query_builder::Table<NpcState>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl npc_stateQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn npc_state(&self) -> __sdk::__query_builder::Table<NpcState> {
|
||||||
|
__sdk::__query_builder::Table::new("npc_state")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::player_progression_grant_source_type::PlayerProgressionGrantSource;
|
||||||
|
use super::player_progression_type::PlayerProgression;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `player_progression`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`PlayerProgressionTableAccess::player_progression`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.player_progression()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.player_progression().on_insert(...)`.
|
||||||
|
pub struct PlayerProgressionTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<PlayerProgression>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `player_progression`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait PlayerProgressionTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`PlayerProgressionTableHandle`], which mediates access to the table `player_progression`.
|
||||||
|
fn player_progression(&self) -> PlayerProgressionTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PlayerProgressionTableAccess for super::RemoteTables {
|
||||||
|
fn player_progression(&self) -> PlayerProgressionTableHandle<'_> {
|
||||||
|
PlayerProgressionTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<PlayerProgression>("player_progression"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PlayerProgressionInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct PlayerProgressionDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for PlayerProgressionTableHandle<'ctx> {
|
||||||
|
type Row = PlayerProgression;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = PlayerProgression> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = PlayerProgressionInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PlayerProgressionInsertCallbackId {
|
||||||
|
PlayerProgressionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: PlayerProgressionInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = PlayerProgressionDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PlayerProgressionDeleteCallbackId {
|
||||||
|
PlayerProgressionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: PlayerProgressionDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PlayerProgressionUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for PlayerProgressionTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = PlayerProgressionUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> PlayerProgressionUpdateCallbackId {
|
||||||
|
PlayerProgressionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: PlayerProgressionUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `user_id` unique index on the table `player_progression`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`PlayerProgressionUserIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.player_progression().user_id().find(...)`.
|
||||||
|
pub struct PlayerProgressionUserIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<PlayerProgression, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PlayerProgressionTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `user_id` unique index on the table `player_progression`.
|
||||||
|
pub fn user_id(&self) -> PlayerProgressionUserIdUnique<'ctx> {
|
||||||
|
PlayerProgressionUserIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("user_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PlayerProgressionUserIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<PlayerProgression> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<PlayerProgression>("player_progression");
|
||||||
|
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<PlayerProgression>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<PlayerProgression>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `PlayerProgression`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait player_progressionQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `PlayerProgression`.
|
||||||
|
fn player_progression(&self) -> __sdk::__query_builder::Table<PlayerProgression>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl player_progressionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn player_progression(&self) -> __sdk::__query_builder::Table<PlayerProgression> {
|
||||||
|
__sdk::__query_builder::Table::new("player_progression")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_dashboard_state_type::ProfileDashboardState;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_dashboard_state`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileDashboardStateTableAccess::profile_dashboard_state`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_dashboard_state()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_dashboard_state().on_insert(...)`.
|
||||||
|
pub struct ProfileDashboardStateTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileDashboardState>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_dashboard_state`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileDashboardStateTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileDashboardStateTableHandle`], which mediates access to the table `profile_dashboard_state`.
|
||||||
|
fn profile_dashboard_state(&self) -> ProfileDashboardStateTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileDashboardStateTableAccess for super::RemoteTables {
|
||||||
|
fn profile_dashboard_state(&self) -> ProfileDashboardStateTableHandle<'_> {
|
||||||
|
ProfileDashboardStateTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileDashboardState>("profile_dashboard_state"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileDashboardStateInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileDashboardStateDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileDashboardStateTableHandle<'ctx> {
|
||||||
|
type Row = ProfileDashboardState;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileDashboardState> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileDashboardStateInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileDashboardStateInsertCallbackId {
|
||||||
|
ProfileDashboardStateInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileDashboardStateInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileDashboardStateDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileDashboardStateDeleteCallbackId {
|
||||||
|
ProfileDashboardStateDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileDashboardStateDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileDashboardStateUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileDashboardStateTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileDashboardStateUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileDashboardStateUpdateCallbackId {
|
||||||
|
ProfileDashboardStateUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileDashboardStateUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `user_id` unique index on the table `profile_dashboard_state`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileDashboardStateUserIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_dashboard_state().user_id().find(...)`.
|
||||||
|
pub struct ProfileDashboardStateUserIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileDashboardState, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileDashboardStateTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `user_id` unique index on the table `profile_dashboard_state`.
|
||||||
|
pub fn user_id(&self) -> ProfileDashboardStateUserIdUnique<'ctx> {
|
||||||
|
ProfileDashboardStateUserIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("user_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileDashboardStateUserIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileDashboardState> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<ProfileDashboardState>("profile_dashboard_state");
|
||||||
|
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileDashboardState>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileDashboardState>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileDashboardState`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_dashboard_stateQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileDashboardState`.
|
||||||
|
fn profile_dashboard_state(&self) -> __sdk::__query_builder::Table<ProfileDashboardState>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_dashboard_stateQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_dashboard_state(&self) -> __sdk::__query_builder::Table<ProfileDashboardState> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_dashboard_state")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,192 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_invite_code_type::ProfileInviteCode;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_invite_code`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileInviteCodeTableAccess::profile_invite_code`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_invite_code()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_invite_code().on_insert(...)`.
|
||||||
|
pub struct ProfileInviteCodeTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileInviteCode>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_invite_code`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileInviteCodeTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileInviteCodeTableHandle`], which mediates access to the table `profile_invite_code`.
|
||||||
|
fn profile_invite_code(&self) -> ProfileInviteCodeTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileInviteCodeTableAccess for super::RemoteTables {
|
||||||
|
fn profile_invite_code(&self) -> ProfileInviteCodeTableHandle<'_> {
|
||||||
|
ProfileInviteCodeTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileInviteCode>("profile_invite_code"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileInviteCodeInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileInviteCodeDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileInviteCodeTableHandle<'ctx> {
|
||||||
|
type Row = ProfileInviteCode;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileInviteCode> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileInviteCodeInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileInviteCodeInsertCallbackId {
|
||||||
|
ProfileInviteCodeInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileInviteCodeInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileInviteCodeDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileInviteCodeDeleteCallbackId {
|
||||||
|
ProfileInviteCodeDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileInviteCodeDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileInviteCodeUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileInviteCodeTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileInviteCodeUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileInviteCodeUpdateCallbackId {
|
||||||
|
ProfileInviteCodeUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileInviteCodeUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `user_id` unique index on the table `profile_invite_code`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileInviteCodeUserIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_invite_code().user_id().find(...)`.
|
||||||
|
pub struct ProfileInviteCodeUserIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileInviteCode, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileInviteCodeTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `user_id` unique index on the table `profile_invite_code`.
|
||||||
|
pub fn user_id(&self) -> ProfileInviteCodeUserIdUnique<'ctx> {
|
||||||
|
ProfileInviteCodeUserIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("user_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileInviteCodeUserIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileInviteCode> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `invite_code` unique index on the table `profile_invite_code`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileInviteCodeInviteCodeUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_invite_code().invite_code().find(...)`.
|
||||||
|
pub struct ProfileInviteCodeInviteCodeUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileInviteCode, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileInviteCodeTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `invite_code` unique index on the table `profile_invite_code`.
|
||||||
|
pub fn invite_code(&self) -> ProfileInviteCodeInviteCodeUnique<'ctx> {
|
||||||
|
ProfileInviteCodeInviteCodeUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("invite_code"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileInviteCodeInviteCodeUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `invite_code` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileInviteCode> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<ProfileInviteCode>("profile_invite_code");
|
||||||
|
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
|
||||||
|
_table.add_unique_constraint::<String>("invite_code", |row| &row.invite_code);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileInviteCode>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileInviteCode>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileInviteCode`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_invite_codeQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileInviteCode`.
|
||||||
|
fn profile_invite_code(&self) -> __sdk::__query_builder::Table<ProfileInviteCode>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_invite_codeQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_invite_code(&self) -> __sdk::__query_builder::Table<ProfileInviteCode> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_invite_code")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_membership_type::ProfileMembership;
|
||||||
|
use super::runtime_profile_membership_status_type::RuntimeProfileMembershipStatus;
|
||||||
|
use super::runtime_profile_membership_tier_type::RuntimeProfileMembershipTier;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_membership`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileMembershipTableAccess::profile_membership`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_membership()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_membership().on_insert(...)`.
|
||||||
|
pub struct ProfileMembershipTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileMembership>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_membership`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileMembershipTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileMembershipTableHandle`], which mediates access to the table `profile_membership`.
|
||||||
|
fn profile_membership(&self) -> ProfileMembershipTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileMembershipTableAccess for super::RemoteTables {
|
||||||
|
fn profile_membership(&self) -> ProfileMembershipTableHandle<'_> {
|
||||||
|
ProfileMembershipTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileMembership>("profile_membership"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileMembershipInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileMembershipDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileMembershipTableHandle<'ctx> {
|
||||||
|
type Row = ProfileMembership;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileMembership> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileMembershipInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileMembershipInsertCallbackId {
|
||||||
|
ProfileMembershipInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileMembershipInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileMembershipDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileMembershipDeleteCallbackId {
|
||||||
|
ProfileMembershipDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileMembershipDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileMembershipUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileMembershipTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileMembershipUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileMembershipUpdateCallbackId {
|
||||||
|
ProfileMembershipUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileMembershipUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `user_id` unique index on the table `profile_membership`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileMembershipUserIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_membership().user_id().find(...)`.
|
||||||
|
pub struct ProfileMembershipUserIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileMembership, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileMembershipTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `user_id` unique index on the table `profile_membership`.
|
||||||
|
pub fn user_id(&self) -> ProfileMembershipUserIdUnique<'ctx> {
|
||||||
|
ProfileMembershipUserIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("user_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileMembershipUserIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileMembership> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<ProfileMembership>("profile_membership");
|
||||||
|
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileMembership>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileMembership>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileMembership`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_membershipQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileMembership`.
|
||||||
|
fn profile_membership(&self) -> __sdk::__query_builder::Table<ProfileMembership>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_membershipQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_membership(&self) -> __sdk::__query_builder::Table<ProfileMembership> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_membership")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_played_world_type::ProfilePlayedWorld;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_played_world`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfilePlayedWorldTableAccess::profile_played_world`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_played_world()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_played_world().on_insert(...)`.
|
||||||
|
pub struct ProfilePlayedWorldTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfilePlayedWorld>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_played_world`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfilePlayedWorldTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfilePlayedWorldTableHandle`], which mediates access to the table `profile_played_world`.
|
||||||
|
fn profile_played_world(&self) -> ProfilePlayedWorldTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfilePlayedWorldTableAccess for super::RemoteTables {
|
||||||
|
fn profile_played_world(&self) -> ProfilePlayedWorldTableHandle<'_> {
|
||||||
|
ProfilePlayedWorldTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfilePlayedWorld>("profile_played_world"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfilePlayedWorldInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfilePlayedWorldDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfilePlayedWorldTableHandle<'ctx> {
|
||||||
|
type Row = ProfilePlayedWorld;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfilePlayedWorld> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfilePlayedWorldInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfilePlayedWorldInsertCallbackId {
|
||||||
|
ProfilePlayedWorldInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfilePlayedWorldInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfilePlayedWorldDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfilePlayedWorldDeleteCallbackId {
|
||||||
|
ProfilePlayedWorldDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfilePlayedWorldDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfilePlayedWorldUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfilePlayedWorldTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfilePlayedWorldUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfilePlayedWorldUpdateCallbackId {
|
||||||
|
ProfilePlayedWorldUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfilePlayedWorldUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `played_world_id` unique index on the table `profile_played_world`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfilePlayedWorldPlayedWorldIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_played_world().played_world_id().find(...)`.
|
||||||
|
pub struct ProfilePlayedWorldPlayedWorldIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfilePlayedWorld, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfilePlayedWorldTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `played_world_id` unique index on the table `profile_played_world`.
|
||||||
|
pub fn played_world_id(&self) -> ProfilePlayedWorldPlayedWorldIdUnique<'ctx> {
|
||||||
|
ProfilePlayedWorldPlayedWorldIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("played_world_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfilePlayedWorldPlayedWorldIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `played_world_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfilePlayedWorld> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<ProfilePlayedWorld>("profile_played_world");
|
||||||
|
_table.add_unique_constraint::<String>("played_world_id", |row| &row.played_world_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfilePlayedWorld>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfilePlayedWorld>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfilePlayedWorld`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_played_worldQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfilePlayedWorld`.
|
||||||
|
fn profile_played_world(&self) -> __sdk::__query_builder::Table<ProfilePlayedWorld>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_played_worldQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_played_world(&self) -> __sdk::__query_builder::Table<ProfilePlayedWorld> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_played_world")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_recharge_order_type::ProfileRechargeOrder;
|
||||||
|
use super::runtime_profile_recharge_order_status_type::RuntimeProfileRechargeOrderStatus;
|
||||||
|
use super::runtime_profile_recharge_product_kind_type::RuntimeProfileRechargeProductKind;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_recharge_order`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileRechargeOrderTableAccess::profile_recharge_order`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_recharge_order()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_recharge_order().on_insert(...)`.
|
||||||
|
pub struct ProfileRechargeOrderTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileRechargeOrder>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_recharge_order`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileRechargeOrderTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileRechargeOrderTableHandle`], which mediates access to the table `profile_recharge_order`.
|
||||||
|
fn profile_recharge_order(&self) -> ProfileRechargeOrderTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileRechargeOrderTableAccess for super::RemoteTables {
|
||||||
|
fn profile_recharge_order(&self) -> ProfileRechargeOrderTableHandle<'_> {
|
||||||
|
ProfileRechargeOrderTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileRechargeOrder>("profile_recharge_order"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileRechargeOrderInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileRechargeOrderDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileRechargeOrderTableHandle<'ctx> {
|
||||||
|
type Row = ProfileRechargeOrder;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileRechargeOrder> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileRechargeOrderInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileRechargeOrderInsertCallbackId {
|
||||||
|
ProfileRechargeOrderInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileRechargeOrderInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileRechargeOrderDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileRechargeOrderDeleteCallbackId {
|
||||||
|
ProfileRechargeOrderDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileRechargeOrderDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileRechargeOrderUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRechargeOrderTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileRechargeOrderUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileRechargeOrderUpdateCallbackId {
|
||||||
|
ProfileRechargeOrderUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileRechargeOrderUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `order_id` unique index on the table `profile_recharge_order`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileRechargeOrderOrderIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_recharge_order().order_id().find(...)`.
|
||||||
|
pub struct ProfileRechargeOrderOrderIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileRechargeOrder, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileRechargeOrderTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `order_id` unique index on the table `profile_recharge_order`.
|
||||||
|
pub fn order_id(&self) -> ProfileRechargeOrderOrderIdUnique<'ctx> {
|
||||||
|
ProfileRechargeOrderOrderIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("order_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileRechargeOrderOrderIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `order_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileRechargeOrder> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<ProfileRechargeOrder>("profile_recharge_order");
|
||||||
|
_table.add_unique_constraint::<String>("order_id", |row| &row.order_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileRechargeOrder>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileRechargeOrder>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileRechargeOrder`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_recharge_orderQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileRechargeOrder`.
|
||||||
|
fn profile_recharge_order(&self) -> __sdk::__query_builder::Table<ProfileRechargeOrder>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_recharge_orderQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_recharge_order(&self) -> __sdk::__query_builder::Table<ProfileRechargeOrder> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_recharge_order")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_redeem_code_type::ProfileRedeemCode;
|
||||||
|
use super::runtime_profile_redeem_code_mode_type::RuntimeProfileRedeemCodeMode;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_redeem_code`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileRedeemCodeTableAccess::profile_redeem_code`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_redeem_code()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_redeem_code().on_insert(...)`.
|
||||||
|
pub struct ProfileRedeemCodeTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileRedeemCode>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_redeem_code`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileRedeemCodeTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileRedeemCodeTableHandle`], which mediates access to the table `profile_redeem_code`.
|
||||||
|
fn profile_redeem_code(&self) -> ProfileRedeemCodeTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileRedeemCodeTableAccess for super::RemoteTables {
|
||||||
|
fn profile_redeem_code(&self) -> ProfileRedeemCodeTableHandle<'_> {
|
||||||
|
ProfileRedeemCodeTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileRedeemCode>("profile_redeem_code"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileRedeemCodeInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileRedeemCodeDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileRedeemCodeTableHandle<'ctx> {
|
||||||
|
type Row = ProfileRedeemCode;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileRedeemCode> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileRedeemCodeInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileRedeemCodeInsertCallbackId {
|
||||||
|
ProfileRedeemCodeInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileRedeemCodeInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileRedeemCodeDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileRedeemCodeDeleteCallbackId {
|
||||||
|
ProfileRedeemCodeDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileRedeemCodeDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileRedeemCodeUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRedeemCodeTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileRedeemCodeUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileRedeemCodeUpdateCallbackId {
|
||||||
|
ProfileRedeemCodeUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileRedeemCodeUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `code` unique index on the table `profile_redeem_code`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileRedeemCodeCodeUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_redeem_code().code().find(...)`.
|
||||||
|
pub struct ProfileRedeemCodeCodeUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileRedeemCode, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileRedeemCodeTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `code` unique index on the table `profile_redeem_code`.
|
||||||
|
pub fn code(&self) -> ProfileRedeemCodeCodeUnique<'ctx> {
|
||||||
|
ProfileRedeemCodeCodeUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("code"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileRedeemCodeCodeUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `code` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileRedeemCode> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<ProfileRedeemCode>("profile_redeem_code");
|
||||||
|
_table.add_unique_constraint::<String>("code", |row| &row.code);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileRedeemCode>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileRedeemCode>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileRedeemCode`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_redeem_codeQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileRedeemCode`.
|
||||||
|
fn profile_redeem_code(&self) -> __sdk::__query_builder::Table<ProfileRedeemCode>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_redeem_codeQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_redeem_code(&self) -> __sdk::__query_builder::Table<ProfileRedeemCode> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_redeem_code")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_redeem_code_usage_type::ProfileRedeemCodeUsage;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_redeem_code_usage`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileRedeemCodeUsageTableAccess::profile_redeem_code_usage`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_redeem_code_usage()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_redeem_code_usage().on_insert(...)`.
|
||||||
|
pub struct ProfileRedeemCodeUsageTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileRedeemCodeUsage>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_redeem_code_usage`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileRedeemCodeUsageTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileRedeemCodeUsageTableHandle`], which mediates access to the table `profile_redeem_code_usage`.
|
||||||
|
fn profile_redeem_code_usage(&self) -> ProfileRedeemCodeUsageTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileRedeemCodeUsageTableAccess for super::RemoteTables {
|
||||||
|
fn profile_redeem_code_usage(&self) -> ProfileRedeemCodeUsageTableHandle<'_> {
|
||||||
|
ProfileRedeemCodeUsageTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileRedeemCodeUsage>("profile_redeem_code_usage"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileRedeemCodeUsageInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileRedeemCodeUsageDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileRedeemCodeUsageTableHandle<'ctx> {
|
||||||
|
type Row = ProfileRedeemCodeUsage;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileRedeemCodeUsage> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileRedeemCodeUsageInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileRedeemCodeUsageInsertCallbackId {
|
||||||
|
ProfileRedeemCodeUsageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileRedeemCodeUsageInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileRedeemCodeUsageDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileRedeemCodeUsageDeleteCallbackId {
|
||||||
|
ProfileRedeemCodeUsageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileRedeemCodeUsageDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileRedeemCodeUsageUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileRedeemCodeUsageTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileRedeemCodeUsageUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileRedeemCodeUsageUpdateCallbackId {
|
||||||
|
ProfileRedeemCodeUsageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileRedeemCodeUsageUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `usage_id` unique index on the table `profile_redeem_code_usage`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileRedeemCodeUsageUsageIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_redeem_code_usage().usage_id().find(...)`.
|
||||||
|
pub struct ProfileRedeemCodeUsageUsageIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileRedeemCodeUsage, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileRedeemCodeUsageTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `usage_id` unique index on the table `profile_redeem_code_usage`.
|
||||||
|
pub fn usage_id(&self) -> ProfileRedeemCodeUsageUsageIdUnique<'ctx> {
|
||||||
|
ProfileRedeemCodeUsageUsageIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("usage_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileRedeemCodeUsageUsageIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `usage_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileRedeemCodeUsage> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<ProfileRedeemCodeUsage>("profile_redeem_code_usage");
|
||||||
|
_table.add_unique_constraint::<String>("usage_id", |row| &row.usage_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileRedeemCodeUsage>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileRedeemCodeUsage>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileRedeemCodeUsage`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_redeem_code_usageQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileRedeemCodeUsage`.
|
||||||
|
fn profile_redeem_code_usage(&self) -> __sdk::__query_builder::Table<ProfileRedeemCodeUsage>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_redeem_code_usageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_redeem_code_usage(&self) -> __sdk::__query_builder::Table<ProfileRedeemCodeUsage> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_redeem_code_usage")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_referral_relation_type::ProfileReferralRelation;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_referral_relation`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileReferralRelationTableAccess::profile_referral_relation`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_referral_relation()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_referral_relation().on_insert(...)`.
|
||||||
|
pub struct ProfileReferralRelationTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileReferralRelation>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_referral_relation`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileReferralRelationTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileReferralRelationTableHandle`], which mediates access to the table `profile_referral_relation`.
|
||||||
|
fn profile_referral_relation(&self) -> ProfileReferralRelationTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileReferralRelationTableAccess for super::RemoteTables {
|
||||||
|
fn profile_referral_relation(&self) -> ProfileReferralRelationTableHandle<'_> {
|
||||||
|
ProfileReferralRelationTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileReferralRelation>("profile_referral_relation"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileReferralRelationInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileReferralRelationDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileReferralRelationTableHandle<'ctx> {
|
||||||
|
type Row = ProfileReferralRelation;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileReferralRelation> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileReferralRelationInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileReferralRelationInsertCallbackId {
|
||||||
|
ProfileReferralRelationInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileReferralRelationInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileReferralRelationDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileReferralRelationDeleteCallbackId {
|
||||||
|
ProfileReferralRelationDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileReferralRelationDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileReferralRelationUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileReferralRelationTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileReferralRelationUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileReferralRelationUpdateCallbackId {
|
||||||
|
ProfileReferralRelationUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileReferralRelationUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `invitee_user_id` unique index on the table `profile_referral_relation`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileReferralRelationInviteeUserIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_referral_relation().invitee_user_id().find(...)`.
|
||||||
|
pub struct ProfileReferralRelationInviteeUserIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileReferralRelation, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileReferralRelationTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `invitee_user_id` unique index on the table `profile_referral_relation`.
|
||||||
|
pub fn invitee_user_id(&self) -> ProfileReferralRelationInviteeUserIdUnique<'ctx> {
|
||||||
|
ProfileReferralRelationInviteeUserIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("invitee_user_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileReferralRelationInviteeUserIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `invitee_user_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileReferralRelation> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<ProfileReferralRelation>("profile_referral_relation");
|
||||||
|
_table.add_unique_constraint::<String>("invitee_user_id", |row| &row.invitee_user_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileReferralRelation>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileReferralRelation>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileReferralRelation`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_referral_relationQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileReferralRelation`.
|
||||||
|
fn profile_referral_relation(&self) -> __sdk::__query_builder::Table<ProfileReferralRelation>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_referral_relationQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_referral_relation(&self) -> __sdk::__query_builder::Table<ProfileReferralRelation> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_referral_relation")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_save_archive_type::ProfileSaveArchive;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_save_archive`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileSaveArchiveTableAccess::profile_save_archive`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_save_archive()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_save_archive().on_insert(...)`.
|
||||||
|
pub struct ProfileSaveArchiveTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileSaveArchive>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_save_archive`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileSaveArchiveTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileSaveArchiveTableHandle`], which mediates access to the table `profile_save_archive`.
|
||||||
|
fn profile_save_archive(&self) -> ProfileSaveArchiveTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileSaveArchiveTableAccess for super::RemoteTables {
|
||||||
|
fn profile_save_archive(&self) -> ProfileSaveArchiveTableHandle<'_> {
|
||||||
|
ProfileSaveArchiveTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileSaveArchive>("profile_save_archive"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileSaveArchiveInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileSaveArchiveDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileSaveArchiveTableHandle<'ctx> {
|
||||||
|
type Row = ProfileSaveArchive;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileSaveArchive> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileSaveArchiveInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileSaveArchiveInsertCallbackId {
|
||||||
|
ProfileSaveArchiveInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileSaveArchiveInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileSaveArchiveDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileSaveArchiveDeleteCallbackId {
|
||||||
|
ProfileSaveArchiveDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileSaveArchiveDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileSaveArchiveUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileSaveArchiveTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileSaveArchiveUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileSaveArchiveUpdateCallbackId {
|
||||||
|
ProfileSaveArchiveUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileSaveArchiveUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `archive_id` unique index on the table `profile_save_archive`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileSaveArchiveArchiveIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_save_archive().archive_id().find(...)`.
|
||||||
|
pub struct ProfileSaveArchiveArchiveIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileSaveArchive, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileSaveArchiveTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `archive_id` unique index on the table `profile_save_archive`.
|
||||||
|
pub fn archive_id(&self) -> ProfileSaveArchiveArchiveIdUnique<'ctx> {
|
||||||
|
ProfileSaveArchiveArchiveIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("archive_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileSaveArchiveArchiveIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `archive_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileSaveArchive> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<ProfileSaveArchive>("profile_save_archive");
|
||||||
|
_table.add_unique_constraint::<String>("archive_id", |row| &row.archive_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileSaveArchive>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileSaveArchive>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileSaveArchive`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_save_archiveQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileSaveArchive`.
|
||||||
|
fn profile_save_archive(&self) -> __sdk::__query_builder::Table<ProfileSaveArchive>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_save_archiveQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_save_archive(&self) -> __sdk::__query_builder::Table<ProfileSaveArchive> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_save_archive")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_task_config_type::ProfileTaskConfig;
|
||||||
|
use super::runtime_profile_task_cycle_type::RuntimeProfileTaskCycle;
|
||||||
|
use super::runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_task_config`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileTaskConfigTableAccess::profile_task_config`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_task_config()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_task_config().on_insert(...)`.
|
||||||
|
pub struct ProfileTaskConfigTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileTaskConfig>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_task_config`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileTaskConfigTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileTaskConfigTableHandle`], which mediates access to the table `profile_task_config`.
|
||||||
|
fn profile_task_config(&self) -> ProfileTaskConfigTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileTaskConfigTableAccess for super::RemoteTables {
|
||||||
|
fn profile_task_config(&self) -> ProfileTaskConfigTableHandle<'_> {
|
||||||
|
ProfileTaskConfigTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileTaskConfig>("profile_task_config"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileTaskConfigInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileTaskConfigDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileTaskConfigTableHandle<'ctx> {
|
||||||
|
type Row = ProfileTaskConfig;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileTaskConfig> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileTaskConfigInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileTaskConfigInsertCallbackId {
|
||||||
|
ProfileTaskConfigInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileTaskConfigInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileTaskConfigDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileTaskConfigDeleteCallbackId {
|
||||||
|
ProfileTaskConfigDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileTaskConfigDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileTaskConfigUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskConfigTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileTaskConfigUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileTaskConfigUpdateCallbackId {
|
||||||
|
ProfileTaskConfigUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileTaskConfigUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `task_id` unique index on the table `profile_task_config`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileTaskConfigTaskIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_task_config().task_id().find(...)`.
|
||||||
|
pub struct ProfileTaskConfigTaskIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileTaskConfig, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileTaskConfigTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `task_id` unique index on the table `profile_task_config`.
|
||||||
|
pub fn task_id(&self) -> ProfileTaskConfigTaskIdUnique<'ctx> {
|
||||||
|
ProfileTaskConfigTaskIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("task_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileTaskConfigTaskIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `task_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileTaskConfig> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<ProfileTaskConfig>("profile_task_config");
|
||||||
|
_table.add_unique_constraint::<String>("task_id", |row| &row.task_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileTaskConfig>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileTaskConfig>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileTaskConfig`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_task_configQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileTaskConfig`.
|
||||||
|
fn profile_task_config(&self) -> __sdk::__query_builder::Table<ProfileTaskConfig>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_task_configQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_task_config(&self) -> __sdk::__query_builder::Table<ProfileTaskConfig> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_task_config")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_task_progress_type::ProfileTaskProgress;
|
||||||
|
use super::runtime_profile_task_status_type::RuntimeProfileTaskStatus;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_task_progress`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileTaskProgressTableAccess::profile_task_progress`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_task_progress()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_task_progress().on_insert(...)`.
|
||||||
|
pub struct ProfileTaskProgressTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileTaskProgress>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_task_progress`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileTaskProgressTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileTaskProgressTableHandle`], which mediates access to the table `profile_task_progress`.
|
||||||
|
fn profile_task_progress(&self) -> ProfileTaskProgressTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileTaskProgressTableAccess for super::RemoteTables {
|
||||||
|
fn profile_task_progress(&self) -> ProfileTaskProgressTableHandle<'_> {
|
||||||
|
ProfileTaskProgressTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileTaskProgress>("profile_task_progress"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileTaskProgressInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileTaskProgressDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileTaskProgressTableHandle<'ctx> {
|
||||||
|
type Row = ProfileTaskProgress;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileTaskProgress> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileTaskProgressInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileTaskProgressInsertCallbackId {
|
||||||
|
ProfileTaskProgressInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileTaskProgressInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileTaskProgressDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileTaskProgressDeleteCallbackId {
|
||||||
|
ProfileTaskProgressDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileTaskProgressDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileTaskProgressUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskProgressTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileTaskProgressUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileTaskProgressUpdateCallbackId {
|
||||||
|
ProfileTaskProgressUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileTaskProgressUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `progress_id` unique index on the table `profile_task_progress`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileTaskProgressProgressIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_task_progress().progress_id().find(...)`.
|
||||||
|
pub struct ProfileTaskProgressProgressIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileTaskProgress, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileTaskProgressTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `progress_id` unique index on the table `profile_task_progress`.
|
||||||
|
pub fn progress_id(&self) -> ProfileTaskProgressProgressIdUnique<'ctx> {
|
||||||
|
ProfileTaskProgressProgressIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("progress_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileTaskProgressProgressIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `progress_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileTaskProgress> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<ProfileTaskProgress>("profile_task_progress");
|
||||||
|
_table.add_unique_constraint::<String>("progress_id", |row| &row.progress_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileTaskProgress>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileTaskProgress>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileTaskProgress`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_task_progressQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileTaskProgress`.
|
||||||
|
fn profile_task_progress(&self) -> __sdk::__query_builder::Table<ProfileTaskProgress>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_task_progressQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_task_progress(&self) -> __sdk::__query_builder::Table<ProfileTaskProgress> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_task_progress")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_task_reward_claim_type::ProfileTaskRewardClaim;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_task_reward_claim`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileTaskRewardClaimTableAccess::profile_task_reward_claim`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_task_reward_claim()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_task_reward_claim().on_insert(...)`.
|
||||||
|
pub struct ProfileTaskRewardClaimTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileTaskRewardClaim>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_task_reward_claim`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileTaskRewardClaimTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileTaskRewardClaimTableHandle`], which mediates access to the table `profile_task_reward_claim`.
|
||||||
|
fn profile_task_reward_claim(&self) -> ProfileTaskRewardClaimTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileTaskRewardClaimTableAccess for super::RemoteTables {
|
||||||
|
fn profile_task_reward_claim(&self) -> ProfileTaskRewardClaimTableHandle<'_> {
|
||||||
|
ProfileTaskRewardClaimTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileTaskRewardClaim>("profile_task_reward_claim"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileTaskRewardClaimInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileTaskRewardClaimDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileTaskRewardClaimTableHandle<'ctx> {
|
||||||
|
type Row = ProfileTaskRewardClaim;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileTaskRewardClaim> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileTaskRewardClaimInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileTaskRewardClaimInsertCallbackId {
|
||||||
|
ProfileTaskRewardClaimInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileTaskRewardClaimInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileTaskRewardClaimDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileTaskRewardClaimDeleteCallbackId {
|
||||||
|
ProfileTaskRewardClaimDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileTaskRewardClaimDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileTaskRewardClaimUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileTaskRewardClaimTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileTaskRewardClaimUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileTaskRewardClaimUpdateCallbackId {
|
||||||
|
ProfileTaskRewardClaimUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileTaskRewardClaimUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `claim_id` unique index on the table `profile_task_reward_claim`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileTaskRewardClaimClaimIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_task_reward_claim().claim_id().find(...)`.
|
||||||
|
pub struct ProfileTaskRewardClaimClaimIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileTaskRewardClaim, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileTaskRewardClaimTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `claim_id` unique index on the table `profile_task_reward_claim`.
|
||||||
|
pub fn claim_id(&self) -> ProfileTaskRewardClaimClaimIdUnique<'ctx> {
|
||||||
|
ProfileTaskRewardClaimClaimIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("claim_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileTaskRewardClaimClaimIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `claim_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileTaskRewardClaim> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<ProfileTaskRewardClaim>("profile_task_reward_claim");
|
||||||
|
_table.add_unique_constraint::<String>("claim_id", |row| &row.claim_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileTaskRewardClaim>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileTaskRewardClaim>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileTaskRewardClaim`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_task_reward_claimQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileTaskRewardClaim`.
|
||||||
|
fn profile_task_reward_claim(&self) -> __sdk::__query_builder::Table<ProfileTaskRewardClaim>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_task_reward_claimQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_task_reward_claim(&self) -> __sdk::__query_builder::Table<ProfileTaskRewardClaim> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_task_reward_claim")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::profile_wallet_ledger_type::ProfileWalletLedger;
|
||||||
|
use super::runtime_profile_wallet_ledger_source_type_type::RuntimeProfileWalletLedgerSourceType;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `profile_wallet_ledger`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`ProfileWalletLedgerTableAccess::profile_wallet_ledger`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.profile_wallet_ledger()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_wallet_ledger().on_insert(...)`.
|
||||||
|
pub struct ProfileWalletLedgerTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<ProfileWalletLedger>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `profile_wallet_ledger`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait ProfileWalletLedgerTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`ProfileWalletLedgerTableHandle`], which mediates access to the table `profile_wallet_ledger`.
|
||||||
|
fn profile_wallet_ledger(&self) -> ProfileWalletLedgerTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ProfileWalletLedgerTableAccess for super::RemoteTables {
|
||||||
|
fn profile_wallet_ledger(&self) -> ProfileWalletLedgerTableHandle<'_> {
|
||||||
|
ProfileWalletLedgerTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<ProfileWalletLedger>("profile_wallet_ledger"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileWalletLedgerInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct ProfileWalletLedgerDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for ProfileWalletLedgerTableHandle<'ctx> {
|
||||||
|
type Row = ProfileWalletLedger;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = ProfileWalletLedger> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = ProfileWalletLedgerInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileWalletLedgerInsertCallbackId {
|
||||||
|
ProfileWalletLedgerInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: ProfileWalletLedgerInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = ProfileWalletLedgerDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileWalletLedgerDeleteCallbackId {
|
||||||
|
ProfileWalletLedgerDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: ProfileWalletLedgerDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct ProfileWalletLedgerUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for ProfileWalletLedgerTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = ProfileWalletLedgerUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> ProfileWalletLedgerUpdateCallbackId {
|
||||||
|
ProfileWalletLedgerUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: ProfileWalletLedgerUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `wallet_ledger_id` unique index on the table `profile_wallet_ledger`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`ProfileWalletLedgerWalletLedgerIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.profile_wallet_ledger().wallet_ledger_id().find(...)`.
|
||||||
|
pub struct ProfileWalletLedgerWalletLedgerIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<ProfileWalletLedger, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileWalletLedgerTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `wallet_ledger_id` unique index on the table `profile_wallet_ledger`.
|
||||||
|
pub fn wallet_ledger_id(&self) -> ProfileWalletLedgerWalletLedgerIdUnique<'ctx> {
|
||||||
|
ProfileWalletLedgerWalletLedgerIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("wallet_ledger_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> ProfileWalletLedgerWalletLedgerIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `wallet_ledger_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<ProfileWalletLedger> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<ProfileWalletLedger>("profile_wallet_ledger");
|
||||||
|
_table.add_unique_constraint::<String>("wallet_ledger_id", |row| &row.wallet_ledger_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<ProfileWalletLedger>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<ProfileWalletLedger>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `ProfileWalletLedger`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait profile_wallet_ledgerQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `ProfileWalletLedger`.
|
||||||
|
fn profile_wallet_ledger(&self) -> __sdk::__query_builder::Table<ProfileWalletLedger>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl profile_wallet_ledgerQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn profile_wallet_ledger(&self) -> __sdk::__query_builder::Table<ProfileWalletLedger> {
|
||||||
|
__sdk::__query_builder::Table::new("profile_wallet_ledger")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::public_work_like_type::PublicWorkLike;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `public_work_like`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`PublicWorkLikeTableAccess::public_work_like`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.public_work_like()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.public_work_like().on_insert(...)`.
|
||||||
|
pub struct PublicWorkLikeTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<PublicWorkLike>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `public_work_like`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait PublicWorkLikeTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`PublicWorkLikeTableHandle`], which mediates access to the table `public_work_like`.
|
||||||
|
fn public_work_like(&self) -> PublicWorkLikeTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PublicWorkLikeTableAccess for super::RemoteTables {
|
||||||
|
fn public_work_like(&self) -> PublicWorkLikeTableHandle<'_> {
|
||||||
|
PublicWorkLikeTableHandle {
|
||||||
|
imp: self.imp.get_table::<PublicWorkLike>("public_work_like"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PublicWorkLikeInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct PublicWorkLikeDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for PublicWorkLikeTableHandle<'ctx> {
|
||||||
|
type Row = PublicWorkLike;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = PublicWorkLike> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = PublicWorkLikeInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PublicWorkLikeInsertCallbackId {
|
||||||
|
PublicWorkLikeInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: PublicWorkLikeInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = PublicWorkLikeDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PublicWorkLikeDeleteCallbackId {
|
||||||
|
PublicWorkLikeDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: PublicWorkLikeDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PublicWorkLikeUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for PublicWorkLikeTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = PublicWorkLikeUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> PublicWorkLikeUpdateCallbackId {
|
||||||
|
PublicWorkLikeUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: PublicWorkLikeUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `like_id` unique index on the table `public_work_like`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`PublicWorkLikeLikeIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.public_work_like().like_id().find(...)`.
|
||||||
|
pub struct PublicWorkLikeLikeIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<PublicWorkLike, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PublicWorkLikeTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `like_id` unique index on the table `public_work_like`.
|
||||||
|
pub fn like_id(&self) -> PublicWorkLikeLikeIdUnique<'ctx> {
|
||||||
|
PublicWorkLikeLikeIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("like_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PublicWorkLikeLikeIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `like_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<PublicWorkLike> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<PublicWorkLike>("public_work_like");
|
||||||
|
_table.add_unique_constraint::<String>("like_id", |row| &row.like_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<PublicWorkLike>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<PublicWorkLike>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `PublicWorkLike`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait public_work_likeQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `PublicWorkLike`.
|
||||||
|
fn public_work_like(&self) -> __sdk::__query_builder::Table<PublicWorkLike>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl public_work_likeQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn public_work_like(&self) -> __sdk::__query_builder::Table<PublicWorkLike> {
|
||||||
|
__sdk::__query_builder::Table::new("public_work_like")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::public_work_play_daily_stat_type::PublicWorkPlayDailyStat;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `public_work_play_daily_stat`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`PublicWorkPlayDailyStatTableAccess::public_work_play_daily_stat`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.public_work_play_daily_stat()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.public_work_play_daily_stat().on_insert(...)`.
|
||||||
|
pub struct PublicWorkPlayDailyStatTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<PublicWorkPlayDailyStat>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `public_work_play_daily_stat`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait PublicWorkPlayDailyStatTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`PublicWorkPlayDailyStatTableHandle`], which mediates access to the table `public_work_play_daily_stat`.
|
||||||
|
fn public_work_play_daily_stat(&self) -> PublicWorkPlayDailyStatTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PublicWorkPlayDailyStatTableAccess for super::RemoteTables {
|
||||||
|
fn public_work_play_daily_stat(&self) -> PublicWorkPlayDailyStatTableHandle<'_> {
|
||||||
|
PublicWorkPlayDailyStatTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<PublicWorkPlayDailyStat>("public_work_play_daily_stat"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PublicWorkPlayDailyStatInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct PublicWorkPlayDailyStatDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for PublicWorkPlayDailyStatTableHandle<'ctx> {
|
||||||
|
type Row = PublicWorkPlayDailyStat;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = PublicWorkPlayDailyStat> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = PublicWorkPlayDailyStatInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PublicWorkPlayDailyStatInsertCallbackId {
|
||||||
|
PublicWorkPlayDailyStatInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: PublicWorkPlayDailyStatInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = PublicWorkPlayDailyStatDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PublicWorkPlayDailyStatDeleteCallbackId {
|
||||||
|
PublicWorkPlayDailyStatDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: PublicWorkPlayDailyStatDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PublicWorkPlayDailyStatUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for PublicWorkPlayDailyStatTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = PublicWorkPlayDailyStatUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> PublicWorkPlayDailyStatUpdateCallbackId {
|
||||||
|
PublicWorkPlayDailyStatUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: PublicWorkPlayDailyStatUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `stat_id` unique index on the table `public_work_play_daily_stat`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`PublicWorkPlayDailyStatStatIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.public_work_play_daily_stat().stat_id().find(...)`.
|
||||||
|
pub struct PublicWorkPlayDailyStatStatIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<PublicWorkPlayDailyStat, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PublicWorkPlayDailyStatTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `stat_id` unique index on the table `public_work_play_daily_stat`.
|
||||||
|
pub fn stat_id(&self) -> PublicWorkPlayDailyStatStatIdUnique<'ctx> {
|
||||||
|
PublicWorkPlayDailyStatStatIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("stat_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PublicWorkPlayDailyStatStatIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `stat_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<PublicWorkPlayDailyStat> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<PublicWorkPlayDailyStat>("public_work_play_daily_stat");
|
||||||
|
_table.add_unique_constraint::<String>("stat_id", |row| &row.stat_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<PublicWorkPlayDailyStat>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<PublicWorkPlayDailyStat>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `PublicWorkPlayDailyStat`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait public_work_play_daily_statQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `PublicWorkPlayDailyStat`.
|
||||||
|
fn public_work_play_daily_stat(&self)
|
||||||
|
-> __sdk::__query_builder::Table<PublicWorkPlayDailyStat>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl public_work_play_daily_statQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn public_work_play_daily_stat(
|
||||||
|
&self,
|
||||||
|
) -> __sdk::__query_builder::Table<PublicWorkPlayDailyStat> {
|
||||||
|
__sdk::__query_builder::Table::new("public_work_play_daily_stat")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -50,10 +50,8 @@ pub trait publish_custom_world_profile {
|
|||||||
&self,
|
&self,
|
||||||
input: CustomWorldProfilePublishInput,
|
input: CustomWorldProfilePublishInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -63,10 +61,8 @@ impl publish_custom_world_profile for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: CustomWorldProfilePublishInput,
|
input: CustomWorldProfilePublishInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::puzzle_agent_message_kind_type::PuzzleAgentMessageKind;
|
||||||
|
use super::puzzle_agent_message_role_type::PuzzleAgentMessageRole;
|
||||||
|
use super::puzzle_agent_message_row_type::PuzzleAgentMessageRow;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `puzzle_agent_message`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`PuzzleAgentMessageTableAccess::puzzle_agent_message`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.puzzle_agent_message()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.puzzle_agent_message().on_insert(...)`.
|
||||||
|
pub struct PuzzleAgentMessageTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<PuzzleAgentMessageRow>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `puzzle_agent_message`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait PuzzleAgentMessageTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`PuzzleAgentMessageTableHandle`], which mediates access to the table `puzzle_agent_message`.
|
||||||
|
fn puzzle_agent_message(&self) -> PuzzleAgentMessageTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PuzzleAgentMessageTableAccess for super::RemoteTables {
|
||||||
|
fn puzzle_agent_message(&self) -> PuzzleAgentMessageTableHandle<'_> {
|
||||||
|
PuzzleAgentMessageTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<PuzzleAgentMessageRow>("puzzle_agent_message"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PuzzleAgentMessageInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct PuzzleAgentMessageDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for PuzzleAgentMessageTableHandle<'ctx> {
|
||||||
|
type Row = PuzzleAgentMessageRow;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = PuzzleAgentMessageRow> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = PuzzleAgentMessageInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleAgentMessageInsertCallbackId {
|
||||||
|
PuzzleAgentMessageInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: PuzzleAgentMessageInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = PuzzleAgentMessageDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleAgentMessageDeleteCallbackId {
|
||||||
|
PuzzleAgentMessageDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: PuzzleAgentMessageDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PuzzleAgentMessageUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentMessageTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = PuzzleAgentMessageUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleAgentMessageUpdateCallbackId {
|
||||||
|
PuzzleAgentMessageUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: PuzzleAgentMessageUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `message_id` unique index on the table `puzzle_agent_message`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`PuzzleAgentMessageMessageIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.puzzle_agent_message().message_id().find(...)`.
|
||||||
|
pub struct PuzzleAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<PuzzleAgentMessageRow, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PuzzleAgentMessageTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `message_id` unique index on the table `puzzle_agent_message`.
|
||||||
|
pub fn message_id(&self) -> PuzzleAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
PuzzleAgentMessageMessageIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("message_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PuzzleAgentMessageMessageIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `message_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<PuzzleAgentMessageRow> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<PuzzleAgentMessageRow>("puzzle_agent_message");
|
||||||
|
_table.add_unique_constraint::<String>("message_id", |row| &row.message_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<PuzzleAgentMessageRow>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<PuzzleAgentMessageRow>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `PuzzleAgentMessageRow`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait puzzle_agent_messageQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `PuzzleAgentMessageRow`.
|
||||||
|
fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table<PuzzleAgentMessageRow>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl puzzle_agent_messageQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn puzzle_agent_message(&self) -> __sdk::__query_builder::Table<PuzzleAgentMessageRow> {
|
||||||
|
__sdk::__query_builder::Table::new("puzzle_agent_message")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::puzzle_agent_session_row_type::PuzzleAgentSessionRow;
|
||||||
|
use super::puzzle_agent_stage_type::PuzzleAgentStage;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `puzzle_agent_session`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`PuzzleAgentSessionTableAccess::puzzle_agent_session`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.puzzle_agent_session()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.puzzle_agent_session().on_insert(...)`.
|
||||||
|
pub struct PuzzleAgentSessionTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<PuzzleAgentSessionRow>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `puzzle_agent_session`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait PuzzleAgentSessionTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`PuzzleAgentSessionTableHandle`], which mediates access to the table `puzzle_agent_session`.
|
||||||
|
fn puzzle_agent_session(&self) -> PuzzleAgentSessionTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PuzzleAgentSessionTableAccess for super::RemoteTables {
|
||||||
|
fn puzzle_agent_session(&self) -> PuzzleAgentSessionTableHandle<'_> {
|
||||||
|
PuzzleAgentSessionTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<PuzzleAgentSessionRow>("puzzle_agent_session"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PuzzleAgentSessionInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct PuzzleAgentSessionDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for PuzzleAgentSessionTableHandle<'ctx> {
|
||||||
|
type Row = PuzzleAgentSessionRow;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = PuzzleAgentSessionRow> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = PuzzleAgentSessionInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleAgentSessionInsertCallbackId {
|
||||||
|
PuzzleAgentSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: PuzzleAgentSessionInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = PuzzleAgentSessionDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleAgentSessionDeleteCallbackId {
|
||||||
|
PuzzleAgentSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: PuzzleAgentSessionDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PuzzleAgentSessionUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleAgentSessionTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = PuzzleAgentSessionUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleAgentSessionUpdateCallbackId {
|
||||||
|
PuzzleAgentSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: PuzzleAgentSessionUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `session_id` unique index on the table `puzzle_agent_session`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`PuzzleAgentSessionSessionIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.puzzle_agent_session().session_id().find(...)`.
|
||||||
|
pub struct PuzzleAgentSessionSessionIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<PuzzleAgentSessionRow, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PuzzleAgentSessionTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `session_id` unique index on the table `puzzle_agent_session`.
|
||||||
|
pub fn session_id(&self) -> PuzzleAgentSessionSessionIdUnique<'ctx> {
|
||||||
|
PuzzleAgentSessionSessionIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("session_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PuzzleAgentSessionSessionIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<PuzzleAgentSessionRow> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<PuzzleAgentSessionRow>("puzzle_agent_session");
|
||||||
|
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<PuzzleAgentSessionRow>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<PuzzleAgentSessionRow>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `PuzzleAgentSessionRow`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait puzzle_agent_sessionQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `PuzzleAgentSessionRow`.
|
||||||
|
fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table<PuzzleAgentSessionRow>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl puzzle_agent_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn puzzle_agent_session(&self) -> __sdk::__query_builder::Table<PuzzleAgentSessionRow> {
|
||||||
|
__sdk::__query_builder::Table::new("puzzle_agent_session")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::puzzle_leaderboard_entry_row_type::PuzzleLeaderboardEntryRow;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `puzzle_leaderboard_entry`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`PuzzleLeaderboardEntryTableAccess::puzzle_leaderboard_entry`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.puzzle_leaderboard_entry()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.puzzle_leaderboard_entry().on_insert(...)`.
|
||||||
|
pub struct PuzzleLeaderboardEntryTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<PuzzleLeaderboardEntryRow>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `puzzle_leaderboard_entry`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait PuzzleLeaderboardEntryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`PuzzleLeaderboardEntryTableHandle`], which mediates access to the table `puzzle_leaderboard_entry`.
|
||||||
|
fn puzzle_leaderboard_entry(&self) -> PuzzleLeaderboardEntryTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PuzzleLeaderboardEntryTableAccess for super::RemoteTables {
|
||||||
|
fn puzzle_leaderboard_entry(&self) -> PuzzleLeaderboardEntryTableHandle<'_> {
|
||||||
|
PuzzleLeaderboardEntryTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<PuzzleLeaderboardEntryRow>("puzzle_leaderboard_entry"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PuzzleLeaderboardEntryInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct PuzzleLeaderboardEntryDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for PuzzleLeaderboardEntryTableHandle<'ctx> {
|
||||||
|
type Row = PuzzleLeaderboardEntryRow;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = PuzzleLeaderboardEntryRow> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = PuzzleLeaderboardEntryInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleLeaderboardEntryInsertCallbackId {
|
||||||
|
PuzzleLeaderboardEntryInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: PuzzleLeaderboardEntryInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = PuzzleLeaderboardEntryDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleLeaderboardEntryDeleteCallbackId {
|
||||||
|
PuzzleLeaderboardEntryDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: PuzzleLeaderboardEntryDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PuzzleLeaderboardEntryUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleLeaderboardEntryTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = PuzzleLeaderboardEntryUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleLeaderboardEntryUpdateCallbackId {
|
||||||
|
PuzzleLeaderboardEntryUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: PuzzleLeaderboardEntryUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `entry_id` unique index on the table `puzzle_leaderboard_entry`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`PuzzleLeaderboardEntryEntryIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.puzzle_leaderboard_entry().entry_id().find(...)`.
|
||||||
|
pub struct PuzzleLeaderboardEntryEntryIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<PuzzleLeaderboardEntryRow, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PuzzleLeaderboardEntryTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `entry_id` unique index on the table `puzzle_leaderboard_entry`.
|
||||||
|
pub fn entry_id(&self) -> PuzzleLeaderboardEntryEntryIdUnique<'ctx> {
|
||||||
|
PuzzleLeaderboardEntryEntryIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("entry_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PuzzleLeaderboardEntryEntryIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `entry_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<PuzzleLeaderboardEntryRow> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table =
|
||||||
|
client_cache.get_or_make_table::<PuzzleLeaderboardEntryRow>("puzzle_leaderboard_entry");
|
||||||
|
_table.add_unique_constraint::<String>("entry_id", |row| &row.entry_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<PuzzleLeaderboardEntryRow>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<PuzzleLeaderboardEntryRow>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `PuzzleLeaderboardEntryRow`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait puzzle_leaderboard_entryQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `PuzzleLeaderboardEntryRow`.
|
||||||
|
fn puzzle_leaderboard_entry(&self) -> __sdk::__query_builder::Table<PuzzleLeaderboardEntryRow>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl puzzle_leaderboard_entryQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn puzzle_leaderboard_entry(&self) -> __sdk::__query_builder::Table<PuzzleLeaderboardEntryRow> {
|
||||||
|
__sdk::__query_builder::Table::new("puzzle_leaderboard_entry")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::puzzle_runtime_run_row_type::PuzzleRuntimeRunRow;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `puzzle_runtime_run`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`PuzzleRuntimeRunTableAccess::puzzle_runtime_run`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.puzzle_runtime_run()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.puzzle_runtime_run().on_insert(...)`.
|
||||||
|
pub struct PuzzleRuntimeRunTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<PuzzleRuntimeRunRow>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `puzzle_runtime_run`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait PuzzleRuntimeRunTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`PuzzleRuntimeRunTableHandle`], which mediates access to the table `puzzle_runtime_run`.
|
||||||
|
fn puzzle_runtime_run(&self) -> PuzzleRuntimeRunTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PuzzleRuntimeRunTableAccess for super::RemoteTables {
|
||||||
|
fn puzzle_runtime_run(&self) -> PuzzleRuntimeRunTableHandle<'_> {
|
||||||
|
PuzzleRuntimeRunTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<PuzzleRuntimeRunRow>("puzzle_runtime_run"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PuzzleRuntimeRunInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct PuzzleRuntimeRunDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for PuzzleRuntimeRunTableHandle<'ctx> {
|
||||||
|
type Row = PuzzleRuntimeRunRow;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = PuzzleRuntimeRunRow> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = PuzzleRuntimeRunInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleRuntimeRunInsertCallbackId {
|
||||||
|
PuzzleRuntimeRunInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: PuzzleRuntimeRunInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = PuzzleRuntimeRunDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleRuntimeRunDeleteCallbackId {
|
||||||
|
PuzzleRuntimeRunDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: PuzzleRuntimeRunDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PuzzleRuntimeRunUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleRuntimeRunTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = PuzzleRuntimeRunUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleRuntimeRunUpdateCallbackId {
|
||||||
|
PuzzleRuntimeRunUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: PuzzleRuntimeRunUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `run_id` unique index on the table `puzzle_runtime_run`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`PuzzleRuntimeRunRunIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.puzzle_runtime_run().run_id().find(...)`.
|
||||||
|
pub struct PuzzleRuntimeRunRunIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<PuzzleRuntimeRunRow, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PuzzleRuntimeRunTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `run_id` unique index on the table `puzzle_runtime_run`.
|
||||||
|
pub fn run_id(&self) -> PuzzleRuntimeRunRunIdUnique<'ctx> {
|
||||||
|
PuzzleRuntimeRunRunIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("run_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PuzzleRuntimeRunRunIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `run_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<PuzzleRuntimeRunRow> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<PuzzleRuntimeRunRow>("puzzle_runtime_run");
|
||||||
|
_table.add_unique_constraint::<String>("run_id", |row| &row.run_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<PuzzleRuntimeRunRow>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<PuzzleRuntimeRunRow>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `PuzzleRuntimeRunRow`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait puzzle_runtime_runQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `PuzzleRuntimeRunRow`.
|
||||||
|
fn puzzle_runtime_run(&self) -> __sdk::__query_builder::Table<PuzzleRuntimeRunRow>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl puzzle_runtime_runQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn puzzle_runtime_run(&self) -> __sdk::__query_builder::Table<PuzzleRuntimeRunRow> {
|
||||||
|
__sdk::__query_builder::Table::new("puzzle_runtime_run")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::puzzle_publication_status_type::PuzzlePublicationStatus;
|
||||||
|
use super::puzzle_work_profile_row_type::PuzzleWorkProfileRow;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `puzzle_work_profile`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`PuzzleWorkProfileTableAccess::puzzle_work_profile`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.puzzle_work_profile()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.puzzle_work_profile().on_insert(...)`.
|
||||||
|
pub struct PuzzleWorkProfileTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<PuzzleWorkProfileRow>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `puzzle_work_profile`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait PuzzleWorkProfileTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`PuzzleWorkProfileTableHandle`], which mediates access to the table `puzzle_work_profile`.
|
||||||
|
fn puzzle_work_profile(&self) -> PuzzleWorkProfileTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PuzzleWorkProfileTableAccess for super::RemoteTables {
|
||||||
|
fn puzzle_work_profile(&self) -> PuzzleWorkProfileTableHandle<'_> {
|
||||||
|
PuzzleWorkProfileTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<PuzzleWorkProfileRow>("puzzle_work_profile"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PuzzleWorkProfileInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct PuzzleWorkProfileDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for PuzzleWorkProfileTableHandle<'ctx> {
|
||||||
|
type Row = PuzzleWorkProfileRow;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = PuzzleWorkProfileRow> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = PuzzleWorkProfileInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleWorkProfileInsertCallbackId {
|
||||||
|
PuzzleWorkProfileInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: PuzzleWorkProfileInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = PuzzleWorkProfileDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleWorkProfileDeleteCallbackId {
|
||||||
|
PuzzleWorkProfileDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: PuzzleWorkProfileDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct PuzzleWorkProfileUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for PuzzleWorkProfileTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = PuzzleWorkProfileUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> PuzzleWorkProfileUpdateCallbackId {
|
||||||
|
PuzzleWorkProfileUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: PuzzleWorkProfileUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `profile_id` unique index on the table `puzzle_work_profile`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`PuzzleWorkProfileProfileIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.puzzle_work_profile().profile_id().find(...)`.
|
||||||
|
pub struct PuzzleWorkProfileProfileIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<PuzzleWorkProfileRow, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PuzzleWorkProfileTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `profile_id` unique index on the table `puzzle_work_profile`.
|
||||||
|
pub fn profile_id(&self) -> PuzzleWorkProfileProfileIdUnique<'ctx> {
|
||||||
|
PuzzleWorkProfileProfileIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("profile_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> PuzzleWorkProfileProfileIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `profile_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<PuzzleWorkProfileRow> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<PuzzleWorkProfileRow>("puzzle_work_profile");
|
||||||
|
_table.add_unique_constraint::<String>("profile_id", |row| &row.profile_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<PuzzleWorkProfileRow>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<PuzzleWorkProfileRow>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `PuzzleWorkProfileRow`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait puzzle_work_profileQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `PuzzleWorkProfileRow`.
|
||||||
|
fn puzzle_work_profile(&self) -> __sdk::__query_builder::Table<PuzzleWorkProfileRow>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl puzzle_work_profileQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn puzzle_work_profile(&self) -> __sdk::__query_builder::Table<PuzzleWorkProfileRow> {
|
||||||
|
__sdk::__query_builder::Table::new("puzzle_work_profile")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::quest_log_event_kind_type::QuestLogEventKind;
|
||||||
|
use super::quest_log_type::QuestLog;
|
||||||
|
use super::quest_progress_signal_type::QuestProgressSignal;
|
||||||
|
use super::quest_signal_kind_type::QuestSignalKind;
|
||||||
|
use super::quest_status_type::QuestStatus;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `quest_log`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`QuestLogTableAccess::quest_log`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.quest_log()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.quest_log().on_insert(...)`.
|
||||||
|
pub struct QuestLogTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<QuestLog>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `quest_log`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait QuestLogTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`QuestLogTableHandle`], which mediates access to the table `quest_log`.
|
||||||
|
fn quest_log(&self) -> QuestLogTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl QuestLogTableAccess for super::RemoteTables {
|
||||||
|
fn quest_log(&self) -> QuestLogTableHandle<'_> {
|
||||||
|
QuestLogTableHandle {
|
||||||
|
imp: self.imp.get_table::<QuestLog>("quest_log"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct QuestLogInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct QuestLogDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for QuestLogTableHandle<'ctx> {
|
||||||
|
type Row = QuestLog;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = QuestLog> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = QuestLogInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> QuestLogInsertCallbackId {
|
||||||
|
QuestLogInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: QuestLogInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = QuestLogDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> QuestLogDeleteCallbackId {
|
||||||
|
QuestLogDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: QuestLogDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct QuestLogUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for QuestLogTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = QuestLogUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> QuestLogUpdateCallbackId {
|
||||||
|
QuestLogUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: QuestLogUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `log_id` unique index on the table `quest_log`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`QuestLogLogIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.quest_log().log_id().find(...)`.
|
||||||
|
pub struct QuestLogLogIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<QuestLog, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> QuestLogTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `log_id` unique index on the table `quest_log`.
|
||||||
|
pub fn log_id(&self) -> QuestLogLogIdUnique<'ctx> {
|
||||||
|
QuestLogLogIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("log_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> QuestLogLogIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `log_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<QuestLog> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<QuestLog>("quest_log");
|
||||||
|
_table.add_unique_constraint::<String>("log_id", |row| &row.log_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<QuestLog>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<QuestLog>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `QuestLog`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait quest_logQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `QuestLog`.
|
||||||
|
fn quest_log(&self) -> __sdk::__query_builder::Table<QuestLog>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl quest_logQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn quest_log(&self) -> __sdk::__query_builder::Table<QuestLog> {
|
||||||
|
__sdk::__query_builder::Table::new("quest_log")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::quest_narrative_binding_snapshot_type::QuestNarrativeBindingSnapshot;
|
||||||
|
use super::quest_objective_snapshot_type::QuestObjectiveSnapshot;
|
||||||
|
use super::quest_record_type::QuestRecord;
|
||||||
|
use super::quest_reward_snapshot_type::QuestRewardSnapshot;
|
||||||
|
use super::quest_status_type::QuestStatus;
|
||||||
|
use super::quest_step_snapshot_type::QuestStepSnapshot;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `quest_record`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`QuestRecordTableAccess::quest_record`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.quest_record()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.quest_record().on_insert(...)`.
|
||||||
|
pub struct QuestRecordTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<QuestRecord>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `quest_record`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait QuestRecordTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`QuestRecordTableHandle`], which mediates access to the table `quest_record`.
|
||||||
|
fn quest_record(&self) -> QuestRecordTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl QuestRecordTableAccess for super::RemoteTables {
|
||||||
|
fn quest_record(&self) -> QuestRecordTableHandle<'_> {
|
||||||
|
QuestRecordTableHandle {
|
||||||
|
imp: self.imp.get_table::<QuestRecord>("quest_record"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct QuestRecordInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct QuestRecordDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for QuestRecordTableHandle<'ctx> {
|
||||||
|
type Row = QuestRecord;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = QuestRecord> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = QuestRecordInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> QuestRecordInsertCallbackId {
|
||||||
|
QuestRecordInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: QuestRecordInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = QuestRecordDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> QuestRecordDeleteCallbackId {
|
||||||
|
QuestRecordDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: QuestRecordDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct QuestRecordUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for QuestRecordTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = QuestRecordUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> QuestRecordUpdateCallbackId {
|
||||||
|
QuestRecordUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: QuestRecordUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `quest_id` unique index on the table `quest_record`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`QuestRecordQuestIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.quest_record().quest_id().find(...)`.
|
||||||
|
pub struct QuestRecordQuestIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<QuestRecord, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> QuestRecordTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `quest_id` unique index on the table `quest_record`.
|
||||||
|
pub fn quest_id(&self) -> QuestRecordQuestIdUnique<'ctx> {
|
||||||
|
QuestRecordQuestIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("quest_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> QuestRecordQuestIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `quest_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<QuestRecord> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<QuestRecord>("quest_record");
|
||||||
|
_table.add_unique_constraint::<String>("quest_id", |row| &row.quest_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<QuestRecord>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<QuestRecord>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `QuestRecord`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait quest_recordQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `QuestRecord`.
|
||||||
|
fn quest_record(&self) -> __sdk::__query_builder::Table<QuestRecord>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl quest_recordQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn quest_record(&self) -> __sdk::__query_builder::Table<QuestRecord> {
|
||||||
|
__sdk::__query_builder::Table::new("quest_record")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::refresh_session_type::RefreshSession;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `refresh_session`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`RefreshSessionTableAccess::refresh_session`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.refresh_session()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.refresh_session().on_insert(...)`.
|
||||||
|
pub struct RefreshSessionTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<RefreshSession>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `refresh_session`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait RefreshSessionTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`RefreshSessionTableHandle`], which mediates access to the table `refresh_session`.
|
||||||
|
fn refresh_session(&self) -> RefreshSessionTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl RefreshSessionTableAccess for super::RemoteTables {
|
||||||
|
fn refresh_session(&self) -> RefreshSessionTableHandle<'_> {
|
||||||
|
RefreshSessionTableHandle {
|
||||||
|
imp: self.imp.get_table::<RefreshSession>("refresh_session"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct RefreshSessionInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct RefreshSessionDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for RefreshSessionTableHandle<'ctx> {
|
||||||
|
type Row = RefreshSession;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = RefreshSession> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = RefreshSessionInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> RefreshSessionInsertCallbackId {
|
||||||
|
RefreshSessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: RefreshSessionInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = RefreshSessionDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> RefreshSessionDeleteCallbackId {
|
||||||
|
RefreshSessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: RefreshSessionDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct RefreshSessionUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for RefreshSessionTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = RefreshSessionUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> RefreshSessionUpdateCallbackId {
|
||||||
|
RefreshSessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: RefreshSessionUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `session_id` unique index on the table `refresh_session`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`RefreshSessionSessionIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.refresh_session().session_id().find(...)`.
|
||||||
|
pub struct RefreshSessionSessionIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<RefreshSession, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> RefreshSessionTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `session_id` unique index on the table `refresh_session`.
|
||||||
|
pub fn session_id(&self) -> RefreshSessionSessionIdUnique<'ctx> {
|
||||||
|
RefreshSessionSessionIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("session_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> RefreshSessionSessionIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `session_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<RefreshSession> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<RefreshSession>("refresh_session");
|
||||||
|
_table.add_unique_constraint::<String>("session_id", |row| &row.session_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<RefreshSession>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<RefreshSession>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `RefreshSession`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait refresh_sessionQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `RefreshSession`.
|
||||||
|
fn refresh_session(&self) -> __sdk::__query_builder::Table<RefreshSession>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl refresh_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn refresh_session(&self) -> __sdk::__query_builder::Table<RefreshSession> {
|
||||||
|
__sdk::__query_builder::Table::new("refresh_session")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,10 +47,8 @@ pub trait resolve_combat_action {
|
|||||||
&self,
|
&self,
|
||||||
input: ResolveCombatActionInput,
|
input: ResolveCombatActionInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl resolve_combat_action for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: ResolveCombatActionInput,
|
input: ResolveCombatActionInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait resolve_npc_interaction {
|
|||||||
&self,
|
&self,
|
||||||
input: ResolveNpcInteractionInput,
|
input: ResolveNpcInteractionInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl resolve_npc_interaction for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: ResolveNpcInteractionInput,
|
input: ResolveNpcInteractionInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait resolve_npc_social_action {
|
|||||||
&self,
|
&self,
|
||||||
input: ResolveNpcSocialActionInput,
|
input: ResolveNpcSocialActionInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl resolve_npc_social_action for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: ResolveNpcSocialActionInput,
|
input: ResolveNpcSocialActionInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait resolve_treasure_interaction {
|
|||||||
&self,
|
&self,
|
||||||
input: TreasureResolveInput,
|
input: TreasureResolveInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl resolve_treasure_interaction for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: TreasureResolveInput,
|
input: TreasureResolveInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -0,0 +1,160 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::runtime_platform_theme_type::RuntimePlatformTheme;
|
||||||
|
use super::runtime_setting_type::RuntimeSetting;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `runtime_setting`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`RuntimeSettingTableAccess::runtime_setting`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.runtime_setting()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.runtime_setting().on_insert(...)`.
|
||||||
|
pub struct RuntimeSettingTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<RuntimeSetting>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `runtime_setting`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait RuntimeSettingTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`RuntimeSettingTableHandle`], which mediates access to the table `runtime_setting`.
|
||||||
|
fn runtime_setting(&self) -> RuntimeSettingTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl RuntimeSettingTableAccess for super::RemoteTables {
|
||||||
|
fn runtime_setting(&self) -> RuntimeSettingTableHandle<'_> {
|
||||||
|
RuntimeSettingTableHandle {
|
||||||
|
imp: self.imp.get_table::<RuntimeSetting>("runtime_setting"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct RuntimeSettingInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct RuntimeSettingDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for RuntimeSettingTableHandle<'ctx> {
|
||||||
|
type Row = RuntimeSetting;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = RuntimeSetting> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = RuntimeSettingInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> RuntimeSettingInsertCallbackId {
|
||||||
|
RuntimeSettingInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: RuntimeSettingInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = RuntimeSettingDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> RuntimeSettingDeleteCallbackId {
|
||||||
|
RuntimeSettingDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: RuntimeSettingDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct RuntimeSettingUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for RuntimeSettingTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = RuntimeSettingUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> RuntimeSettingUpdateCallbackId {
|
||||||
|
RuntimeSettingUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: RuntimeSettingUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `user_id` unique index on the table `runtime_setting`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`RuntimeSettingUserIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.runtime_setting().user_id().find(...)`.
|
||||||
|
pub struct RuntimeSettingUserIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<RuntimeSetting, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> RuntimeSettingTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `user_id` unique index on the table `runtime_setting`.
|
||||||
|
pub fn user_id(&self) -> RuntimeSettingUserIdUnique<'ctx> {
|
||||||
|
RuntimeSettingUserIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("user_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> RuntimeSettingUserIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<RuntimeSetting> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<RuntimeSetting>("runtime_setting");
|
||||||
|
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<RuntimeSetting>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<RuntimeSetting>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `RuntimeSetting`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait runtime_settingQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `RuntimeSetting`.
|
||||||
|
fn runtime_setting(&self) -> __sdk::__query_builder::Table<RuntimeSetting>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl runtime_settingQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn runtime_setting(&self) -> __sdk::__query_builder::Table<RuntimeSetting> {
|
||||||
|
__sdk::__query_builder::Table::new("runtime_setting")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,159 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::runtime_snapshot_row_type::RuntimeSnapshotRow;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `runtime_snapshot`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`RuntimeSnapshotTableAccess::runtime_snapshot`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.runtime_snapshot()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.runtime_snapshot().on_insert(...)`.
|
||||||
|
pub struct RuntimeSnapshotTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<RuntimeSnapshotRow>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `runtime_snapshot`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait RuntimeSnapshotTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`RuntimeSnapshotTableHandle`], which mediates access to the table `runtime_snapshot`.
|
||||||
|
fn runtime_snapshot(&self) -> RuntimeSnapshotTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl RuntimeSnapshotTableAccess for super::RemoteTables {
|
||||||
|
fn runtime_snapshot(&self) -> RuntimeSnapshotTableHandle<'_> {
|
||||||
|
RuntimeSnapshotTableHandle {
|
||||||
|
imp: self.imp.get_table::<RuntimeSnapshotRow>("runtime_snapshot"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct RuntimeSnapshotInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct RuntimeSnapshotDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for RuntimeSnapshotTableHandle<'ctx> {
|
||||||
|
type Row = RuntimeSnapshotRow;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = RuntimeSnapshotRow> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = RuntimeSnapshotInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> RuntimeSnapshotInsertCallbackId {
|
||||||
|
RuntimeSnapshotInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: RuntimeSnapshotInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = RuntimeSnapshotDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> RuntimeSnapshotDeleteCallbackId {
|
||||||
|
RuntimeSnapshotDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: RuntimeSnapshotDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct RuntimeSnapshotUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for RuntimeSnapshotTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = RuntimeSnapshotUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> RuntimeSnapshotUpdateCallbackId {
|
||||||
|
RuntimeSnapshotUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: RuntimeSnapshotUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `user_id` unique index on the table `runtime_snapshot`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`RuntimeSnapshotUserIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.runtime_snapshot().user_id().find(...)`.
|
||||||
|
pub struct RuntimeSnapshotUserIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<RuntimeSnapshotRow, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> RuntimeSnapshotTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `user_id` unique index on the table `runtime_snapshot`.
|
||||||
|
pub fn user_id(&self) -> RuntimeSnapshotUserIdUnique<'ctx> {
|
||||||
|
RuntimeSnapshotUserIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("user_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> RuntimeSnapshotUserIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<RuntimeSnapshotRow> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<RuntimeSnapshotRow>("runtime_snapshot");
|
||||||
|
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<RuntimeSnapshotRow>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<RuntimeSnapshotRow>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `RuntimeSnapshotRow`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait runtime_snapshotQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `RuntimeSnapshotRow`.
|
||||||
|
fn runtime_snapshot(&self) -> __sdk::__query_builder::Table<RuntimeSnapshotRow>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl runtime_snapshotQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn runtime_snapshot(&self) -> __sdk::__query_builder::Table<RuntimeSnapshotRow> {
|
||||||
|
__sdk::__query_builder::Table::new("runtime_snapshot")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
use super::analytics_date_dimension_seed_input_type::AnalyticsDateDimensionSeedInput;
|
||||||
|
|
||||||
|
#[derive(__lib::ser::Serialize, __lib::de::Deserialize, Clone, PartialEq, Debug)]
|
||||||
|
#[sats(crate = __lib)]
|
||||||
|
pub(super) struct SeedAnalyticsDateDimensionsArgs {
|
||||||
|
pub input: AnalyticsDateDimensionSeedInput,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl From<SeedAnalyticsDateDimensionsArgs> for super::Reducer {
|
||||||
|
fn from(args: SeedAnalyticsDateDimensionsArgs) -> Self {
|
||||||
|
Self::SeedAnalyticsDateDimensions { input: args.input }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl __sdk::InModule for SeedAnalyticsDateDimensionsArgs {
|
||||||
|
type Module = super::RemoteModule;
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the reducer `seed_analytics_date_dimensions`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteReducers`].
|
||||||
|
pub trait seed_analytics_date_dimensions {
|
||||||
|
/// Request that the remote module invoke the reducer `seed_analytics_date_dimensions` to run as soon as possible.
|
||||||
|
///
|
||||||
|
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||||
|
/// The reducer will run asynchronously in the future,
|
||||||
|
/// and this method provides no way to listen for its completion status.
|
||||||
|
/// /// Use [`seed_analytics_date_dimensions:seed_analytics_date_dimensions_then`] to run a callback after the reducer completes.
|
||||||
|
fn seed_analytics_date_dimensions(
|
||||||
|
&self,
|
||||||
|
input: AnalyticsDateDimensionSeedInput,
|
||||||
|
) -> __sdk::Result<()> {
|
||||||
|
self.seed_analytics_date_dimensions_then(input, |_, _| {})
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Request that the remote module invoke the reducer `seed_analytics_date_dimensions` to run as soon as possible,
|
||||||
|
/// registering `callback` to run when we are notified that the reducer completed.
|
||||||
|
///
|
||||||
|
/// This method returns immediately, and errors only if we are unable to send the request.
|
||||||
|
/// The reducer will run asynchronously in the future,
|
||||||
|
/// and its status can be observed with the `callback`.
|
||||||
|
fn seed_analytics_date_dimensions_then(
|
||||||
|
&self,
|
||||||
|
input: AnalyticsDateDimensionSeedInput,
|
||||||
|
|
||||||
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
|
+ Send
|
||||||
|
+ 'static,
|
||||||
|
) -> __sdk::Result<()>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl seed_analytics_date_dimensions for super::RemoteReducers {
|
||||||
|
fn seed_analytics_date_dimensions_then(
|
||||||
|
&self,
|
||||||
|
input: AnalyticsDateDimensionSeedInput,
|
||||||
|
|
||||||
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
|
+ Send
|
||||||
|
+ 'static,
|
||||||
|
) -> __sdk::Result<()> {
|
||||||
|
self.imp
|
||||||
|
.invoke_reducer_with_callback(SeedAnalyticsDateDimensionsArgs { input }, callback)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,10 +47,8 @@ pub trait start_ai_task {
|
|||||||
&self,
|
&self,
|
||||||
input: AiTaskStartInput,
|
input: AiTaskStartInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl start_ai_task for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: AiTaskStartInput,
|
input: AiTaskStartInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait start_ai_task_stage {
|
|||||||
&self,
|
&self,
|
||||||
input: AiTaskStageStartInput,
|
input: AiTaskStageStartInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl start_ai_task_stage for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: AiTaskStageStartInput,
|
input: AiTaskStageStartInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -0,0 +1,160 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::story_event_kind_type::StoryEventKind;
|
||||||
|
use super::story_event_type::StoryEvent;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `story_event`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`StoryEventTableAccess::story_event`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.story_event()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.story_event().on_insert(...)`.
|
||||||
|
pub struct StoryEventTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<StoryEvent>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `story_event`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait StoryEventTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`StoryEventTableHandle`], which mediates access to the table `story_event`.
|
||||||
|
fn story_event(&self) -> StoryEventTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl StoryEventTableAccess for super::RemoteTables {
|
||||||
|
fn story_event(&self) -> StoryEventTableHandle<'_> {
|
||||||
|
StoryEventTableHandle {
|
||||||
|
imp: self.imp.get_table::<StoryEvent>("story_event"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct StoryEventInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct StoryEventDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for StoryEventTableHandle<'ctx> {
|
||||||
|
type Row = StoryEvent;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = StoryEvent> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = StoryEventInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> StoryEventInsertCallbackId {
|
||||||
|
StoryEventInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: StoryEventInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = StoryEventDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> StoryEventDeleteCallbackId {
|
||||||
|
StoryEventDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: StoryEventDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct StoryEventUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for StoryEventTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = StoryEventUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> StoryEventUpdateCallbackId {
|
||||||
|
StoryEventUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: StoryEventUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `event_id` unique index on the table `story_event`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`StoryEventEventIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.story_event().event_id().find(...)`.
|
||||||
|
pub struct StoryEventEventIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<StoryEvent, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> StoryEventTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `event_id` unique index on the table `story_event`.
|
||||||
|
pub fn event_id(&self) -> StoryEventEventIdUnique<'ctx> {
|
||||||
|
StoryEventEventIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("event_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> StoryEventEventIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `event_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<StoryEvent> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<StoryEvent>("story_event");
|
||||||
|
_table.add_unique_constraint::<String>("event_id", |row| &row.event_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<StoryEvent>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<StoryEvent>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `StoryEvent`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait story_eventQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `StoryEvent`.
|
||||||
|
fn story_event(&self) -> __sdk::__query_builder::Table<StoryEvent>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl story_eventQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn story_event(&self) -> __sdk::__query_builder::Table<StoryEvent> {
|
||||||
|
__sdk::__query_builder::Table::new("story_event")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::story_session_status_type::StorySessionStatus;
|
||||||
|
use super::story_session_type::StorySession;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `story_session`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`StorySessionTableAccess::story_session`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.story_session()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.story_session().on_insert(...)`.
|
||||||
|
pub struct StorySessionTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<StorySession>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `story_session`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait StorySessionTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`StorySessionTableHandle`], which mediates access to the table `story_session`.
|
||||||
|
fn story_session(&self) -> StorySessionTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl StorySessionTableAccess for super::RemoteTables {
|
||||||
|
fn story_session(&self) -> StorySessionTableHandle<'_> {
|
||||||
|
StorySessionTableHandle {
|
||||||
|
imp: self.imp.get_table::<StorySession>("story_session"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct StorySessionInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct StorySessionDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for StorySessionTableHandle<'ctx> {
|
||||||
|
type Row = StorySession;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = StorySession> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = StorySessionInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> StorySessionInsertCallbackId {
|
||||||
|
StorySessionInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: StorySessionInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = StorySessionDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> StorySessionDeleteCallbackId {
|
||||||
|
StorySessionDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: StorySessionDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct StorySessionUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for StorySessionTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = StorySessionUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> StorySessionUpdateCallbackId {
|
||||||
|
StorySessionUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: StorySessionUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `story_session_id` unique index on the table `story_session`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`StorySessionStorySessionIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.story_session().story_session_id().find(...)`.
|
||||||
|
pub struct StorySessionStorySessionIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<StorySession, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> StorySessionTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `story_session_id` unique index on the table `story_session`.
|
||||||
|
pub fn story_session_id(&self) -> StorySessionStorySessionIdUnique<'ctx> {
|
||||||
|
StorySessionStorySessionIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("story_session_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> StorySessionStorySessionIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `story_session_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<StorySession> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<StorySession>("story_session");
|
||||||
|
_table.add_unique_constraint::<String>("story_session_id", |row| &row.story_session_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<StorySession>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<StorySession>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `StorySession`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait story_sessionQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `StorySession`.
|
||||||
|
fn story_session(&self) -> __sdk::__query_builder::Table<StorySession>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl story_sessionQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn story_session(&self) -> __sdk::__query_builder::Table<StorySession> {
|
||||||
|
__sdk::__query_builder::Table::new("story_session")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,162 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind;
|
||||||
|
use super::tracking_daily_stat_type::TrackingDailyStat;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `tracking_daily_stat`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`TrackingDailyStatTableAccess::tracking_daily_stat`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.tracking_daily_stat()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.tracking_daily_stat().on_insert(...)`.
|
||||||
|
pub struct TrackingDailyStatTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<TrackingDailyStat>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `tracking_daily_stat`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait TrackingDailyStatTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`TrackingDailyStatTableHandle`], which mediates access to the table `tracking_daily_stat`.
|
||||||
|
fn tracking_daily_stat(&self) -> TrackingDailyStatTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TrackingDailyStatTableAccess for super::RemoteTables {
|
||||||
|
fn tracking_daily_stat(&self) -> TrackingDailyStatTableHandle<'_> {
|
||||||
|
TrackingDailyStatTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<TrackingDailyStat>("tracking_daily_stat"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct TrackingDailyStatInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct TrackingDailyStatDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for TrackingDailyStatTableHandle<'ctx> {
|
||||||
|
type Row = TrackingDailyStat;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = TrackingDailyStat> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
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> {
|
||||||
|
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.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.tracking_daily_stat().stat_id().find(...)`.
|
||||||
|
pub struct TrackingDailyStatStatIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<TrackingDailyStat, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> TrackingDailyStatTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `stat_id` unique index on the table `tracking_daily_stat`.
|
||||||
|
pub fn stat_id(&self) -> TrackingDailyStatStatIdUnique<'ctx> {
|
||||||
|
TrackingDailyStatStatIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("stat_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> TrackingDailyStatStatIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `stat_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<TrackingDailyStat> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<TrackingDailyStat>("tracking_daily_stat");
|
||||||
|
_table.add_unique_constraint::<String>("stat_id", |row| &row.stat_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<TrackingDailyStat>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<TrackingDailyStat>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `TrackingDailyStat`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait tracking_daily_statQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `TrackingDailyStat`.
|
||||||
|
fn tracking_daily_stat(&self) -> __sdk::__query_builder::Table<TrackingDailyStat>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl tracking_daily_statQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn tracking_daily_stat(&self) -> __sdk::__query_builder::Table<TrackingDailyStat> {
|
||||||
|
__sdk::__query_builder::Table::new("tracking_daily_stat")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,160 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::runtime_tracking_scope_kind_type::RuntimeTrackingScopeKind;
|
||||||
|
use super::tracking_event_type::TrackingEvent;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `tracking_event`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`TrackingEventTableAccess::tracking_event`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.tracking_event()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.tracking_event().on_insert(...)`.
|
||||||
|
pub struct TrackingEventTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<TrackingEvent>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `tracking_event`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait TrackingEventTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`TrackingEventTableHandle`], which mediates access to the table `tracking_event`.
|
||||||
|
fn tracking_event(&self) -> TrackingEventTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TrackingEventTableAccess for super::RemoteTables {
|
||||||
|
fn tracking_event(&self) -> TrackingEventTableHandle<'_> {
|
||||||
|
TrackingEventTableHandle {
|
||||||
|
imp: self.imp.get_table::<TrackingEvent>("tracking_event"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct TrackingEventInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct TrackingEventDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for TrackingEventTableHandle<'ctx> {
|
||||||
|
type Row = TrackingEvent;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = TrackingEvent> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
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)
|
||||||
|
}
|
||||||
|
|
||||||
|
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> {
|
||||||
|
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.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.tracking_event().event_id().find(...)`.
|
||||||
|
pub struct TrackingEventEventIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<TrackingEvent, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> TrackingEventTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `event_id` unique index on the table `tracking_event`.
|
||||||
|
pub fn event_id(&self) -> TrackingEventEventIdUnique<'ctx> {
|
||||||
|
TrackingEventEventIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("event_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> TrackingEventEventIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `event_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<TrackingEvent> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<TrackingEvent>("tracking_event");
|
||||||
|
_table.add_unique_constraint::<String>("event_id", |row| &row.event_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<TrackingEvent>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<TrackingEvent>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `TrackingEvent`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait tracking_eventQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `TrackingEvent`.
|
||||||
|
fn tracking_event(&self) -> __sdk::__query_builder::Table<TrackingEvent>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl tracking_eventQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn tracking_event(&self) -> __sdk::__query_builder::Table<TrackingEvent> {
|
||||||
|
__sdk::__query_builder::Table::new("tracking_event")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::runtime_item_reward_item_snapshot_type::RuntimeItemRewardItemSnapshot;
|
||||||
|
use super::treasure_interaction_action_type::TreasureInteractionAction;
|
||||||
|
use super::treasure_record_type::TreasureRecord;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `treasure_record`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`TreasureRecordTableAccess::treasure_record`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.treasure_record()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.treasure_record().on_insert(...)`.
|
||||||
|
pub struct TreasureRecordTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<TreasureRecord>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `treasure_record`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait TreasureRecordTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`TreasureRecordTableHandle`], which mediates access to the table `treasure_record`.
|
||||||
|
fn treasure_record(&self) -> TreasureRecordTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl TreasureRecordTableAccess for super::RemoteTables {
|
||||||
|
fn treasure_record(&self) -> TreasureRecordTableHandle<'_> {
|
||||||
|
TreasureRecordTableHandle {
|
||||||
|
imp: self.imp.get_table::<TreasureRecord>("treasure_record"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct TreasureRecordInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct TreasureRecordDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for TreasureRecordTableHandle<'ctx> {
|
||||||
|
type Row = TreasureRecord;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = TreasureRecord> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = TreasureRecordInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> TreasureRecordInsertCallbackId {
|
||||||
|
TreasureRecordInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: TreasureRecordInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = TreasureRecordDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> TreasureRecordDeleteCallbackId {
|
||||||
|
TreasureRecordDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: TreasureRecordDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct TreasureRecordUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for TreasureRecordTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = TreasureRecordUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> TreasureRecordUpdateCallbackId {
|
||||||
|
TreasureRecordUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: TreasureRecordUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `treasure_record_id` unique index on the table `treasure_record`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`TreasureRecordTreasureRecordIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.treasure_record().treasure_record_id().find(...)`.
|
||||||
|
pub struct TreasureRecordTreasureRecordIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<TreasureRecord, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> TreasureRecordTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `treasure_record_id` unique index on the table `treasure_record`.
|
||||||
|
pub fn treasure_record_id(&self) -> TreasureRecordTreasureRecordIdUnique<'ctx> {
|
||||||
|
TreasureRecordTreasureRecordIdUnique {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_unique_constraint::<String>("treasure_record_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> TreasureRecordTreasureRecordIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `treasure_record_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<TreasureRecord> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<TreasureRecord>("treasure_record");
|
||||||
|
_table.add_unique_constraint::<String>("treasure_record_id", |row| &row.treasure_record_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<TreasureRecord>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<TreasureRecord>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `TreasureRecord`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait treasure_recordQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `TreasureRecord`.
|
||||||
|
fn treasure_record(&self) -> __sdk::__query_builder::Table<TreasureRecord>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl treasure_recordQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn treasure_record(&self) -> __sdk::__query_builder::Table<TreasureRecord> {
|
||||||
|
__sdk::__query_builder::Table::new("treasure_record")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,10 +47,8 @@ pub trait turn_in_quest {
|
|||||||
&self,
|
&self,
|
||||||
input: QuestTurnInInput,
|
input: QuestTurnInInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl turn_in_quest for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: QuestTurnInInput,
|
input: QuestTurnInInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -50,10 +50,8 @@ pub trait unpublish_custom_world_profile {
|
|||||||
&self,
|
&self,
|
||||||
input: CustomWorldProfileUnpublishInput,
|
input: CustomWorldProfileUnpublishInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -63,10 +61,8 @@ impl unpublish_custom_world_profile for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: CustomWorldProfileUnpublishInput,
|
input: CustomWorldProfileUnpublishInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait upsert_chapter_progression {
|
|||||||
&self,
|
&self,
|
||||||
input: ChapterProgressionInput,
|
input: ChapterProgressionInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl upsert_chapter_progression for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: ChapterProgressionInput,
|
input: ChapterProgressionInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -50,10 +50,8 @@ pub trait upsert_custom_world_profile {
|
|||||||
&self,
|
&self,
|
||||||
input: CustomWorldProfileUpsertInput,
|
input: CustomWorldProfileUpsertInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -63,10 +61,8 @@ impl upsert_custom_world_profile for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: CustomWorldProfileUpsertInput,
|
input: CustomWorldProfileUpsertInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -47,10 +47,8 @@ pub trait upsert_npc_state {
|
|||||||
&self,
|
&self,
|
||||||
input: NpcStateUpsertInput,
|
input: NpcStateUpsertInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()>;
|
) -> __sdk::Result<()>;
|
||||||
}
|
}
|
||||||
@@ -60,10 +58,8 @@ impl upsert_npc_state for super::RemoteReducers {
|
|||||||
&self,
|
&self,
|
||||||
input: NpcStateUpsertInput,
|
input: NpcStateUpsertInput,
|
||||||
|
|
||||||
callback: impl FnOnce(
|
callback: impl FnOnce(&super::ReducerEventContext, Result<Result<(), String>, __sdk::InternalError>)
|
||||||
&super::ReducerEventContext,
|
+ Send
|
||||||
Result<Result<(), String>, __sdk::InternalError>,
|
|
||||||
) + Send
|
|
||||||
+ 'static,
|
+ 'static,
|
||||||
) -> __sdk::Result<()> {
|
) -> __sdk::Result<()> {
|
||||||
self.imp
|
self.imp
|
||||||
|
|||||||
@@ -0,0 +1,159 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::user_account_type::UserAccount;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `user_account`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`UserAccountTableAccess::user_account`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.user_account()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.user_account().on_insert(...)`.
|
||||||
|
pub struct UserAccountTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<UserAccount>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `user_account`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait UserAccountTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`UserAccountTableHandle`], which mediates access to the table `user_account`.
|
||||||
|
fn user_account(&self) -> UserAccountTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl UserAccountTableAccess for super::RemoteTables {
|
||||||
|
fn user_account(&self) -> UserAccountTableHandle<'_> {
|
||||||
|
UserAccountTableHandle {
|
||||||
|
imp: self.imp.get_table::<UserAccount>("user_account"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct UserAccountInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct UserAccountDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for UserAccountTableHandle<'ctx> {
|
||||||
|
type Row = UserAccount;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = UserAccount> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = UserAccountInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> UserAccountInsertCallbackId {
|
||||||
|
UserAccountInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: UserAccountInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = UserAccountDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> UserAccountDeleteCallbackId {
|
||||||
|
UserAccountDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: UserAccountDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct UserAccountUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for UserAccountTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = UserAccountUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> UserAccountUpdateCallbackId {
|
||||||
|
UserAccountUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: UserAccountUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `user_id` unique index on the table `user_account`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`UserAccountUserIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.user_account().user_id().find(...)`.
|
||||||
|
pub struct UserAccountUserIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<UserAccount, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> UserAccountTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `user_id` unique index on the table `user_account`.
|
||||||
|
pub fn user_id(&self) -> UserAccountUserIdUnique<'ctx> {
|
||||||
|
UserAccountUserIdUnique {
|
||||||
|
imp: self.imp.get_unique_constraint::<String>("user_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> UserAccountUserIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `user_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<UserAccount> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<UserAccount>("user_account");
|
||||||
|
_table.add_unique_constraint::<String>("user_id", |row| &row.user_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<UserAccount>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<UserAccount>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `UserAccount`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait user_accountQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `UserAccount`.
|
||||||
|
fn user_account(&self) -> __sdk::__query_builder::Table<UserAccount>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl user_accountQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn user_account(&self) -> __sdk::__query_builder::Table<UserAccount> {
|
||||||
|
__sdk::__query_builder::Table::new("user_account")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
// THIS FILE IS AUTOMATICALLY GENERATED BY SPACETIMEDB. EDITS TO THIS FILE
|
||||||
|
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||||
|
|
||||||
|
#![allow(unused, clippy::all)]
|
||||||
|
use super::runtime_browse_history_theme_mode_type::RuntimeBrowseHistoryThemeMode;
|
||||||
|
use super::user_browse_history_type::UserBrowseHistory;
|
||||||
|
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||||
|
|
||||||
|
/// Table handle for the table `user_browse_history`.
|
||||||
|
///
|
||||||
|
/// Obtain a handle from the [`UserBrowseHistoryTableAccess::user_browse_history`] method on [`super::RemoteTables`],
|
||||||
|
/// like `ctx.db.user_browse_history()`.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.user_browse_history().on_insert(...)`.
|
||||||
|
pub struct UserBrowseHistoryTableHandle<'ctx> {
|
||||||
|
imp: __sdk::TableHandle<UserBrowseHistory>,
|
||||||
|
ctx: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for access to the table `user_browse_history`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`super::RemoteTables`].
|
||||||
|
pub trait UserBrowseHistoryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Obtain a [`UserBrowseHistoryTableHandle`], which mediates access to the table `user_browse_history`.
|
||||||
|
fn user_browse_history(&self) -> UserBrowseHistoryTableHandle<'_>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl UserBrowseHistoryTableAccess for super::RemoteTables {
|
||||||
|
fn user_browse_history(&self) -> UserBrowseHistoryTableHandle<'_> {
|
||||||
|
UserBrowseHistoryTableHandle {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_table::<UserBrowseHistory>("user_browse_history"),
|
||||||
|
ctx: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct UserBrowseHistoryInsertCallbackId(__sdk::CallbackId);
|
||||||
|
pub struct UserBrowseHistoryDeleteCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::Table for UserBrowseHistoryTableHandle<'ctx> {
|
||||||
|
type Row = UserBrowseHistory;
|
||||||
|
type EventContext = super::EventContext;
|
||||||
|
|
||||||
|
fn count(&self) -> u64 {
|
||||||
|
self.imp.count()
|
||||||
|
}
|
||||||
|
fn iter(&self) -> impl Iterator<Item = UserBrowseHistory> + '_ {
|
||||||
|
self.imp.iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
type InsertCallbackId = UserBrowseHistoryInsertCallbackId;
|
||||||
|
|
||||||
|
fn on_insert(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> UserBrowseHistoryInsertCallbackId {
|
||||||
|
UserBrowseHistoryInsertCallbackId(self.imp.on_insert(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_insert(&self, callback: UserBrowseHistoryInsertCallbackId) {
|
||||||
|
self.imp.remove_on_insert(callback.0)
|
||||||
|
}
|
||||||
|
|
||||||
|
type DeleteCallbackId = UserBrowseHistoryDeleteCallbackId;
|
||||||
|
|
||||||
|
fn on_delete(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row) + Send + 'static,
|
||||||
|
) -> UserBrowseHistoryDeleteCallbackId {
|
||||||
|
UserBrowseHistoryDeleteCallbackId(self.imp.on_delete(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_delete(&self, callback: UserBrowseHistoryDeleteCallbackId) {
|
||||||
|
self.imp.remove_on_delete(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub struct UserBrowseHistoryUpdateCallbackId(__sdk::CallbackId);
|
||||||
|
|
||||||
|
impl<'ctx> __sdk::TableWithPrimaryKey for UserBrowseHistoryTableHandle<'ctx> {
|
||||||
|
type UpdateCallbackId = UserBrowseHistoryUpdateCallbackId;
|
||||||
|
|
||||||
|
fn on_update(
|
||||||
|
&self,
|
||||||
|
callback: impl FnMut(&Self::EventContext, &Self::Row, &Self::Row) + Send + 'static,
|
||||||
|
) -> UserBrowseHistoryUpdateCallbackId {
|
||||||
|
UserBrowseHistoryUpdateCallbackId(self.imp.on_update(Box::new(callback)))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn remove_on_update(&self, callback: UserBrowseHistoryUpdateCallbackId) {
|
||||||
|
self.imp.remove_on_update(callback.0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Access to the `browse_history_id` unique index on the table `user_browse_history`,
|
||||||
|
/// which allows point queries on the field of the same name
|
||||||
|
/// via the [`UserBrowseHistoryBrowseHistoryIdUnique::find`] method.
|
||||||
|
///
|
||||||
|
/// Users are encouraged not to explicitly reference this type,
|
||||||
|
/// but to directly chain method calls,
|
||||||
|
/// like `ctx.db.user_browse_history().browse_history_id().find(...)`.
|
||||||
|
pub struct UserBrowseHistoryBrowseHistoryIdUnique<'ctx> {
|
||||||
|
imp: __sdk::UniqueConstraintHandle<UserBrowseHistory, String>,
|
||||||
|
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> UserBrowseHistoryTableHandle<'ctx> {
|
||||||
|
/// Get a handle on the `browse_history_id` unique index on the table `user_browse_history`.
|
||||||
|
pub fn browse_history_id(&self) -> UserBrowseHistoryBrowseHistoryIdUnique<'ctx> {
|
||||||
|
UserBrowseHistoryBrowseHistoryIdUnique {
|
||||||
|
imp: self
|
||||||
|
.imp
|
||||||
|
.get_unique_constraint::<String>("browse_history_id"),
|
||||||
|
phantom: std::marker::PhantomData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<'ctx> UserBrowseHistoryBrowseHistoryIdUnique<'ctx> {
|
||||||
|
/// Find the subscribed row whose `browse_history_id` column value is equal to `col_val`,
|
||||||
|
/// if such a row is present in the client cache.
|
||||||
|
pub fn find(&self, col_val: &String) -> Option<UserBrowseHistory> {
|
||||||
|
self.imp.find(col_val)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||||
|
let _table = client_cache.get_or_make_table::<UserBrowseHistory>("user_browse_history");
|
||||||
|
_table.add_unique_constraint::<String>("browse_history_id", |row| &row.browse_history_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[doc(hidden)]
|
||||||
|
pub(super) fn parse_table_update(
|
||||||
|
raw_updates: __ws::v2::TableUpdate,
|
||||||
|
) -> __sdk::Result<__sdk::TableUpdate<UserBrowseHistory>> {
|
||||||
|
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||||
|
__sdk::InternalError::failed_parse("TableUpdate<UserBrowseHistory>", "TableUpdate")
|
||||||
|
.with_cause(e)
|
||||||
|
.into()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(non_camel_case_types)]
|
||||||
|
/// Extension trait for query builder access to the table `UserBrowseHistory`.
|
||||||
|
///
|
||||||
|
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||||
|
pub trait user_browse_historyQueryTableAccess {
|
||||||
|
#[allow(non_snake_case)]
|
||||||
|
/// Get a query builder for the table `UserBrowseHistory`.
|
||||||
|
fn user_browse_history(&self) -> __sdk::__query_builder::Table<UserBrowseHistory>;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl user_browse_historyQueryTableAccess for __sdk::QueryTableAccessor {
|
||||||
|
fn user_browse_history(&self) -> __sdk::__query_builder::Table<UserBrowseHistory> {
|
||||||
|
__sdk::__query_builder::Table::new("user_browse_history")
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user