| 571 | * @since 4.0.0 |
| 572 | */ |
| 573 | export 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 | |