#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum LanceDbColumnType {
Unspecified,
String,
Int64,
Float64,
Bool,
VectorFloat32,
Float32,
Uint64,
Int32,
Uint32,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct LanceDbColumnDef {
pub name: String,
pub column_type: LanceDbColumnType,
pub vector_dim: u32,
pub nullable: bool,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum LanceDbInputFormat {
Unspecified,
JsonRows,
ArrowIpc,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum LanceDbOutputFormat {
Unspecified,
ArrowIpc,
JsonRows,
}
impl LanceDbOutputFormat {
pub fn as_wire_name(&self) -> &'static str {
match self {
Self::Unspecified | Self::ArrowIpc => "arrow_ipc",
Self::JsonRows => "json",
}
}
}
#[derive(Debug, Clone)]
pub struct LanceDbCreateTableInput {
pub table_name: String,
pub columns: Vec<LanceDbColumnDef>,
pub overwrite_if_exists: bool,
}
#[derive(Debug, Clone)]
pub struct LanceDbCreateTableResult {
pub message: String,
}
#[derive(Debug, Clone)]
pub struct LanceDbUpsertInput {
pub table_name: String,
pub input_format: LanceDbInputFormat,
pub data: Vec<u8>,
pub key_columns: Vec<String>,
}
#[derive(Debug, Clone)]
pub struct LanceDbUpsertResult {
pub message: String,
pub version: u64,
pub input_rows: u64,
pub inserted_rows: u64,
pub updated_rows: u64,
pub deleted_rows: u64,
}
#[derive(Debug, Clone)]
pub struct LanceDbSearchInput {
pub table_name: String,
pub vector: Vec<f32>,
pub limit: u32,
pub filter: String,
pub vector_column: String,
pub output_format: LanceDbOutputFormat,
}
#[derive(Debug, Clone)]
pub struct LanceDbSearchResult {
pub message: String,
pub format: LanceDbOutputFormat,
pub rows: u64,
pub data: Vec<u8>,
}
#[derive(Debug, Clone)]
pub struct LanceDbDeleteInput {
pub table_name: String,
pub condition: String,
}
#[derive(Debug, Clone)]
pub struct LanceDbDeleteResult {
pub message: String,
pub version: u64,
pub deleted_rows: u64,
}
#[derive(Debug, Clone)]
pub struct LanceDbDropTableInput {
pub table_name: String,
}
#[derive(Debug, Clone)]
pub struct LanceDbDropTableResult {
pub message: String,
}