MCPcopy Create free account
hub / github.com/Chat2AnyLLM/code-agent-manager / Init

Method Init

internal/metadata/store.go:34–47  ·  view source on GitHub ↗

Init creates metadata tables if they do not exist and runs idempotent migrations.

(ctx context.Context)

Source from the content-addressed store, hash-verified

32
33// Init creates metadata tables if they do not exist and runs idempotent migrations.
34func (s *Store) Init(ctx context.Context) error {
35 db, err := s.open()
36 if err != nil {
37 return err
38 }
39 defer db.Close()
40 if _, err = db.ExecContext(ctx, schemaSQL); err != nil {
41 return fmt.Errorf("metadata: init schema: %w", err)
42 }
43 if err := s.runMigrations(ctx, db); err != nil {
44 return fmt.Errorf("metadata: migrations: %w", err)
45 }
46 return nil
47}
48
49// UpsertItem inserts or updates a metadata item by (kind, install_key).
50func (s *Store) UpsertItem(ctx context.Context, item Item) error {

Callers 15

UpsertItemMethod · 0.95
UpsertItemsMethod · 0.95
DeleteStaleMethod · 0.95
SearchMethod · 0.95
CountMethod · 0.95
GetItemMethod · 0.95
MarkInstalledMethod · 0.95
MarkUninstalledMethod · 0.95
TestUpsertAndSearchFunction · 0.95
TestSearchByKindFilterFunction · 0.95

Calls 2

openMethod · 0.95
runMigrationsMethod · 0.95