MCPcopy
hub / github.com/sqlc-dev/sqlc / Dir

Function Dir

internal/cache/cache.go:13–23  ·  view source on GitHub ↗

The cache directory defaults to os.UserCacheDir(). This location can be overridden by the SQLCCACHE environment variable. Currently the cache stores two types of data: plugins and query analysis

()

Source from the content-addressed store, hash-verified

11//
12// Currently the cache stores two types of data: plugins and query analysis
13func Dir() (string, error) {
14 cache := os.Getenv("SQLCCACHE")
15 if cache != "" {
16 return cache, nil
17 }
18 cacheHome, err := os.UserCacheDir()
19 if err != nil {
20 return "", err
21 }
22 return filepath.Join(cacheHome, "sqlc"), nil
23}
24
25func PluginsDir() (string, error) {
26 cacheRoot, err := Dir()

Callers 2

PluginsDirFunction · 0.85
AnalysisDirFunction · 0.85

Calls 1

JoinMethod · 0.45

Tested by

no test coverage detected