MCPcopy Create free account
hub / github.com/TanStack/db / _getCurrentAliases

Method _getCurrentAliases

packages/db/src/query/builder/index.ts:813–835  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

811
812 // Helper methods
813 private _getCurrentAliases(): Array<string> {
814 const aliases: Array<string> = []
815
816 // Add the from alias
817 if (this.query.from) {
818 if (this.query.from.type === `unionFrom`) {
819 aliases.push(...this.query.from.sources.map((source) => source.alias))
820 } else if (this.query.from.type === `unionAll`) {
821 aliases.push(`*`)
822 } else {
823 aliases.push(this.query.from.alias)
824 }
825 }
826
827 // Add join aliases
828 if (this.query.join) {
829 for (const join of this.query.join) {
830 aliases.push(join.from.alias)
831 }
832 }
833
834 return aliases
835 }
836
837 /**
838 * Functional variants of the query builder

Callers 6

joinMethod · 0.95
whereMethod · 0.95
havingMethod · 0.95
selectMethod · 0.95
orderByMethod · 0.95
groupByMethod · 0.95

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected