/** * The object schema for columns returned from _Tedious_ */ export interface IColumnDefinition { /** * Whether or not it is a UDT */ userType: number; /** * Flags used by the Tedious library for a SQL type */ flags: number; /** * The type definition for this column */ type: { /** * The internal identifier for the type. */ id: number; /** * The SQL data type of the column * * @type {string} */ type: string; /** * The name of the column * * @type {string} */ name: string; }; colName: string; } /** * A mapped column specifies the column order from the schema * * @export * @interface IColumnOrder */ export interface IColumnOrder { /** * The name of the column */ name: string; /** * The index of the column specifies the order it appears the schema * * @type {number} */ index: number; } /** * A simplified column definition for when you are defining the columns * on your own, unlike [[IColumnDefinition]] which is what `tedious` returns. */ export interface ISimpleColumn { /** * The name of the column */ colName: string; /** * The column type name. See [this](https://github.com/tediousjs/tedious/blob/master/src/data-type.js#L85) */ type: string; /** * The order that the column shows up in */ index: number; } /** * Utilities for handling columns returned by a [[SqlCommand.columns]] event. */ export declare class ColumnHelpers { private columns; /** * Pass in the columns being managed (returned by the [[SqlCommand.columns]] event) * @param {Array} columns */ constructor(columns: Array); /** * A column string suitable for use in an insert statement * ``` * onColumns(cols){ * const helpers = new ColumnHelpers(cols); * helpers.columnString() * // [col1], [col2], [col3] * } * ``` * @returns {string} */ readonly columnString: string; /** * Returns an array of positional column names so that if you are inserting, say, a `columnString` from this object and you want to make sure you * are assigning values in the right order, this will provide an object for each column with `index` and `colName` properties. You can look through them * in order and see what column is where. To get the index for a column name directly, see `columnKv` *' * @returns {Array} */ readonly columnOrder: Array; /** * Returns a key/value pair where the key is the colum name and the value contains the positional index and type. */ readonly columnKV: { [id: string]: ISimpleColumn; }; } /** * Returns an instance of `ColumnHelpers` which provides utilities for handling columns returned by a `Command` `columns` event. * @param {Array} columns * @returns {ColumnHelpers} */ export default function helpers(columns: Array): ColumnHelpers; //# sourceMappingURL=ColumnHelper.d.ts.map