-
Notifications
You must be signed in to change notification settings - Fork 760
Implement InferenceQueries for Postgres #5915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f098854 to
f98ca8b
Compare
7c0807d to
a662ea1
Compare
f98ca8b to
73bf4fa
Compare
a662ea1 to
3d54063
Compare
73bf4fa to
b30f8b4
Compare
3d54063 to
cdfd5a9
Compare
fd9a7b3 to
a1c96c6
Compare
b30f8b4 to
e5d90b3
Compare
64cacd9 to
6e9cc21
Compare
a1c96c6 to
9e2cdae
Compare
5bcdb93 to
cb64a5e
Compare
4c85997 to
b8838e8
Compare
cb64a5e to
ac7926c
Compare
ac7926c to
43cfaef
Compare
43cfaef to
c1ca825
Compare
8662a07 to
52b9905
Compare
6cb9d7d to
7bbd8c2
Compare
7bbd8c2 to
e232cb9
Compare
d9e5966 to
49130eb
Compare
|
@BugBot review |
49130eb to
d749c33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
d749c33 to
a20bfa5
Compare
| message: "Filters are not yet supported for Postgres count queries".to_string(), | ||
| })); | ||
| } | ||
| if params.search_query_experimental.is_some() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need to sort out the index on JSONB columns - we need to add a trgm index on the text representation, and use the same expression in the query
|
@codex review |
|
Codex review is not enabled for this repo. Please contact the admins of this repo to enable Codex. |
|
@claude review |
Uncomment tests Implement delegating trait Push order and limit down to postgres
a20bfa5 to
d5f421f
Compare
This implements the main set of inference queries: list/get inferences, insert inferences, count inferences, and so on.
There's some duplication across InferenceQueries and InferenceCountQueries - will remove the InferenceCountQueries later. (Those were directly ported from the frontend.)
Step towards #5691.
Note
Medium Risk
Adds a large new Postgres query implementation and routes core inference/batch write paths through a new dual-write abstraction, which could affect inference persistence and query correctness despite feature-flag gating.
Overview
Implements full Postgres support for
InferenceQueries(list/count inferences, fetch outputs/tool params/output schema, and batch inserts for chat/json inferences), including SQL filter/order-by handling and UNION queries across chat/json tables.Updates the DB abstraction to support inference reads/writes via
DelegatingDatabaseConnectionand adds optional dual-write of chat/json inference rows to Postgres behind feature flags, wiring this through/inferenceand batch inference persistence.Refactors pagination validation into
ListInferencesParams::validate_pagination, addsStoredInferenceDatabase::timestamp(), generates new.sqlxquery metadata, and expands e2e inference query tests to run against both ClickHouse and Postgres.Written by Cursor Bugbot for commit 49130eb. This will update automatically on new commits. Configure here.