Skip to content

Commit 973a7dd

Browse files
committed
commentary for index
1 parent 468698d commit 973a7dd

12 files changed

Lines changed: 3935 additions & 499 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/bindings-macro/src/table.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,8 @@ impl IndexArg {
344344

345345
Ok(ValidatedIndex {
346346
is_unique: self.is_unique,
347+
// This must be the canonical name (name used internally in database),
348+
// as it is used in `index_id_from_name` abi.
347349
index_name: self.name.as_ref().map(|s| s.value()).unwrap_or_else(gen_index_name),
348350
accessor_name: &self.accessor,
349351
kind,

crates/codegen/src/csharp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ impl Lang for Csharp<'_> {
595595
let mut index_names = Vec::new();
596596

597597
for idx in iter_indexes(table) {
598-
let Some(accessor_name) = idx.accessor_name.as_ref() else {
598+
let Some(accessor_name) = idx.codegen_name.as_ref() else {
599599
// If there is no accessor name, we shouldn't generate a client-side index accessor.
600600
continue;
601601
};

crates/codegen/src/typescript.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ fn write_table_opts<'a>(
721721
// no actual way for the user to set the actual index name.
722722
// I think we should standardize: name and accessorName as the way to set
723723
// the name and accessor name of an index across all SDKs.
724-
if let Some(accessor_name) = &index_def.accessor_name {
724+
if let Some(accessor_name) = &index_def.codegen_name {
725725
writeln!(out, "{{ name: '{}', algorithm: 'btree', columns: [", accessor_name);
726726
} else {
727727
writeln!(out, "{{ name: '{}', algorithm: 'btree', columns: [", index_def.name);

crates/codegen/src/unrealcpp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ impl Lang for UnrealCpp<'_> {
6565
let mut multi_key_indexes = Vec::new();
6666

6767
for idx in iter_indexes(table) {
68-
let Some(accessor_name) = idx.accessor_name.as_ref() else {
68+
let Some(accessor_name) = idx.codegen_name.as_ref() else {
6969
continue;
7070
};
7171

@@ -1061,7 +1061,7 @@ fn generate_table_cpp(module: &ModuleDef, table: &TableDef, module_name: &str, s
10611061
let mut multi_key_indexes = Vec::new();
10621062

10631063
for idx in iter_indexes(table) {
1064-
let Some(accessor_name) = idx.accessor_name.as_ref() else {
1064+
let Some(accessor_name) = idx.codegen_name.as_ref() else {
10651065
continue;
10661066
};
10671067
// Whatever the index algorithm on the host,

0 commit comments

Comments
 (0)