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

Function makeCompiler

packages/sql/mysql2/src/MysqlClient.ts:515–532  ·  view source on GitHub ↗
(transform?: (_: string) => string)

Source from the content-addressed store, hash-verified

513 * @since 4.0.0
514 */
515export const makeCompiler = (transform?: (_: string) => string) =>
516 Statement.makeCompiler({
517 dialect: "mysql",
518 placeholder(_) {
519 return `?`
520 },
521 onIdentifier: transform ?
522 function(value, withoutTransform) {
523 return withoutTransform ? escape(value) : escape(transform(value))
524 } :
525 escape,
526 onCustom() {
527 return ["", []]
528 },
529 onRecordUpdate() {
530 return ["", []]
531 }
532 })
533
534const escape = Statement.defaultEscape("`")
535

Callers 1

makeFunction · 0.70

Calls 2

escapeFunction · 0.50
transformFunction · 0.50

Tested by

no test coverage detected