(tableName: string | RawQueryFragment | NativeQueryBuilder, options?: TableOptions)
| 95 | } |
| 96 | |
| 97 | from(tableName: string | RawQueryFragment | NativeQueryBuilder, options?: TableOptions): this { |
| 98 | if (tableName instanceof NativeQueryBuilder) { |
| 99 | tableName = tableName.toRaw(); |
| 100 | } |
| 101 | |
| 102 | if (typeof tableName === 'string') { |
| 103 | const asKeyword = this.platform.usesAsKeyword() ? ' as ' : ' '; |
| 104 | const alias = options?.alias ? `${asKeyword}${this.platform.quoteIdentifier(options.alias)}` : ''; |
| 105 | const schema = |
| 106 | options?.schema && options.schema !== this.platform.getDefaultSchemaName() ? `${options.schema}.` : ''; |
| 107 | tableName = this.quote(schema + tableName) + alias; |
| 108 | } |
| 109 | |
| 110 | this.options.tableName = tableName; |
| 111 | this.options.indexHint = options?.indexHint; |
| 112 | |
| 113 | return this; |
| 114 | } |
| 115 | |
| 116 | where(sql: string, params: unknown[]): this { |
| 117 | this.options.where = { sql, params }; |
no test coverage detected