signalk-parquet
Version:
Vessel data Parquet file archive with automated value and geospatial triggers. History API compliant with cloud backups and queries.
32 lines • 1.7 kB
TypeScript
/**
* SQL fragment builders for federating the SQLite buffer into DuckDB queries.
*
* Per-path table architecture: each SignalK path has its own table in buffer.db.
* Scalar tables have a `value` column; object tables have flattened `value_*` columns.
*
* Buffer rows reach DuckDB via a staged TEMP table (see buffer-staging.ts) rather
* than an ATTACH of the live buffer.db — callers stage first and pass the staged
* table name in. The WHERE clauses here re-apply the staging filters harmlessly
* and add the per-request value/filter conditions.
*/
import { Context, Path } from '@signalk/server-api';
import { ComponentInfo } from './schema-cache';
import { PathFilter } from './path-filters';
/**
* Build a buffer subquery for a scalar (numeric) path.
*
* Output columns: signalk_timestamp, value
* Matches raw-tier parquet schema so it can be UNION ALL'd directly.
*
* When filters are provided, rows are restricted to matching column values.
*/
export declare function buildBufferScalarSubquery(stagedTable: string, context: Context | string, signalkPath: Path | string, fromIso: string, toIso: string, filters?: PathFilter[]): string;
/**
* Build a buffer subquery for an object path (e.g. navigation.position).
*
* Per-path tables already have flattened value_* columns, so no json_extract needed.
*
* When filters are provided, rows are restricted to matching column values.
*/
export declare function buildBufferObjectSubquery(stagedTable: string, context: Context | string, fromIso: string, toIso: string, components: Map<string, ComponentInfo>, bufferTableColumns?: Set<string>, filters?: PathFilter[]): string;
//# sourceMappingURL=buffer-sql-builder.d.ts.map