MCPcopy Index your code
hub / github.com/sqlc-dev/sqlc / pluginCodegen

Function pluginCodegen

internal/cmd/shim.go:22–41  ·  view source on GitHub ↗
(cs config.CombinedSettings, s config.Codegen)

Source from the content-addressed store, hash-verified

20}
21
22func pluginCodegen(cs config.CombinedSettings, s config.Codegen) *plugin.Codegen {
23 opts, err := convert.YAMLtoJSON(s.Options)
24 if err != nil {
25 panic(err)
26 }
27 cg := &plugin.Codegen{
28 Out: s.Out,
29 Plugin: s.Plugin,
30 Options: opts,
31 }
32 for _, p := range cs.Global.Plugins {
33 if p.Name == s.Plugin {
34 cg.Env = p.Env
35 cg.Process = pluginProcess(p)
36 cg.Wasm = pluginWASM(p)
37 return cg
38 }
39 }
40 return cg
41}
42
43func pluginProcess(p config.Plugin) *plugin.Codegen_Process {
44 if p.Process != nil {

Callers 1

pluginSettingsFunction · 0.85

Calls 3

YAMLtoJSONFunction · 0.92
pluginProcessFunction · 0.85
pluginWASMFunction · 0.85

Tested by

no test coverage detected