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

Method Get

pkg/memory/logic/store_postgres.go:202–217  ·  view source on GitHub ↗

Get 获取单个 Memory

(ctx context.Context, namespace, key string)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

scanMemoryMethod · 0.95

Tested by

no test coverage detected