[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/store/RFC.md fully. Find features d... #122
3 changed files with 6 additions and 6 deletions
|
|
@ -116,7 +116,7 @@ func (storeInstance *Store) Compact(options CompactOptions) core.Result {
|
|||
}()
|
||||
|
||||
for _, entry := range archiveEntries {
|
||||
lineMap, err := compactArchiveLine(entry)
|
||||
lineMap, err := archiveEntryLine(entry)
|
||||
if err != nil {
|
||||
return core.Result{Value: err, OK: false}
|
||||
}
|
||||
|
|
@ -167,7 +167,7 @@ func (storeInstance *Store) Compact(options CompactOptions) core.Result {
|
|||
return core.Result{Value: outputPath, OK: true}
|
||||
}
|
||||
|
||||
func compactArchiveLine(entry compactArchiveEntry) (map[string]any, error) {
|
||||
func archiveEntryLine(entry compactArchiveEntry) (map[string]any, error) {
|
||||
fields := make(map[string]any)
|
||||
fieldsResult := core.JSONUnmarshalString(entry.fieldsJSON, &fields)
|
||||
if !fieldsResult.OK {
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ func (storeInstance *Store) QueryJournal(flux string) core.Result {
|
|||
return storeInstance.queryJournalRows(trimmedQuery)
|
||||
}
|
||||
|
||||
selectSQL, arguments, err := storeInstance.queryJournalFlux(trimmedQuery)
|
||||
selectSQL, arguments, err := storeInstance.queryJournalFromFlux(trimmedQuery)
|
||||
if err != nil {
|
||||
return core.Result{Value: err, OK: false}
|
||||
}
|
||||
|
|
@ -145,7 +145,7 @@ func (storeInstance *Store) queryJournalRows(query string, arguments ...any) cor
|
|||
return core.Result{Value: inflateJournalRows(rowMaps), OK: true}
|
||||
}
|
||||
|
||||
func (storeInstance *Store) queryJournalFlux(flux string) (string, []any, error) {
|
||||
func (storeInstance *Store) queryJournalFromFlux(flux string) (string, []any, error) {
|
||||
queryBuilder := core.NewBuilder()
|
||||
queryBuilder.WriteString("SELECT bucket_name, measurement, fields_json, tags_json, committed_at, archived_at FROM ")
|
||||
queryBuilder.WriteString(journalEntriesTableName)
|
||||
|
|
|
|||
|
|
@ -319,12 +319,12 @@ func (workspace *Workspace) Discard() {
|
|||
}
|
||||
|
||||
// Usage example: `result := workspace.Query("SELECT entry_kind, COUNT(*) AS count FROM workspace_entries GROUP BY entry_kind")`
|
||||
func (workspace *Workspace) Query(sqlQuery string) core.Result {
|
||||
func (workspace *Workspace) Query(query string) core.Result {
|
||||
if err := workspace.ensureReady("store.Workspace.Query"); err != nil {
|
||||
return core.Result{Value: err, OK: false}
|
||||
}
|
||||
|
||||
rows, err := workspace.workspaceDatabase.Query(sqlQuery)
|
||||
rows, err := workspace.workspaceDatabase.Query(query)
|
||||
if err != nil {
|
||||
return core.Result{Value: core.E("store.Workspace.Query", "query workspace", err), OK: false}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue