feat: allow explicit index builder uuid

This commit is contained in:
ChilePiquin
2026-08-28 22:03:02 -07:00
parent 61e6614c09
commit 7e96a42f23
2 changed files with 11 additions and 0 deletions
+8
View File
@@ -189,6 +189,7 @@ pub struct IndexBuilder {
pub(crate) index: Index,
pub(crate) columns: Vec<String>,
pub(crate) replace: bool,
pub(crate) index_uuid: Option<uuid::Uuid>,
pub(crate) wait_timeout: Option<Duration>,
pub(crate) train: bool,
pub(crate) name: Option<String>,
@@ -201,6 +202,7 @@ impl IndexBuilder {
index,
columns,
replace: true,
index_uuid: None,
train: true,
wait_timeout: None,
name: None,
@@ -217,6 +219,12 @@ impl IndexBuilder {
self
}
/// Use a caller-selected UUID for the created index.
pub fn index_uuid(mut self, uuid: uuid::Uuid) -> Self {
self.index_uuid = Some(uuid);
self
}
/// The name of the index. If not set, a default name will be generated.
///
/// # Examples
+3
View File
@@ -156,6 +156,9 @@ impl NativeTable {
.train(opts.train)
.replace(opts.replace);
if let Some(index_uuid) = opts.index_uuid {
builder = builder.index_uuid(index_uuid);
}
if let Some(name) = opts.name {
builder = builder.name(name);
}