Get 获取单个 Memory
(ctx context.Context, namespace, key string)
| 194 | |
| 195 | // Get 获取单个 Memory |
| 196 | func (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 |
| 214 | func (s *MySQLStore) Delete(ctx context.Context, namespace, key string) error { |
nothing calls this directly
no test coverage detected