UNPKG

snowflake-sdk

Version:
136 lines (135 loc) 3.79 kB
export = Result; /** * Creates a new Result. * * @param {Object} options * @constructor */ declare function Result(options: Object): void; declare class Result { /** * Creates a new Result. * * @param {Object} options * @constructor */ constructor(options: Object); _statement: any; _services: any; _connectionConfig: any; _queryId: any; _version: string; _returnedRows: any; _totalRows: any; _statementTypeId: any; _queryContext: any; _chunkHeaders: any; _sessionState: Object; _parametersArray: any; _columns: any[]; _mapColumnNameToIndices: {}; _chunks: Chunk; getQueryContext: () => any; /** * Refreshes the result by updating the chunk urls. * * @param response */ refresh(response: any): void; /** * Returns the chunks in this result that overlap with a specified window. * * @param {Number} start the start index of the window. * @param {Number} end the end index of the window. * * @returns {Chunk[]} */ findOverlappingChunks(start: number, end: number): Chunk[]; /** * Fetches the rows from the result. * * @param {Object} options * * @returns {EventEmitter} */ fetchRows(options: Object): EventEmitter; /** * Returns the columns in this result. * * @returns {Object[]} */ getColumns(): Object[]; /** * Given a column identifier, returns the corresponding column. The column * identifier can be either the column name (String) or the column index * (Number). If a column name is specified and there is more than one column * with that name, the first column with the specified name will be returned. * * @param {String | Number} columnIdentifier * * @returns {Object} */ getColumn(columnIdentifier: string | number): Object; /** * Returns the statement id generated by the server for the statement that * produced this result. * * Should use getQueryId instead. * @deprecated * @returns {string} */ getStatementId(): string; /** * Returns the query id generated by the server for the statement that * produced this result. * * @returns {string} */ getQueryId(): string; /** * Returns the number of rows in this result. * * @returns {number} */ getReturnedRows(): number; /** * Returns the number of rows updated by the statement that produced this * result. If the statement isn't a DML, we return -1. * * @returns {Number} */ getNumUpdatedRows(): number; _numUpdatedRows: number | undefined; /** * Returns the number of rows we would have had in this result if the value of * the ROWS_PER_RESULTSET parameter was 0 at the time this statement was * executed. * * @returns {number} */ getTotalRows(): number; /** * Returns the parameters associated with this result. These parameters contain * directives about how to consume and present the result. * * @returns {Object[]} */ getParametersArray(): Object[]; /** * Returns an object that contains information about the values of the current * warehouse, current database, and any other session-related state when the * statement that produced this result finished executing. * * @returns {Object} */ getSessionState(): Object; /** * Returns the version associated with this result. * * @returns {string} */ getVersion(): string; } import Chunk = require("./chunk"); import EventEmitter_1 = require("events"); import EventEmitter = EventEmitter_1.EventEmitter;