Skip to content
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

[nexus] Remove old CTE builder machinery #5966

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 0 additions & 30 deletions nexus/db-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ use syn::spanned::Spanned;
use syn::{parse_quote, Data, DataStruct, DeriveInput, Error, Fields, Ident};

mod lookup;
mod subquery;
#[cfg(test)]
mod test_helpers;

Expand Down Expand Up @@ -134,35 +133,6 @@ fn get_field_with_name<'a>(
}
}

/// Implements the [`Subquery`] trait.
///
/// Additionally, implements
/// [`diesel::query_builder::QueryFragment`](https://docs.diesel.rs/master/diesel/query_builder/trait.QueryFragment.html),
/// which refers to the subquery by the name supplied as input.
///
/// Callers should also derive
/// [`diesel::query_builder::QueryId`](https://docs.diesel.rs/master/diesel/query_builder/trait.QueryId.html),
/// as it should be implemented for structures which implement
/// [`diesel::query_builder::QueryFragment`](https://docs.diesel.rs/master/diesel/query_builder/trait.QueryFragment.html).
///
/// Example usage:
///
/// ```ignore
/// #[derive(Subquery, QueryId)]
/// #[subquery(name = my_table)]
/// struct MyQuery {
/// query: Box<dyn CteQuery<SqlType = my_table::SqlType>>
/// }
/// ```
#[proc_macro_derive(Subquery, attributes(subquery))]
pub fn subquery_target(
input: proc_macro::TokenStream,
) -> proc_macro::TokenStream {
subquery::derive_impl(input.into())
.unwrap_or_else(|e| e.to_compile_error())
.into()
}

// Describes which derive macro is being used; allows sharing common code.
#[derive(Clone, Copy, Debug)]
enum IdentityVariant {
Expand Down
98 changes: 0 additions & 98 deletions nexus/db-macros/src/subquery.rs

This file was deleted.

1 change: 0 additions & 1 deletion nexus/db-queries/src/db/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub mod queries;
mod raw_query_builder;
mod saga_recovery;
mod sec_store;
pub mod subquery;
pub(crate) mod true_or_cast_error;
mod update_and_check;

Expand Down
135 changes: 0 additions & 135 deletions nexus/db-queries/src/db/subquery.rs

This file was deleted.

Loading