(table: &TableDef, out: &mut impl Write, struct_name: &String)
| 790 | } |
| 791 | |
| 792 | pub fn implement_query_table_accessor(table: &TableDef, out: &mut impl Write, struct_name: &String) -> fmt::Result { |
| 793 | // NEW: Generate query table accessor trait and implementation |
| 794 | let accessor_method = table_method_name(&table.accessor_name); |
| 795 | let table_name = table.name.deref(); |
| 796 | let query_accessor_trait = accessor_method.to_string() + "QueryTableAccess"; |
| 797 | |
| 798 | writeln!( |
| 799 | out, |
| 800 | " |
| 801 | #[allow(non_camel_case_types)] |
| 802 | /// Extension trait for query builder access to the table `{struct_name}`. |
| 803 | /// |
| 804 | /// Implemented for [`__sdk::QueryTableAccessor`]. |
| 805 | pub trait {query_accessor_trait} {{ |
| 806 | #[allow(non_snake_case)] |
| 807 | /// Get a query builder for the table `{struct_name}`. |
| 808 | fn {accessor_method}(&self) -> __sdk::__query_builder::Table<{struct_name}>; |
| 809 | }} |
| 810 | |
| 811 | impl {query_accessor_trait} for __sdk::QueryTableAccessor {{ |
| 812 | fn {accessor_method}(&self) -> __sdk::__query_builder::Table<{struct_name}> {{ |
| 813 | __sdk::__query_builder::Table::new({table_name:?}) |
| 814 | }} |
| 815 | }} |
| 816 | " |
| 817 | ) |
| 818 | } |
| 819 | |
| 820 | pub fn write_type<W: Write>(module: &ModuleDef, out: &mut W, ty: &AlgebraicTypeUse) -> fmt::Result { |
| 821 | match ty { |
no test coverage detected
searching dependent graphs…