MCPcopy Index your code
hub / github.com/Permify/permify / setDefaultQueryExecMode

Function setDefaultQueryExecMode

pkg/database/postgres/postgres.go:219–235  ·  view source on GitHub ↗
(config *pgx.ConnConfig)

Source from the content-addressed store, hash-verified

217}
218
219func setDefaultQueryExecMode(config *pgx.ConnConfig) {
220 // Default mode if no specific mode is found in the connection string
221 defaultMode := "cache_statement"
222
223 // Iterate through the map keys to check if any are mentioned in the connection string
224 for key := range queryExecModes {
225 if strings.Contains(config.ConnString(), "default_query_exec_mode="+key) {
226 config.DefaultQueryExecMode = queryExecModes[key]
227 slog.Info("setDefaultQueryExecMode", slog.String("mode", key))
228 return
229 }
230 }
231
232 // Set to default mode if no matching mode is found
233 config.DefaultQueryExecMode = queryExecModes[defaultMode]
234 slog.Warn("setDefaultQueryExecMode", slog.String("mode", defaultMode))
235}
236
237var planCacheModes = map[string]string{
238 "auto": "auto",

Callers 1

newDBFunction · 0.85

Calls 3

InfoMethod · 0.80
WarnMethod · 0.80
StringMethod · 0.65

Tested by

no test coverage detected