(key, prefix)
| 2559 | } |
| 2560 | |
| 2561 | _getSafeKey(key, prefix) { |
| 2562 | if (key instanceof Utils.SequelizeMethod) { |
| 2563 | key = this.handleSequelizeMethod(key); |
| 2564 | return this._prefixKey(this.handleSequelizeMethod(key), prefix); |
| 2565 | } |
| 2566 | |
| 2567 | if (Utils.isColString(key)) { |
| 2568 | key = key.substr(1, key.length - 2).split('.'); |
| 2569 | |
| 2570 | if (key.length > 2) { |
| 2571 | key = [ |
| 2572 | // join the tables by -> to match out internal namings |
| 2573 | key.slice(0, -1).join('->'), |
| 2574 | key[key.length - 1] |
| 2575 | ]; |
| 2576 | } |
| 2577 | |
| 2578 | return key.map(identifier => this.quoteIdentifier(identifier)).join('.'); |
| 2579 | } |
| 2580 | |
| 2581 | return this._prefixKey(this.quoteIdentifier(key), prefix); |
| 2582 | } |
| 2583 | |
| 2584 | _prefixKey(key, prefix) { |
| 2585 | if (prefix) { |
no test coverage detected