(tableName)
| 536 | } |
| 537 | |
| 538 | showIndexesQuery(tableName) { |
| 539 | let sql = 'SELECT NAME AS "name", TBNAME AS "tableName", UNIQUERULE AS "keyType", COLNAMES, INDEXTYPE AS "type" FROM SYSIBM.SYSINDEXES WHERE TBNAME = <%= tableName %>'; |
| 540 | let schema = undefined; |
| 541 | if (_.isObject(tableName)) { |
| 542 | schema = tableName.schema; |
| 543 | tableName = tableName.tableName; |
| 544 | } |
| 545 | if (schema) { |
| 546 | sql = `${sql} AND TBCREATOR = <%= schemaName %>`; |
| 547 | } |
| 548 | sql = `${sql} ORDER BY NAME;`; |
| 549 | return _.template(sql, this._templateSettings)({ |
| 550 | tableName: wrapSingleQuote(tableName), |
| 551 | schemaName: wrapSingleQuote(schema) |
| 552 | }); |
| 553 | } |
| 554 | |
| 555 | showConstraintsQuery(tableName, constraintName) { |
| 556 | let sql = `SELECT CONSTNAME AS "constraintName", TRIM(TABSCHEMA) AS "schemaName", TABNAME AS "tableName" FROM SYSCAT.TABCONST WHERE TABNAME = '${tableName}'`; |
no test coverage detected