/** * Utility functions for connecting to Trino and extracting schema information. * All functions are lint/prettier compliant and ready for implementation. */ import type { PermitResource } from '../components/env/trino/types.js'; export interface TrinoColumn { name: string; type: string; nullable: boolean; } export interface TrinoTable { catalog: string; schema: string; name: string; type: string; columns: TrinoColumn[]; } export interface TrinoSchema { catalog: string; name: string; } export interface TrinoCatalog { name: string; } export interface TrinoFunction { catalog: string; schema: string; name: string; returnType: string; argumentTypes: string[]; } export interface TrinoView { catalog: string; schema: string; name: string; columns: TrinoColumn[]; } export interface TrinoMaterializedView { catalog: string; schema: string; name: string; columns: TrinoColumn[]; } export interface TrinoProcedure { catalog: string; schema: string; name: string; argumentTypes: string[]; } export interface TrinoSchemaData { catalogs: TrinoCatalog[]; schemas: TrinoSchema[]; tables: TrinoTable[]; functions: TrinoFunction[]; views: TrinoView[]; materializedViews: TrinoMaterializedView[]; procedures: TrinoProcedure[]; } /** * Map Trino column type to Permit attribute type. */ export declare function trinoTypeToPermitType(trinoType: string): 'string' | 'number' | 'object' | 'json' | 'time' | 'bool' | 'array' | 'object_array'; /** * Map Trino schema data to Permit resources. * - Each catalog, schema, table, and optionally column is a resource. * - Each table resource includes columns as attributes (with type/description). * @param trino - The Trino schema data to map * @param options - Configuration options * @param options.createColumnResources - Whether to create individual column resources (default: false) */ export declare function mapTrinoSchemaToPermitResources(trino: TrinoSchemaData, options?: { createColumnResources?: boolean; }): PermitResource[]; export declare function connectToTrino(options: { url: string; user: string; password?: string; }): { baseUrl: string; headers: Record; }; export declare function fetchTrinoFunctionsAndProceduresPassthrough(client: { baseUrl: string; headers: Record; }, catalog: string, schema: string): Promise<{ functions: TrinoFunction[]; procedures: TrinoProcedure[]; }>; export declare function fetchTrinoSchema(client: { baseUrl: string; headers: Record; }, options: { catalog?: string; schema?: string; }): Promise;