diff --git a/Earthfile b/Earthfile index 5f0db1a10..5957fef0f 100644 --- a/Earthfile +++ b/Earthfile @@ -119,7 +119,7 @@ pre-commit: WAIT BUILD +openapi END - BUILD +generate-client + #BUILD +generate-client bench: FROM core+builder-image diff --git a/docker-compose.yml b/docker-compose.yml index 0b1ffdbf0..67630642a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -21,7 +21,7 @@ services: - postgres:/data/postgres ledger: - image: golang:1.19-alpine + image: golang:1.22-alpine entrypoint: go run main.go serve volumes: - .:/src diff --git a/internal/api/v2/utils.go b/internal/api/v2/utils.go index 22facac1a..624cfffd6 100644 --- a/internal/api/v2/utils.go +++ b/internal/api/v2/utils.go @@ -47,18 +47,18 @@ func getPITOOTFilter(r *http.Request) (*ledgerstore.PITFilter, error) { func getPITFilter(r *http.Request) (*ledgerstore.PITFilter, error) { pitString := r.URL.Query().Get("pit") - pit := time.Now() + var pit *time.Time if pitString != "" { - var err error - pit, err = time.ParseTime(pitString) + parsedPit, err := time.ParseTime(pitString) if err != nil { return nil, err } + pit = &parsedPit } return &ledgerstore.PITFilter{ - PIT: &pit, + PIT: pit, }, nil } diff --git a/internal/storage/ledgerstore/accounts.go b/internal/storage/ledgerstore/accounts.go index c45ced519..1f01d16cb 100644 --- a/internal/storage/ledgerstore/accounts.go +++ b/internal/storage/ledgerstore/accounts.go @@ -132,6 +132,8 @@ func (store *Store) accountQueryContext(qb query.Builder, q GetAccountsQuery) (s } return fmt.Sprintf("%s -> ? IS NOT NULL", key), []any{value}, nil + case key == "first_usage": + return fmt.Sprintf("%s %s ?", key, query.DefaultComparisonOperatorsMapping[operator]), []any{value}, nil default: return "", nil, newErrInvalidQuery("unknown key '%s' when building query", key) }