MCPcopy Index your code
hub / github.com/ChatLab/ChatLab / formatRow

Function formatRow

packages/tools/src/sql/executor.ts:9–14  ·  view source on GitHub ↗
(template: string, row: Record<string, unknown>)

Source from the content-addressed store, hash-verified

7import type { ToolDefinition, ToolExecutionContext, ToolResult, SqlToolDef } from '../types'
8
9function formatRow(template: string, row: Record<string, unknown>): string {
10 return template.replace(/\{(\w+)\}/g, (_, col) => {
11 const val = row[col]
12 return val !== null && val !== undefined ? String(val) : ''
13 })
14}
15
16function resolveTemplate(
17 toolName: string,

Callers 1

createSqlToolDefinitionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected