-
Notifications
You must be signed in to change notification settings - Fork 632
Add macro bindings for views #3429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
type Invoke = spacetimedb::rt::ReducerFn; | ||
const NAME: &'static str = #reducer_name; | ||
#(const LIFECYCLE: Option<spacetimedb::rt::LifecycleReducer> = Some(#lifecycle);)* | ||
const ARG_NAMES: &'static [Option<&'static str>] = &[#(#opt_arg_names),*]; | ||
const INVOKE: spacetimedb::rt::ReducerFn = #func_name::invoke; | ||
const INVOKE: Self::Invoke = #func_name::invoke; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is worth mentioning in the PR description. In some sense it is breaking, but not in a way we promise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In what sense exactly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this were to be implemented manually, we would break such users. We haven't promised such stability, but it might be worth mentioning nonetheless.
/// ctx.db.player().level().filter(level).collect() | ||
/// } | ||
/// # } | ||
/// ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe an example of a join and an example of a part of a table?
73ed5f9
to
6a8d021
Compare
2ecd24d
to
8a11196
Compare
8a11196
to
6eebf6e
Compare
6eebf6e
to
b52a38a
Compare
Description of Changes
Adds the
#[view]
procedural macro and module describers for views.Note, this deviates from the proposal in that views may only return
Vec<T>
orOption<T>
. They can't return an arbitrarySpacetimeType
.API and ABI breaking changes
None
Expected complexity level and risk
2
Testing