@kepler.gl/duckdb 3.1.0 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,16 @@
1
1
  import * as arrow from 'apache-arrow';
2
- import { AsyncDuckDB, AsyncDuckDBConnection } from '@duckdb/duckdb-wasm';
3
2
  import { KeplerTable } from '@kepler.gl/table';
3
+ import { DatabaseAdapter, DatabaseConnection } from '@kepler.gl/utils';
4
4
  import { ProcessorResult } from '../processors/data-processor';
5
5
  declare type ImportDataToDuckProps = {
6
- data: ProcessorResult;
7
- db: AsyncDuckDB;
8
- c: AsyncDuckDBConnection;
6
+ data: ProcessorResult & {
7
+ arrowSchema: arrow.Schema;
8
+ };
9
+ db: DatabaseAdapter;
10
+ c: DatabaseConnection;
9
11
  };
10
12
  declare type ImportDataToDuckResult = {
11
- addWKBMetadata?: Record<string, boolean>;
13
+ geoarrowMetadata?: Record<string, string>;
12
14
  useNewFields?: boolean;
13
15
  };
14
16
  export declare class KeplerGlDuckDbTable extends KeplerTable {
@@ -19,7 +21,7 @@ export declare class KeplerGlDuckDbTable extends KeplerTable {
19
21
  constructor(props: any);
20
22
  importRowData({ data, db, c }: ImportDataToDuckProps): Promise<void>;
21
23
  importGeoJsonData({ data, db, c }: ImportDataToDuckProps): Promise<ImportDataToDuckResult>;
22
- importArrowData({ data, db, c }: ImportDataToDuckProps): Promise<ImportDataToDuckResult>;
24
+ importArrowData({ data, c }: ImportDataToDuckProps): Promise<ImportDataToDuckResult>;
23
25
  /**
24
26
  * Creates a table from data, returns an arrow table with the data
25
27
  * @param data
@@ -39,4 +41,11 @@ export declare class KeplerGlDuckDbTable extends KeplerTable {
39
41
  };
40
42
  static getInputDataValidator: () => (d: any) => any;
41
43
  }
44
+ /**
45
+ * Try to restore geoarrow metadata lost during DuckDb ingestion.
46
+ * Note that this function can generate wrong geometry types.
47
+ * @param arrowTable Arrow table to update.
48
+ * @param geoarrowMetadata A map with field names that usually used to store geoarrow geometry.
49
+ */
50
+ export declare const restoreGeoarrowMetadata: (arrowTable: arrow.Table, geoarrowMetadata: Record<string, string>) => void;
42
51
  export {};