(key, prefix)
| 2744 | } |
| 2745 | |
| 2746 | _getSafeKey(key, prefix) { |
| 2747 | if (key instanceof Utils.SequelizeMethod) { |
| 2748 | key = this.handleSequelizeMethod(key); |
| 2749 | return this._prefixKey(this.handleSequelizeMethod(key), prefix); |
| 2750 | } |
| 2751 | |
| 2752 | if (Utils.isColString(key)) { |
| 2753 | key = key.substr(1, key.length - 2).split('.'); |
| 2754 | |
| 2755 | if (key.length > 2) { |
| 2756 | key = [ |
| 2757 | // join the tables by -> to match out internal namings |
| 2758 | key.slice(0, -1).join('->'), |
| 2759 | key[key.length - 1] |
| 2760 | ]; |
| 2761 | } |
| 2762 | |
| 2763 | return key.map(identifier => this.quoteIdentifier(identifier)).join('.'); |
| 2764 | } |
| 2765 | |
| 2766 | return this._prefixKey(this.quoteIdentifier(key), prefix); |
| 2767 | } |
| 2768 | |
| 2769 | _prefixKey(key, prefix) { |
| 2770 | if (prefix) { |
no test coverage detected