MCPcopy
hub / github.com/prisma/prisma / applySqlCommenters

Function applySqlCommenters

packages/client-engine-runtime/src/sql-commenter.ts:42–58  ·  view source on GitHub ↗
(
  plugins: SqlCommenterPlugin[],
  context: SqlCommenterContext,
)

Source from the content-addressed store, hash-verified

40 * that could affect other plugins.
41 */
42export function applySqlCommenters(
43 plugins: SqlCommenterPlugin[],
44 context: SqlCommenterContext,
45): Record<string, string> {
46 const merged: Record<string, string> = {}
47
48 for (const plugin of plugins) {
49 const tags = plugin(klona(context))
50 for (const [key, value] of Object.entries(tags)) {
51 if (value !== undefined) {
52 merged[key] = value
53 }
54 }
55 }
56
57 return merged
58}
59
60/**
61 * Applies SQL commenter plugins and returns the formatted comment.

Callers 3

executeMethod · 0.90
buildSqlCommentFunction · 0.85

Calls 2

pluginFunction · 0.85
entriesMethod · 0.80

Tested by

no test coverage detected