|
1 | 1 | // @generated |
2 | 2 |
|
3 | 3 | /*--------------------------------------------------------------------------------------------- |
4 | | - * Copyright (C) 2024-2025 Posit Software, PBC. All rights reserved. |
| 4 | + * Copyright (C) 2024-2026 Posit Software, PBC. All rights reserved. |
5 | 5 | *--------------------------------------------------------------------------------------------*/ |
6 | 6 |
|
7 | 7 | // |
@@ -60,6 +60,13 @@ pub struct FilterResult { |
60 | 60 | pub had_errors: Option<bool> |
61 | 61 | } |
62 | 62 |
|
| 63 | +/// Result of setting import options |
| 64 | +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] |
| 65 | +pub struct SetDatasetImportOptionsResult { |
| 66 | + /// An error message if setting the options failed |
| 67 | + pub error_message: Option<String> |
| 68 | +} |
| 69 | + |
63 | 70 | /// The current backend state for the data explorer |
64 | 71 | #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] |
65 | 72 | pub struct BackendState { |
@@ -703,6 +710,15 @@ pub struct ColumnSelection { |
703 | 710 | pub spec: ArraySelection |
704 | 711 | } |
705 | 712 |
|
| 713 | +/// Import options for file-based data sources. Currently supports options |
| 714 | +/// for delimited text files (CSV, TSV). |
| 715 | +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] |
| 716 | +pub struct DatasetImportOptions { |
| 717 | + /// Whether the first row contains column headers (for delimited text |
| 718 | + /// files) |
| 719 | + pub has_header_row: Option<bool> |
| 720 | +} |
| 721 | + |
706 | 722 | /// Possible values for SortOrder in SearchSchema |
707 | 723 | #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, strum_macros::Display, strum_macros::EnumString)] |
708 | 724 | pub enum SearchSchemaSortOrder { |
@@ -1193,6 +1209,13 @@ pub struct GetColumnProfilesParams { |
1193 | 1209 | pub format_options: FormatOptions, |
1194 | 1210 | } |
1195 | 1211 |
|
| 1212 | +/// Parameters for the SetDatasetImportOptions method. |
| 1213 | +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] |
| 1214 | +pub struct SetDatasetImportOptionsParams { |
| 1215 | + /// Import options to apply |
| 1216 | + pub options: DatasetImportOptions, |
| 1217 | +} |
| 1218 | + |
1196 | 1219 | /// Parameters for the ReturnColumnProfiles method. |
1197 | 1220 | #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] |
1198 | 1221 | pub struct ReturnColumnProfilesParams { |
@@ -1289,6 +1312,23 @@ pub enum DataExplorerBackendRequest { |
1289 | 1312 | #[serde(rename = "get_column_profiles")] |
1290 | 1313 | GetColumnProfiles(GetColumnProfilesParams), |
1291 | 1314 |
|
| 1315 | + /// Set import options for file-based data sources |
| 1316 | + /// |
| 1317 | + /// Set import options for file-based data sources (like CSV files) and |
| 1318 | + /// reimport the data. This method is primarily used by file-based |
| 1319 | + /// backends like DuckDB. |
| 1320 | + #[serde(rename = "set_dataset_import_options")] |
| 1321 | + SetDatasetImportOptions(SetDatasetImportOptionsParams), |
| 1322 | + |
| 1323 | + /// Open a full data explorer for the same data |
| 1324 | + /// |
| 1325 | + /// Creates a new, independent data explorer comm for the same underlying |
| 1326 | + /// data. The new comm has its own state (filters, sorts). Used when |
| 1327 | + /// promoting an inline notebook data explorer to a full data explorer |
| 1328 | + /// panel. |
| 1329 | + #[serde(rename = "open_data_explorer")] |
| 1330 | + OpenDataExplorer, |
| 1331 | + |
1292 | 1332 | /// Get the state |
1293 | 1333 | /// |
1294 | 1334 | /// Request the current backend state (table metadata, explorer state, and |
@@ -1337,6 +1377,12 @@ pub enum DataExplorerBackendReply { |
1337 | 1377 | /// Reply for the get_column_profiles method (no result) |
1338 | 1378 | GetColumnProfilesReply(), |
1339 | 1379 |
|
| 1380 | + /// Result of setting import options |
| 1381 | + SetDatasetImportOptionsReply(SetDatasetImportOptionsResult), |
| 1382 | + |
| 1383 | + /// Reply for the open_data_explorer method (no result) |
| 1384 | + OpenDataExplorerReply(), |
| 1385 | + |
1340 | 1386 | /// The current backend state for the data explorer |
1341 | 1387 | GetStateReply(BackendState), |
1342 | 1388 |
|
|
0 commit comments