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

Function makeCompiler

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

Source from the content-addressed store, hash-verified

517 * @since 4.0.0
518 */
519export const makeCompiler = (transform?: (_: string) => string) =>
520 Statement.makeCompiler<ClickhouseCustom>({
521 dialect: "sqlite",
522 placeholder(i, u) {
523 return `{p${i}: ${typeFromUnknown(u)}}`
524 },
525 onIdentifier: transform ?
526 function(value, withoutTransform) {
527 return withoutTransform ? escape(value) : escape(transform(value))
528 } :
529 escape,
530 onRecordUpdate() {
531 return ["", []]
532 },
533 onCustom(type, placeholder) {
534 return [placeholder(type), [type.paramB]]
535 }
536 })
537
538// compiler helpers
539

Callers 1

makeFunction · 0.70

Calls 2

escapeFunction · 0.50
transformFunction · 0.50

Tested by

no test coverage detected