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

Function makeCompiler

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

Source from the content-addressed store, hash-verified

459 * @since 4.0.0
460 */
461export const makeCompiler = (transform?: (_: string) => string) =>
462 Statement.makeCompiler({
463 dialect: "mysql",
464 placeholder(_) {
465 return `?`
466 },
467 onIdentifier: transform ?
468 function(value, withoutTransform) {
469 return withoutTransform ? escape(value) : escape(transform(value))
470 } :
471 escape,
472 onCustom() {
473 return ["", []]
474 },
475 onRecordUpdate() {
476 return ["", []]
477 }
478 })
479
480const escape = Statement.defaultEscape("`")
481

Callers 1

makeFunction · 0.70

Calls 2

escapeFunction · 0.50
transformFunction · 0.50

Tested by

no test coverage detected