拆分大文件
This commit is contained in:
@@ -2,17 +2,12 @@
|
||||
// WILL NOT BE SAVED. MODIFY TABLES IN YOUR MODULE SOURCE CODE INSTEAD.
|
||||
|
||||
#![allow(unused, clippy::all)]
|
||||
use spacetimedb_sdk::__codegen::{
|
||||
self as __sdk,
|
||||
__lib,
|
||||
__sats,
|
||||
__ws,
|
||||
};
|
||||
use super::quest_log_type::QuestLog;
|
||||
use super::quest_status_type::QuestStatus;
|
||||
use super::quest_progress_signal_type::QuestProgressSignal;
|
||||
use super::quest_log_event_kind_type::QuestLogEventKind;
|
||||
use super::quest_log_type::QuestLog;
|
||||
use super::quest_progress_signal_type::QuestProgressSignal;
|
||||
use super::quest_signal_kind_type::QuestSignalKind;
|
||||
use super::quest_status_type::QuestStatus;
|
||||
use spacetimedb_sdk::__codegen::{self as __sdk, __lib, __sats, __ws};
|
||||
|
||||
/// Table handle for the table `quest_log`.
|
||||
///
|
||||
@@ -53,8 +48,12 @@ impl<'ctx> __sdk::Table for QuestLogTableHandle<'ctx> {
|
||||
type Row = QuestLog;
|
||||
type EventContext = super::EventContext;
|
||||
|
||||
fn count(&self) -> u64 { self.imp.count() }
|
||||
fn iter(&self) -> impl Iterator<Item = QuestLog> + '_ { self.imp.iter() }
|
||||
fn count(&self) -> u64 {
|
||||
self.imp.count()
|
||||
}
|
||||
fn iter(&self) -> impl Iterator<Item = QuestLog> + '_ {
|
||||
self.imp.iter()
|
||||
}
|
||||
|
||||
type InsertCallbackId = QuestLogInsertCallbackId;
|
||||
|
||||
@@ -100,39 +99,38 @@ impl<'ctx> __sdk::TableWithPrimaryKey for QuestLogTableHandle<'ctx> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Access to the `log_id` unique index on the table `quest_log`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`QuestLogLogIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.quest_log().log_id().find(...)`.
|
||||
pub struct QuestLogLogIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<QuestLog, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
/// Access to the `log_id` unique index on the table `quest_log`,
|
||||
/// which allows point queries on the field of the same name
|
||||
/// via the [`QuestLogLogIdUnique::find`] method.
|
||||
///
|
||||
/// Users are encouraged not to explicitly reference this type,
|
||||
/// but to directly chain method calls,
|
||||
/// like `ctx.db.quest_log().log_id().find(...)`.
|
||||
pub struct QuestLogLogIdUnique<'ctx> {
|
||||
imp: __sdk::UniqueConstraintHandle<QuestLog, String>,
|
||||
phantom: std::marker::PhantomData<&'ctx super::RemoteTables>,
|
||||
}
|
||||
|
||||
impl<'ctx> QuestLogTableHandle<'ctx> {
|
||||
/// Get a handle on the `log_id` unique index on the table `quest_log`.
|
||||
pub fn log_id(&self) -> QuestLogLogIdUnique<'ctx> {
|
||||
QuestLogLogIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("log_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
impl<'ctx> QuestLogTableHandle<'ctx> {
|
||||
/// Get a handle on the `log_id` unique index on the table `quest_log`.
|
||||
pub fn log_id(&self) -> QuestLogLogIdUnique<'ctx> {
|
||||
QuestLogLogIdUnique {
|
||||
imp: self.imp.get_unique_constraint::<String>("log_id"),
|
||||
phantom: std::marker::PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> QuestLogLogIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `log_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<QuestLog> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'ctx> QuestLogLogIdUnique<'ctx> {
|
||||
/// Find the subscribed row whose `log_id` column value is equal to `col_val`,
|
||||
/// if such a row is present in the client cache.
|
||||
pub fn find(&self, col_val: &String) -> Option<QuestLog> {
|
||||
self.imp.find(col_val)
|
||||
}
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
pub(super) fn register_table(client_cache: &mut __sdk::ClientCache<super::RemoteModule>) {
|
||||
|
||||
let _table = client_cache.get_or_make_table::<QuestLog>("quest_log");
|
||||
_table.add_unique_constraint::<String>("log_id", |row| &row.log_id);
|
||||
}
|
||||
@@ -142,26 +140,24 @@ pub(super) fn parse_table_update(
|
||||
raw_updates: __ws::v2::TableUpdate,
|
||||
) -> __sdk::Result<__sdk::TableUpdate<QuestLog>> {
|
||||
__sdk::TableUpdate::parse_table_update(raw_updates).map_err(|e| {
|
||||
__sdk::InternalError::failed_parse(
|
||||
"TableUpdate<QuestLog>",
|
||||
"TableUpdate",
|
||||
).with_cause(e).into()
|
||||
__sdk::InternalError::failed_parse("TableUpdate<QuestLog>", "TableUpdate")
|
||||
.with_cause(e)
|
||||
.into()
|
||||
})
|
||||
}
|
||||
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `QuestLog`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait quest_logQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `QuestLog`.
|
||||
fn quest_log(&self) -> __sdk::__query_builder::Table<QuestLog>;
|
||||
}
|
||||
|
||||
impl quest_logQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn quest_log(&self) -> __sdk::__query_builder::Table<QuestLog> {
|
||||
__sdk::__query_builder::Table::new("quest_log")
|
||||
}
|
||||
}
|
||||
#[allow(non_camel_case_types)]
|
||||
/// Extension trait for query builder access to the table `QuestLog`.
|
||||
///
|
||||
/// Implemented for [`__sdk::QueryTableAccessor`].
|
||||
pub trait quest_logQueryTableAccess {
|
||||
#[allow(non_snake_case)]
|
||||
/// Get a query builder for the table `QuestLog`.
|
||||
fn quest_log(&self) -> __sdk::__query_builder::Table<QuestLog>;
|
||||
}
|
||||
|
||||
impl quest_logQueryTableAccess for __sdk::QueryTableAccessor {
|
||||
fn quest_log(&self) -> __sdk::__query_builder::Table<QuestLog> {
|
||||
__sdk::__query_builder::Table::new("quest_log")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user