@@ -74,13 +74,30 @@ export default class DBSQLSession implements IDBSQLSession {
7474 return this . backend . id ;
7575 }
7676
77+ /**
78+ * Fetches info
79+ * @public
80+ * @param infoType - One of the values TCLIService_types.TGetInfoType
81+ * @returns Value corresponding to info type requested
82+ * @example
83+ * const response = await session.getInfo(thrift.TCLIService_types.TGetInfoType.CLI_DBMS_VER);
84+ */
7785 public async getInfo ( infoType : number ) : Promise < InfoValue > {
7886 await this . failIfClosed ( ) ;
7987 const result = await this . backend . getInfo ( infoType ) ;
8088 await this . failIfClosed ( ) ;
8189 return result ;
8290 }
8391
92+ /**
93+ * Executes statement
94+ * @public
95+ * @param statement - SQL statement to be executed
96+ * @param options - maxRows field is used to specify Direct Results
97+ * @returns DBSQLOperation
98+ * @example
99+ * const operation = await session.executeStatement(query);
100+ */
84101 public async executeStatement ( statement : string , options : ExecuteStatementOptions = { } ) : Promise < IOperation > {
85102 await this . failIfClosed ( ) ;
86103 const opBackend = await this . backend . executeStatement ( statement , options ) ;
@@ -206,48 +223,90 @@ export default class DBSQLSession implements IDBSQLSession {
206223 }
207224 }
208225
226+ /**
227+ * Information about supported data types
228+ * @public
229+ * @param request
230+ * @returns DBSQLOperation
231+ */
209232 public async getTypeInfo ( request : TypeInfoRequest = { } ) : Promise < IOperation > {
210233 await this . failIfClosed ( ) ;
211234 const opBackend = await this . backend . getTypeInfo ( request ) ;
212235 await this . failIfClosed ( ) ;
213236 return this . wrapOperation ( opBackend ) ;
214237 }
215238
239+ /**
240+ * Get list of catalogs
241+ * @public
242+ * @param request
243+ * @returns DBSQLOperation
244+ */
216245 public async getCatalogs ( request : CatalogsRequest = { } ) : Promise < IOperation > {
217246 await this . failIfClosed ( ) ;
218247 const opBackend = await this . backend . getCatalogs ( request ) ;
219248 await this . failIfClosed ( ) ;
220249 return this . wrapOperation ( opBackend ) ;
221250 }
222251
252+ /**
253+ * Get list of schemas
254+ * @public
255+ * @param request
256+ * @returns DBSQLOperation
257+ */
223258 public async getSchemas ( request : SchemasRequest = { } ) : Promise < IOperation > {
224259 await this . failIfClosed ( ) ;
225260 const opBackend = await this . backend . getSchemas ( request ) ;
226261 await this . failIfClosed ( ) ;
227262 return this . wrapOperation ( opBackend ) ;
228263 }
229264
265+ /**
266+ * Get list of tables
267+ * @public
268+ * @param request
269+ * @returns DBSQLOperation
270+ */
230271 public async getTables ( request : TablesRequest = { } ) : Promise < IOperation > {
231272 await this . failIfClosed ( ) ;
232273 const opBackend = await this . backend . getTables ( request ) ;
233274 await this . failIfClosed ( ) ;
234275 return this . wrapOperation ( opBackend ) ;
235276 }
236277
278+ /**
279+ * Get list of supported table types
280+ * @public
281+ * @param request
282+ * @returns DBSQLOperation
283+ */
237284 public async getTableTypes ( request : TableTypesRequest = { } ) : Promise < IOperation > {
238285 await this . failIfClosed ( ) ;
239286 const opBackend = await this . backend . getTableTypes ( request ) ;
240287 await this . failIfClosed ( ) ;
241288 return this . wrapOperation ( opBackend ) ;
242289 }
243290
291+ /**
292+ * Get full information about columns of the table
293+ * @public
294+ * @param request
295+ * @returns DBSQLOperation
296+ */
244297 public async getColumns ( request : ColumnsRequest = { } ) : Promise < IOperation > {
245298 await this . failIfClosed ( ) ;
246299 const opBackend = await this . backend . getColumns ( request ) ;
247300 await this . failIfClosed ( ) ;
248301 return this . wrapOperation ( opBackend ) ;
249302 }
250303
304+ /**
305+ * Get information about function
306+ * @public
307+ * @param request
308+ * @returns DBSQLOperation
309+ */
251310 public async getFunctions ( request : FunctionsRequest ) : Promise < IOperation > {
252311 await this . failIfClosed ( ) ;
253312 const opBackend = await this . backend . getFunctions ( request ) ;
@@ -262,13 +321,24 @@ export default class DBSQLSession implements IDBSQLSession {
262321 return this . wrapOperation ( opBackend ) ;
263322 }
264323
324+ /**
325+ * Request information about foreign keys between two tables
326+ * @public
327+ * @param request
328+ * @returns DBSQLOperation
329+ */
265330 public async getCrossReference ( request : CrossReferenceRequest ) : Promise < IOperation > {
266331 await this . failIfClosed ( ) ;
267332 const opBackend = await this . backend . getCrossReference ( request ) ;
268333 await this . failIfClosed ( ) ;
269334 return this . wrapOperation ( opBackend ) ;
270335 }
271336
337+ /**
338+ * Closes the session
339+ * @public
340+ * @returns Operation status
341+ */
272342 public async close ( ) : Promise < Status > {
273343 if ( ! this . isOpen ) {
274344 return Status . success ( ) ;
0 commit comments