MCPcopy Create free account
hub / github.com/astercloud/aster / Get

Method Get

pkg/memory/logic/store_mysql.go:196–211  ·  view source on GitHub ↗

Get 获取单个 Memory

(ctx context.Context, namespace, key string)

Source from the content-addressed store, hash-verified

194
195// Get 获取单个 Memory
196func (s *MySQLStore) Get(ctx context.Context, namespace, key string) (*LogicMemory, error) {
197 if s.closed {
198 return nil, ErrStoreClosed
199 }
200
201 query := fmt.Sprintf(`
202 SELECT id, namespace, scope, type, category, `+"`key`"+`, value, description,
203 source_type, confidence, sources, provenance_created_at, provenance_updated_at, provenance_version,
204 access_count, last_accessed, metadata, created_at, updated_at
205 FROM %s
206 WHERE namespace = ? AND `+"`key`"+` = ?
207 `, s.tableName)
208
209 row := s.db.QueryRowContext(ctx, query, namespace, key)
210 return s.scanMemory(row)
211}
212
213// Delete 删除 Memory
214func (s *MySQLStore) Delete(ctx context.Context, namespace, key string) error {

Callers

nothing calls this directly

Calls 1

scanMemoryMethod · 0.95

Tested by

no test coverage detected