MCPcopy Create free account
hub / github.com/andywer/postguard / filterDuplicateTableRefs

Function filterDuplicateTableRefs

src/postgres/resolve-references.ts:6–14  ·  view source on GitHub ↗
(tableRefs: TableReference[])

Source from the content-addressed store, hash-verified

4import { getNodeType, isColumnRef, isPgString, isStar } from "./pg-node-types"
5
6export function filterDuplicateTableRefs(tableRefs: TableReference[]) {
7 return tableRefs.reduce(
8 (filtered, ref) =>
9 filtered.find(someRef => JSON.stringify(someRef) === JSON.stringify(ref))
10 ? filtered
11 : [...filtered, ref],
12 [] as TableReference[]
13 )
14}
15
16export function resolveTableName(
17 tableIdentifier: string,

Callers 3

getReferencedColumnsFunction · 0.90
resolveColumnReferenceFunction · 0.85
resolveResTargetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected