tessl install tessl/npm-lightdash--common@0.2231.5Shared TypeScript library for the Lightdash platform containing common types, utilities, and business logic for analytics workflows
Agent Success
Agent success rate when using this tile
72%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.09x
Baseline
Agent success rate without this tile
66%
A utility library that formats SQL queries for different data warehouse platforms, handling platform-specific quoting conventions, string escaping, and date/time functions.
user_id" @test@generates
/**
* Supported warehouse types
*/
export type WarehouseType =
| 'bigquery'
| 'postgres'
| 'snowflake'
| 'redshift'
| 'databricks'
| 'trino'
| 'clickhouse';
/**
* Time units for date truncation
*/
export type TimeUnit = 'day' | 'week' | 'month' | 'year';
/**
* Quotes a field name according to warehouse-specific conventions
*
* @param warehouseType - The type of warehouse
* @param fieldName - The field name to quote
* @returns The quoted field name
*/
export function quoteFieldName(warehouseType: WarehouseType, fieldName: string): string;
/**
* Escapes and quotes a string literal for use in SQL queries
*
* @param warehouseType - The type of warehouse
* @param value - The string value to escape
* @returns The escaped and quoted string literal
*/
export function escapeStringLiteral(warehouseType: WarehouseType, value: string): string;
/**
* Generates SQL for truncating a date/timestamp to a specific time unit
*
* @param warehouseType - The type of warehouse
* @param fieldExpression - The field or expression containing the date/timestamp
* @param unit - The time unit to truncate to
* @returns SQL expression for date truncation
*/
export function generateDateTruncSQL(
warehouseType: WarehouseType,
fieldExpression: string,
unit: TimeUnit
): string;
/**
* Generates SQL for concatenating multiple string fields
*
* @param warehouseType - The type of warehouse
* @param fieldNames - Array of field names to concatenate
* @returns SQL expression for string concatenation
*/
export function generateConcatSQL(warehouseType: WarehouseType, fieldNames: string[]): string;Provides warehouse abstraction utilities and type definitions for working with multiple data warehouse platforms.
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20