feat: add analytics date dimension bindings
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:
2026-05-04 13:41:22 +08:00
committed by 历冰郁-hermes版
parent 9f3e34e81a
commit 5c7c039e52
253 changed files with 14783 additions and 1462 deletions

View File

@@ -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。
```
### 风险 2Work 维度缺少 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/用户本地时区。
### 风险 4ISO 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 聚合。这样比直接新增四张独立映射表更稳定、更容易复用,也更容易处理跨年周、季度边界和历史回填。

View 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` 元数据,但页面不再允许运营修改。

View File

@@ -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。

View 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`

View File

@@ -142,6 +142,7 @@ function buildGenerateArgs(target, outDir) {
outDir, outDir,
'--module-path', '--module-path',
MODULE_PATH, MODULE_PATH,
'--include-private',
'--yes', '--yes',
]; ];

View File

@@ -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)
);
}

View 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);
}

View File

@@ -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));
}

View File

@@ -47,11 +47,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -60,11 +58,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp self.imp
.invoke_reducer_with_callback(AcceptQuestArgs { input }, callback) .invoke_reducer_with_callback(AcceptQuestArgs { input }, callback)

View File

@@ -47,11 +47,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -60,11 +58,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp self.imp
.invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input }, callback) .invoke_reducer_with_callback(AcknowledgeQuestCompletionArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait admin_disable_profile_redeem_code {
input: RuntimeProfileRedeemCodeAdminDisableInput, input: RuntimeProfileRedeemCodeAdminDisableInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>, Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl admin_disable_profile_redeem_code for super::RemoteProcedures {
input: RuntimeProfileRedeemCodeAdminDisableInput, input: RuntimeProfileRedeemCodeAdminDisableInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>, Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_disable_profile_task_config {
input: RuntimeProfileTaskConfigAdminDisableInput, input: RuntimeProfileTaskConfigAdminDisableInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>, Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl admin_disable_profile_task_config for super::RemoteProcedures {
input: RuntimeProfileTaskConfigAdminDisableInput, input: RuntimeProfileTaskConfigAdminDisableInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>, Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_list_profile_invite_codes {
input: RuntimeProfileInviteCodeAdminListInput, input: RuntimeProfileInviteCodeAdminListInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminListProcedureResult, __sdk::InternalError>, Result<RuntimeProfileInviteCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl admin_list_profile_invite_codes for super::RemoteProcedures {
input: RuntimeProfileInviteCodeAdminListInput, input: RuntimeProfileInviteCodeAdminListInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminListProcedureResult, __sdk::InternalError>, Result<RuntimeProfileInviteCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileInviteCodeAdminListProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeProfileInviteCodeAdminListProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_list_profile_redeem_codes {
input: RuntimeProfileRedeemCodeAdminListInput, input: RuntimeProfileRedeemCodeAdminListInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminListProcedureResult, __sdk::InternalError>, Result<RuntimeProfileRedeemCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl admin_list_profile_redeem_codes for super::RemoteProcedures {
input: RuntimeProfileRedeemCodeAdminListInput, input: RuntimeProfileRedeemCodeAdminListInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminListProcedureResult, __sdk::InternalError>, Result<RuntimeProfileRedeemCodeAdminListProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminListProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminListProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_list_profile_task_configs {
input: RuntimeProfileTaskConfigAdminListInput, input: RuntimeProfileTaskConfigAdminListInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminListProcedureResult, __sdk::InternalError>, Result<RuntimeProfileTaskConfigAdminListProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl admin_list_profile_task_configs for super::RemoteProcedures {
input: RuntimeProfileTaskConfigAdminListInput, input: RuntimeProfileTaskConfigAdminListInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminListProcedureResult, __sdk::InternalError>, Result<RuntimeProfileTaskConfigAdminListProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminListProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminListProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_upsert_profile_invite_code {
input: RuntimeProfileInviteCodeAdminUpsertInput, input: RuntimeProfileInviteCodeAdminUpsertInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminProcedureResult, __sdk::InternalError>, Result<RuntimeProfileInviteCodeAdminProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl admin_upsert_profile_invite_code for super::RemoteProcedures {
input: RuntimeProfileInviteCodeAdminUpsertInput, input: RuntimeProfileInviteCodeAdminUpsertInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileInviteCodeAdminProcedureResult, __sdk::InternalError>, Result<RuntimeProfileInviteCodeAdminProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileInviteCodeAdminProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeProfileInviteCodeAdminProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_upsert_profile_redeem_code {
input: RuntimeProfileRedeemCodeAdminUpsertInput, input: RuntimeProfileRedeemCodeAdminUpsertInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>, Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl admin_upsert_profile_redeem_code for super::RemoteProcedures {
input: RuntimeProfileRedeemCodeAdminUpsertInput, input: RuntimeProfileRedeemCodeAdminUpsertInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>, Result<RuntimeProfileRedeemCodeAdminProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeProfileRedeemCodeAdminProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait admin_upsert_profile_task_config {
input: RuntimeProfileTaskConfigAdminUpsertInput, input: RuntimeProfileTaskConfigAdminUpsertInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>, Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl admin_upsert_profile_task_config for super::RemoteProcedures {
input: RuntimeProfileTaskConfigAdminUpsertInput, input: RuntimeProfileTaskConfigAdminUpsertInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>, Result<RuntimeProfileTaskConfigAdminProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeProfileTaskConfigAdminProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait advance_puzzle_next_level {
input: PuzzleRunNextLevelInput, input: PuzzleRunNextLevelInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleRunProcedureResult, __sdk::InternalError>, Result<PuzzleRunProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl advance_puzzle_next_level for super::RemoteProcedures {
input: PuzzleRunNextLevelInput, input: PuzzleRunNextLevelInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleRunProcedureResult, __sdk::InternalError>, Result<PuzzleRunProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -31,10 +31,10 @@ pub trait append_ai_text_chunk_and_return {
input: AiTextChunkAppendInput, input: AiTextChunkAppendInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl append_ai_text_chunk_and_return for super::RemoteProcedures {
input: AiTextChunkAppendInput, input: AiTextChunkAppendInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( .invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait apply_chapter_progression_ledger_entry_and_return {
input: ChapterProgressionLedgerInput, input: ChapterProgressionLedgerInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<ChapterProgressionProcedureResult, __sdk::InternalError>, Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -47,10 +47,10 @@ impl apply_chapter_progression_ledger_entry_and_return for super::RemoteProcedur
input: ChapterProgressionLedgerInput, input: ChapterProgressionLedgerInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<ChapterProgressionProcedureResult, __sdk::InternalError>, Result<ChapterProgressionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>( .invoke_procedure_with_callback::<_, ChapterProgressionProcedureResult>(

View File

@@ -50,11 +50,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -63,11 +61,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp.invoke_reducer_with_callback( self.imp.invoke_reducer_with_callback(
ApplyChapterProgressionLedgerEntryArgs { input }, ApplyChapterProgressionLedgerEntryArgs { input },

View File

@@ -47,11 +47,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -60,11 +58,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp self.imp
.invoke_reducer_with_callback(ApplyInventoryMutationArgs { input }, callback) .invoke_reducer_with_callback(ApplyInventoryMutationArgs { input }, callback)

View File

@@ -47,11 +47,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -60,11 +58,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp self.imp
.invoke_reducer_with_callback(ApplyQuestSignalArgs { input }, callback) .invoke_reducer_with_callback(ApplyQuestSignalArgs { input }, callback)

View File

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

View File

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

View File

@@ -31,10 +31,10 @@ pub trait attach_ai_result_reference_and_return {
input: AiResultReferenceInput, input: AiResultReferenceInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl attach_ai_result_reference_and_return for super::RemoteProcedures {
input: AiResultReferenceInput, input: AiResultReferenceInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( .invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

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

View File

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

View File

@@ -34,10 +34,10 @@ pub trait authorize_database_migration_operator {
input: DatabaseMigrationAuthorizeOperatorInput, input: DatabaseMigrationAuthorizeOperatorInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<DatabaseMigrationOperatorProcedureResult, __sdk::InternalError>, Result<DatabaseMigrationOperatorProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -47,10 +47,10 @@ impl authorize_database_migration_operator for super::RemoteProcedures {
input: DatabaseMigrationAuthorizeOperatorInput, input: DatabaseMigrationAuthorizeOperatorInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<DatabaseMigrationOperatorProcedureResult, __sdk::InternalError>, Result<DatabaseMigrationOperatorProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, DatabaseMigrationOperatorProcedureResult>( .invoke_procedure_with_callback::<_, DatabaseMigrationOperatorProcedureResult>(

View File

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

View File

@@ -31,10 +31,10 @@ pub trait begin_story_session_and_return {
input: StorySessionInput, input: StorySessionInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>, Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl begin_story_session_and_return for super::RemoteProcedures {
input: StorySessionInput, input: StorySessionInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>, Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, StorySessionProcedureResult>( .invoke_procedure_with_callback::<_, StorySessionProcedureResult>(

View File

@@ -47,11 +47,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -60,11 +58,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp self.imp
.invoke_reducer_with_callback(BeginStorySessionArgs { input }, callback) .invoke_reducer_with_callback(BeginStorySessionArgs { input }, callback)

View File

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

View File

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

View File

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

View File

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

View File

@@ -31,10 +31,10 @@ pub trait bind_asset_object_to_entity_and_return {
input: AssetEntityBindingInput, input: AssetEntityBindingInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AssetEntityBindingProcedureResult, __sdk::InternalError>, Result<AssetEntityBindingProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl bind_asset_object_to_entity_and_return for super::RemoteProcedures {
input: AssetEntityBindingInput, input: AssetEntityBindingInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AssetEntityBindingProcedureResult, __sdk::InternalError>, Result<AssetEntityBindingProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, AssetEntityBindingProcedureResult>( .invoke_procedure_with_callback::<_, AssetEntityBindingProcedureResult>(

View File

@@ -47,11 +47,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -60,11 +58,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp self.imp
.invoke_reducer_with_callback(BindAssetObjectToEntityArgs { input }, callback) .invoke_reducer_with_callback(BindAssetObjectToEntityArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait cancel_ai_task_and_return {
input: AiTaskCancelInput, input: AiTaskCancelInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl cancel_ai_task_and_return for super::RemoteProcedures {
input: AiTaskCancelInput, input: AiTaskCancelInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( .invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

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

View File

@@ -31,10 +31,10 @@ pub trait claim_profile_task_reward_and_return {
input: RuntimeProfileTaskClaimInput, input: RuntimeProfileTaskClaimInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileTaskClaimProcedureResult, __sdk::InternalError>, Result<RuntimeProfileTaskClaimProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl claim_profile_task_reward_and_return for super::RemoteProcedures {
input: RuntimeProfileTaskClaimInput, input: RuntimeProfileTaskClaimInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileTaskClaimProcedureResult, __sdk::InternalError>, Result<RuntimeProfileTaskClaimProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileTaskClaimProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeProfileTaskClaimProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait claim_puzzle_work_point_incentive {
input: PuzzleWorkPointIncentiveClaimInput, input: PuzzleWorkPointIncentiveClaimInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleWorkProcedureResult, __sdk::InternalError>, Result<PuzzleWorkProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl claim_puzzle_work_point_incentive for super::RemoteProcedures {
input: PuzzleWorkPointIncentiveClaimInput, input: PuzzleWorkPointIncentiveClaimInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleWorkProcedureResult, __sdk::InternalError>, Result<PuzzleWorkProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>( .invoke_procedure_with_callback::<_, PuzzleWorkProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait clear_database_migration_import_chunks {
input: DatabaseMigrationImportChunksClearInput, input: DatabaseMigrationImportChunksClearInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<DatabaseMigrationProcedureResult, __sdk::InternalError>, Result<DatabaseMigrationProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -47,10 +47,10 @@ impl clear_database_migration_import_chunks for super::RemoteProcedures {
input: DatabaseMigrationImportChunksClearInput, input: DatabaseMigrationImportChunksClearInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<DatabaseMigrationProcedureResult, __sdk::InternalError>, Result<DatabaseMigrationProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>( .invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait clear_platform_browse_history_and_return {
input: RuntimeBrowseHistoryClearInput, input: RuntimeBrowseHistoryClearInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>, Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl clear_platform_browse_history_and_return for super::RemoteProcedures {
input: RuntimeBrowseHistoryClearInput, input: RuntimeBrowseHistoryClearInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>, Result<RuntimeBrowseHistoryProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeBrowseHistoryProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait click_match_3_d_item {
input: Match3DRunClickInput, input: Match3DRunClickInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DClickItemProcedureResult, __sdk::InternalError>, Result<Match3DClickItemProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl click_match_3_d_item for super::RemoteProcedures {
input: Match3DRunClickInput, input: Match3DRunClickInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DClickItemProcedureResult, __sdk::InternalError>, Result<Match3DClickItemProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, Match3DClickItemProcedureResult>( .invoke_procedure_with_callback::<_, Match3DClickItemProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait compile_big_fish_draft {
input: BigFishDraftCompileInput, input: BigFishDraftCompileInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>, Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl compile_big_fish_draft for super::RemoteProcedures {
input: BigFishDraftCompileInput, input: BigFishDraftCompileInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>, Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait compile_custom_world_published_profile {
input: CustomWorldPublishedProfileCompileInput, input: CustomWorldPublishedProfileCompileInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>, Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -47,10 +47,10 @@ impl compile_custom_world_published_profile for super::RemoteProcedures {
input: CustomWorldPublishedProfileCompileInput, input: CustomWorldPublishedProfileCompileInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>, Result<CustomWorldPublishedProfileCompileResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, CustomWorldPublishedProfileCompileResult>( .invoke_procedure_with_callback::<_, CustomWorldPublishedProfileCompileResult>(

View File

@@ -31,10 +31,10 @@ pub trait compile_match_3_d_draft {
input: Match3DDraftCompileInput, input: Match3DDraftCompileInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>, Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl compile_match_3_d_draft for super::RemoteProcedures {
input: Match3DDraftCompileInput, input: Match3DDraftCompileInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>, Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>( .invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait compile_puzzle_agent_draft {
input: PuzzleDraftCompileInput, input: PuzzleDraftCompileInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl compile_puzzle_agent_draft for super::RemoteProcedures {
input: PuzzleDraftCompileInput, input: PuzzleDraftCompileInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait complete_ai_stage_and_return {
input: AiStageCompletionInput, input: AiStageCompletionInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl complete_ai_stage_and_return for super::RemoteProcedures {
input: AiStageCompletionInput, input: AiStageCompletionInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( .invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait complete_ai_task_and_return {
input: AiTaskFinishInput, input: AiTaskFinishInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl complete_ai_task_and_return for super::RemoteProcedures {
input: AiTaskFinishInput, input: AiTaskFinishInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( .invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait confirm_asset_object_and_return {
input: AssetObjectUpsertInput, input: AssetObjectUpsertInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AssetObjectProcedureResult, __sdk::InternalError>, Result<AssetObjectProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl confirm_asset_object_and_return for super::RemoteProcedures {
input: AssetObjectUpsertInput, input: AssetObjectUpsertInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AssetObjectProcedureResult, __sdk::InternalError>, Result<AssetObjectProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, AssetObjectProcedureResult>( .invoke_procedure_with_callback::<_, AssetObjectProcedureResult>(

View File

@@ -47,11 +47,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -60,11 +58,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp self.imp
.invoke_reducer_with_callback(ConfirmAssetObjectArgs { input }, callback) .invoke_reducer_with_callback(ConfirmAssetObjectArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait consume_profile_wallet_points_and_return {
input: RuntimeProfileWalletAdjustmentInput, input: RuntimeProfileWalletAdjustmentInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileWalletAdjustmentProcedureResult, __sdk::InternalError>, Result<RuntimeProfileWalletAdjustmentProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl consume_profile_wallet_points_and_return for super::RemoteProcedures {
input: RuntimeProfileWalletAdjustmentInput, input: RuntimeProfileWalletAdjustmentInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileWalletAdjustmentProcedureResult, __sdk::InternalError>, Result<RuntimeProfileWalletAdjustmentProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileWalletAdjustmentProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeProfileWalletAdjustmentProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait continue_story_and_return {
input: StoryContinueInput, input: StoryContinueInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>, Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl continue_story_and_return for super::RemoteProcedures {
input: StoryContinueInput, input: StoryContinueInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<StorySessionProcedureResult, __sdk::InternalError>, Result<StorySessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, StorySessionProcedureResult>( .invoke_procedure_with_callback::<_, StorySessionProcedureResult>(

View File

@@ -47,11 +47,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -60,11 +58,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp self.imp
.invoke_reducer_with_callback(ContinueStoryArgs { input }, callback) .invoke_reducer_with_callback(ContinueStoryArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait create_ai_task_and_return {
input: AiTaskCreateInput, input: AiTaskCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl create_ai_task_and_return for super::RemoteProcedures {
input: AiTaskCreateInput, input: AiTaskCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( .invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

@@ -47,11 +47,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -60,11 +58,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp self.imp
.invoke_reducer_with_callback(CreateAiTaskArgs { input }, callback) .invoke_reducer_with_callback(CreateAiTaskArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait create_battle_state_and_return {
input: BattleStateInput, input: BattleStateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BattleStateProcedureResult, __sdk::InternalError>, Result<BattleStateProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl create_battle_state_and_return for super::RemoteProcedures {
input: BattleStateInput, input: BattleStateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BattleStateProcedureResult, __sdk::InternalError>, Result<BattleStateProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, BattleStateProcedureResult>( .invoke_procedure_with_callback::<_, BattleStateProcedureResult>(

View File

@@ -47,11 +47,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()>; ) -> __sdk::Result<()>;
} }
@@ -60,11 +58,9 @@ 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>, + 'static,
) + Send
+ 'static,
) -> __sdk::Result<()> { ) -> __sdk::Result<()> {
self.imp self.imp
.invoke_reducer_with_callback(CreateBattleStateArgs { input }, callback) .invoke_reducer_with_callback(CreateBattleStateArgs { input }, callback)

View File

@@ -31,10 +31,10 @@ pub trait create_big_fish_session {
input: BigFishSessionCreateInput, input: BigFishSessionCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>, Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl create_big_fish_session for super::RemoteProcedures {
input: BigFishSessionCreateInput, input: BigFishSessionCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>, Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait create_custom_world_agent_session {
input: CustomWorldAgentSessionCreateInput, input: CustomWorldAgentSessionCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldAgentSessionProcedureResult, __sdk::InternalError>, Result<CustomWorldAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl create_custom_world_agent_session for super::RemoteProcedures {
input: CustomWorldAgentSessionCreateInput, input: CustomWorldAgentSessionCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldAgentSessionProcedureResult, __sdk::InternalError>, Result<CustomWorldAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, CustomWorldAgentSessionProcedureResult>( .invoke_procedure_with_callback::<_, CustomWorldAgentSessionProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait create_match_3_d_agent_session {
input: Match3DAgentSessionCreateInput, input: Match3DAgentSessionCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>, Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl create_match_3_d_agent_session for super::RemoteProcedures {
input: Match3DAgentSessionCreateInput, input: Match3DAgentSessionCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>, Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>( .invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait create_profile_recharge_order_and_return {
input: RuntimeProfileRechargeOrderCreateInput, input: RuntimeProfileRechargeOrderCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileRechargeCenterProcedureResult, __sdk::InternalError>, Result<RuntimeProfileRechargeCenterProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -47,10 +47,10 @@ impl create_profile_recharge_order_and_return for super::RemoteProcedures {
input: RuntimeProfileRechargeOrderCreateInput, input: RuntimeProfileRechargeOrderCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeProfileRechargeCenterProcedureResult, __sdk::InternalError>, Result<RuntimeProfileRechargeCenterProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeProfileRechargeCenterProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeProfileRechargeCenterProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait create_puzzle_agent_session {
input: PuzzleAgentSessionCreateInput, input: PuzzleAgentSessionCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl create_puzzle_agent_session for super::RemoteProcedures {
input: PuzzleAgentSessionCreateInput, input: PuzzleAgentSessionCreateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>(

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -31,10 +31,10 @@ pub trait delete_big_fish_work {
input: BigFishWorkDeleteInput, input: BigFishWorkDeleteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BigFishWorksProcedureResult, __sdk::InternalError>, Result<BigFishWorksProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl delete_big_fish_work for super::RemoteProcedures {
input: BigFishWorkDeleteInput, input: BigFishWorkDeleteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BigFishWorksProcedureResult, __sdk::InternalError>, Result<BigFishWorksProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, BigFishWorksProcedureResult>( .invoke_procedure_with_callback::<_, BigFishWorksProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait delete_custom_world_agent_session {
input: CustomWorldAgentSessionGetInput, input: CustomWorldAgentSessionGetInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldWorksListResult, __sdk::InternalError>, Result<CustomWorldWorksListResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl delete_custom_world_agent_session for super::RemoteProcedures {
input: CustomWorldAgentSessionGetInput, input: CustomWorldAgentSessionGetInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldWorksListResult, __sdk::InternalError>, Result<CustomWorldWorksListResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, CustomWorldWorksListResult>( .invoke_procedure_with_callback::<_, CustomWorldWorksListResult>(

View File

@@ -31,10 +31,10 @@ pub trait delete_custom_world_profile_and_return {
input: CustomWorldProfileDeleteInput, input: CustomWorldProfileDeleteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldProfileListResult, __sdk::InternalError>, Result<CustomWorldProfileListResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl delete_custom_world_profile_and_return for super::RemoteProcedures {
input: CustomWorldProfileDeleteInput, input: CustomWorldProfileDeleteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldProfileListResult, __sdk::InternalError>, Result<CustomWorldProfileListResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, CustomWorldProfileListResult>( .invoke_procedure_with_callback::<_, CustomWorldProfileListResult>(

View File

@@ -31,10 +31,10 @@ pub trait delete_match_3_d_work {
input: Match3DWorkDeleteInput, input: Match3DWorkDeleteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DWorksProcedureResult, __sdk::InternalError>, Result<Match3DWorksProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl delete_match_3_d_work for super::RemoteProcedures {
input: Match3DWorkDeleteInput, input: Match3DWorkDeleteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DWorksProcedureResult, __sdk::InternalError>, Result<Match3DWorksProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, Match3DWorksProcedureResult>( .invoke_procedure_with_callback::<_, Match3DWorksProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait delete_puzzle_work {
input: PuzzleWorkDeleteInput, input: PuzzleWorkDeleteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleWorksProcedureResult, __sdk::InternalError>, Result<PuzzleWorksProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl delete_puzzle_work for super::RemoteProcedures {
input: PuzzleWorkDeleteInput, input: PuzzleWorkDeleteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleWorksProcedureResult, __sdk::InternalError>, Result<PuzzleWorksProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, PuzzleWorksProcedureResult>( .invoke_procedure_with_callback::<_, PuzzleWorksProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait delete_runtime_snapshot_and_return {
input: RuntimeSnapshotDeleteInput, input: RuntimeSnapshotDeleteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeSnapshotProcedureResult, __sdk::InternalError>, Result<RuntimeSnapshotProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl delete_runtime_snapshot_and_return for super::RemoteProcedures {
input: RuntimeSnapshotDeleteInput, input: RuntimeSnapshotDeleteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<RuntimeSnapshotProcedureResult, __sdk::InternalError>, Result<RuntimeSnapshotProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, RuntimeSnapshotProcedureResult>( .invoke_procedure_with_callback::<_, RuntimeSnapshotProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait drag_puzzle_piece_or_group {
input: PuzzleRunDragInput, input: PuzzleRunDragInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleRunProcedureResult, __sdk::InternalError>, Result<PuzzleRunProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl drag_puzzle_piece_or_group for super::RemoteProcedures {
input: PuzzleRunDragInput, input: PuzzleRunDragInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleRunProcedureResult, __sdk::InternalError>, Result<PuzzleRunProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>( .invoke_procedure_with_callback::<_, PuzzleRunProcedureResult>(

View File

@@ -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,
)
}
}

View File

@@ -31,10 +31,10 @@ pub trait execute_custom_world_agent_action {
input: CustomWorldAgentActionExecuteInput, input: CustomWorldAgentActionExecuteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldAgentActionExecuteResult, __sdk::InternalError>, Result<CustomWorldAgentActionExecuteResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl execute_custom_world_agent_action for super::RemoteProcedures {
input: CustomWorldAgentActionExecuteInput, input: CustomWorldAgentActionExecuteInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldAgentActionExecuteResult, __sdk::InternalError>, Result<CustomWorldAgentActionExecuteResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, CustomWorldAgentActionExecuteResult>( .invoke_procedure_with_callback::<_, CustomWorldAgentActionExecuteResult>(

View File

@@ -27,10 +27,10 @@ pub trait export_auth_store_snapshot_from_tables {
&self, &self,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AuthStoreSnapshotProcedureResult, __sdk::InternalError>, Result<AuthStoreSnapshotProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -39,10 +39,10 @@ impl export_auth_store_snapshot_from_tables for super::RemoteProcedures {
&self, &self,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AuthStoreSnapshotProcedureResult, __sdk::InternalError>, Result<AuthStoreSnapshotProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, AuthStoreSnapshotProcedureResult>( .invoke_procedure_with_callback::<_, AuthStoreSnapshotProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait export_database_migration_to_file {
input: DatabaseMigrationExportInput, input: DatabaseMigrationExportInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<DatabaseMigrationProcedureResult, __sdk::InternalError>, Result<DatabaseMigrationProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl export_database_migration_to_file for super::RemoteProcedures {
input: DatabaseMigrationExportInput, input: DatabaseMigrationExportInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<DatabaseMigrationProcedureResult, __sdk::InternalError>, Result<DatabaseMigrationProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>( .invoke_procedure_with_callback::<_, DatabaseMigrationProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait fail_ai_task_and_return {
input: AiTaskFailureInput, input: AiTaskFailureInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl fail_ai_task_and_return for super::RemoteProcedures {
input: AiTaskFailureInput, input: AiTaskFailureInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<AiTaskProcedureResult, __sdk::InternalError>, Result<AiTaskProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, AiTaskProcedureResult>( .invoke_procedure_with_callback::<_, AiTaskProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait finalize_big_fish_agent_message_turn {
input: BigFishMessageFinalizeInput, input: BigFishMessageFinalizeInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>, Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl finalize_big_fish_agent_message_turn for super::RemoteProcedures {
input: BigFishMessageFinalizeInput, input: BigFishMessageFinalizeInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>, Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>(

View File

@@ -34,10 +34,10 @@ pub trait finalize_custom_world_agent_message_turn {
input: CustomWorldAgentMessageFinalizeInput, input: CustomWorldAgentMessageFinalizeInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldAgentOperationProcedureResult, __sdk::InternalError>, Result<CustomWorldAgentOperationProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -47,10 +47,10 @@ impl finalize_custom_world_agent_message_turn for super::RemoteProcedures {
input: CustomWorldAgentMessageFinalizeInput, input: CustomWorldAgentMessageFinalizeInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<CustomWorldAgentOperationProcedureResult, __sdk::InternalError>, Result<CustomWorldAgentOperationProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>( .invoke_procedure_with_callback::<_, CustomWorldAgentOperationProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait finalize_match_3_d_agent_message_turn {
input: Match3DAgentMessageFinalizeInput, input: Match3DAgentMessageFinalizeInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>, Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl finalize_match_3_d_agent_message_turn for super::RemoteProcedures {
input: Match3DAgentMessageFinalizeInput, input: Match3DAgentMessageFinalizeInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>, Result<Match3DAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>( .invoke_procedure_with_callback::<_, Match3DAgentSessionProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait finalize_puzzle_agent_message_turn {
input: PuzzleAgentMessageFinalizeInput, input: PuzzleAgentMessageFinalizeInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl finalize_puzzle_agent_message_turn for super::RemoteProcedures {
input: PuzzleAgentMessageFinalizeInput, input: PuzzleAgentMessageFinalizeInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>, Result<PuzzleAgentSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>( .invoke_procedure_with_callback::<_, PuzzleAgentSessionProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait finish_match_3_d_time_up {
input: Match3DRunTimeUpInput, input: Match3DRunTimeUpInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DRunProcedureResult, __sdk::InternalError>, Result<Match3DRunProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl finish_match_3_d_time_up for super::RemoteProcedures {
input: Match3DRunTimeUpInput, input: Match3DRunTimeUpInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<Match3DRunProcedureResult, __sdk::InternalError>, Result<Match3DRunProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, Match3DRunProcedureResult>( .invoke_procedure_with_callback::<_, Match3DRunProcedureResult>(

View File

@@ -31,10 +31,10 @@ pub trait generate_big_fish_asset {
input: BigFishAssetGenerateInput, input: BigFishAssetGenerateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>, Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
); );
} }
@@ -44,10 +44,10 @@ impl generate_big_fish_asset for super::RemoteProcedures {
input: BigFishAssetGenerateInput, input: BigFishAssetGenerateInput,
__callback: impl FnOnce( __callback: impl FnOnce(
&super::ProcedureEventContext, &super::ProcedureEventContext,
Result<BigFishSessionProcedureResult, __sdk::InternalError>, Result<BigFishSessionProcedureResult, __sdk::InternalError>,
) + Send ) + Send
+ 'static, + 'static,
) { ) {
self.imp self.imp
.invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>( .invoke_procedure_with_callback::<_, BigFishSessionProcedureResult>(

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