MCPcopy Create free account
hub / github.com/Effect-TS/effect / makeCompiler

Function makeCompiler

packages/sql/clickhouse/src/ClickhouseClient.ts:573–590  ·  view source on GitHub ↗
(transform?: (_: string) => string)

Source from the content-addressed store, hash-verified

571 * @since 4.0.0
572 */
573export const makeCompiler = (transform?: (_: string) => string) =>
574 Statement.makeCompiler<ClickhouseCustom>({
575 dialect: "clickhouse",
576 placeholder(i, u) {
577 return `{p${i}: ${typeFromUnknown(u)}}`
578 },
579 onIdentifier: transform ?
580 function(value, withoutTransform) {
581 return withoutTransform ? escape(value) : escape(transform(value))
582 } :
583 escape,
584 onRecordUpdate() {
585 return ["", []]
586 },
587 onCustom(type, placeholder) {
588 return [placeholder(type), [type.paramB]]
589 }
590 })
591
592// compiler helpers
593

Callers 1

makeFunction · 0.70

Calls 2

escapeFunction · 0.50
transformFunction · 0.50

Tested by

no test coverage detected