MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / SetPlatformSetting

Method SetPlatformSetting

internal/store/platform_settings.go:16–22  ·  view source on GitHub ↗

SetPlatformSetting upserts a platform setting.

(key, value string)

Source from the content-addressed store, hash-verified

14
15// SetPlatformSetting upserts a platform setting.
16func (s *Store) SetPlatformSetting(key, value string) error {
17 _, err := s.db.Exec(s.q(`
18 INSERT INTO platform_settings (key, value, updated_at) VALUES (?, ?, ?)
19 ON CONFLICT(key) DO UPDATE SET value = excluded.value, updated_at = excluded.updated_at
20 `), key, value, now())
21 return err
22}
23
24// GetPlatformSettings returns all platform settings as a map.
25func (s *Store) GetPlatformSettings() (map[string]string, error) {

Calls 3

qMethod · 0.95
nowFunction · 0.85
ExecMethod · 0.80