MCPcopy
hub / github.com/Effect-TS/effect / generateColumns

Function generateColumns

packages/sql/src/internal/statement.ts:822–836  ·  view source on GitHub ↗
(
  keys: ReadonlyArray<string>,
  escape: (_: string, withoutTransform: boolean) => string,
  withoutTransform: boolean
)

Source from the content-addressed store, hash-verified

820}
821
822const generateColumns = (
823 keys: ReadonlyArray<string>,
824 escape: (_: string, withoutTransform: boolean) => string,
825 withoutTransform: boolean
826) => {
827 if (keys.length === 0) {
828 return "()"
829 }
830
831 let str = `(${escape(keys[0], withoutTransform)}`
832 for (let i = 1; i < keys.length; i++) {
833 str += `,${escape(keys[i], withoutTransform)}`
834 }
835 return str + ")"
836}
837
838/** @internal */
839export function defaultEscape(c: string) {

Callers 1

compileMethod · 0.85

Calls 1

escapeFunction · 0.50

Tested by

no test coverage detected