| 517 | * @since 4.0.0 |
| 518 | */ |
| 519 | export 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 | |