(id: string | RawQueryFragment | NativeQueryBuilder)
| 695 | } |
| 696 | |
| 697 | protected quote(id: string | RawQueryFragment | NativeQueryBuilder): string { |
| 698 | if (isRaw(id)) { |
| 699 | return this.platform.formatQuery(id.sql, id.params); |
| 700 | } |
| 701 | |
| 702 | if (id instanceof NativeQueryBuilder) { |
| 703 | const { sql, params } = id.compile(); |
| 704 | return this.platform.formatQuery(sql, params); |
| 705 | } |
| 706 | |
| 707 | if (id.endsWith('.*')) { |
| 708 | const schema = this.platform.quoteIdentifier(id.substring(0, id.indexOf('.'))); |
| 709 | return schema + '.*'; |
| 710 | } |
| 711 | |
| 712 | if (id.toLowerCase().includes(' as ')) { |
| 713 | const parts = id.split(/ as /i); |
| 714 | const a = this.platform.quoteIdentifier(parts[0]); |
| 715 | const b = this.platform.quoteIdentifier(parts[1]); |
| 716 | |
| 717 | const asKeyword = this.platform.usesAsKeyword() ? ' as ' : ' '; |
| 718 | return `${a}${asKeyword}${b}`; |
| 719 | } |
| 720 | |
| 721 | if (id === '*') { |
| 722 | return id; |
| 723 | } |
| 724 | |
| 725 | return this.platform.quoteIdentifier(id); |
| 726 | } |
| 727 | } |
no test coverage detected