MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / hasColumn

Function hasColumn

packages/server/src/utils/database.util.ts:3–13  ·  view source on GitHub ↗
(queryRunner: QueryRunner, tableName: string, columnName: string)

Source from the content-addressed store, hash-verified

1import { QueryRunner } from 'typeorm'
2
3export async function hasColumn(queryRunner: QueryRunner, tableName: string, columnName: string): Promise<boolean> {
4 const table = await queryRunner.getTable(tableName)
5
6 if (!table) {
7 throw new Error(`Table ${tableName} not found`)
8 }
9
10 const hasColumn = table.columns.some((column) => column.name === columnName)
11
12 return hasColumn
13}

Callers 4

upMethod · 0.90
upMethod · 0.90
upMethod · 0.90
upMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected