Get 获取单个 Memory
(ctx context.Context, namespace, key string)
| 200 | |
| 201 | // Get 获取单个 Memory |
| 202 | func (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 |
| 220 | func (s *PostgreSQLStore) Delete(ctx context.Context, namespace, key string) error { |
nothing calls this directly
no test coverage detected