@directus/api
Version:
Directus is a real-time API and App dashboard for managing SQL database content
26 lines (25 loc) • 1.07 kB
TypeScript
import type { Filter, Permission, Query, SchemaOverview } from '@directus/types';
import type { Knex } from 'knex';
type FunctionColumnOptions = {
query: Query;
cases: Filter[];
permissions: Permission[];
};
type OriginalCollectionName = {
originalCollectionName?: string | undefined;
};
type GetColumnOptions = OriginalCollectionName | (FunctionColumnOptions & OriginalCollectionName);
/**
* Return column prefixed by table. If column includes functions (like `year(date_created)`), the
* column is replaced with the appropriate SQL
*
* @param knex Current knex / transaction instance
* @param table Collection or alias in which column resides
* @param column name of the column
* @param alias Whether or not to add a SQL AS statement
* @param schema For retrieval of the column type
* @param options Optional parameters
* @returns Knex raw instance
*/
export declare function getColumn(knex: Knex, table: string, column: string, alias: string | false | undefined, schema: SchemaOverview, options?: GetColumnOptions): Knex.Raw;
export {};