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
()
| 11 | // |
| 12 | // Currently the cache stores two types of data: plugins and query analysis |
| 13 | func 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 | |
| 25 | func PluginsDir() (string, error) { |
| 26 | cacheRoot, err := Dir() |
no test coverage detected