Skip to content

Queries crate #16

Merged
YaroslavLitvinov merged 8 commits into
mainfrom
yaro/queries
Nov 17, 2025
Merged

Queries crate #16
YaroslavLitvinov merged 8 commits into
mainfrom
yaro/queries

Conversation

@YaroslavLitvinov
Copy link
Copy Markdown
Contributor

@YaroslavLitvinov YaroslavLitvinov commented Nov 15, 2025

Added queries crate + Queries trait

  • basic queries operations
  • basic test relying on existing postgres instance
  • deadpool, diesel-async, migrations
  • Added postgres conainer to tests workflow, for queries tests.

Comment thread crates/queries/src/crud.rs Outdated
@@ -0,0 +1,18 @@
use diesel::SelectableHelper;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

crud.rs -> operations.rs? query_repository.rs? Something else?

Comment thread Cargo.toml
debug = false

[workspace.dependencies]
queries = { path = "crates/queries" }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feature flag please

@YaroslavLitvinov YaroslavLitvinov marked this pull request as draft November 15, 2025 20:41
@YaroslavLitvinov YaroslavLitvinov changed the title [WIP] Queries Queries Nov 15, 2025
@YaroslavLitvinov YaroslavLitvinov changed the title Queries Queries crate Nov 15, 2025
@YaroslavLitvinov YaroslavLitvinov marked this pull request as ready for review November 15, 2025 23:33
'running',
'successful',
'failed',
'canceled',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

queued_at TIMESTAMP WITH TIME ZONE,
running_at TIMESTAMP WITH TIME ZONE,
successful_at TIMESTAMP WITH TIME ZONE,
failed_at TIMESTAMP WITH TIME ZONE,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just single timestamp, status should describe the state, like failed, cancelled, etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe those final (cancelled, timed out, failed, successful) states could reuse the same timestamp like finished_at, but other intermediate separate timestamps give information on how many time query spends on every stage.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does limit_exceeded_at mean?
and what it the difference between queued_at and created_at?
Is running_at means that we can have some queries queue and run it when the server is ready?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concurrent limit exceeded is actually a state. queued is reserved and it is probably one of intermediate states. All this is represented in a design document.

@YaroslavLitvinov YaroslavLitvinov merged commit 0cb646c into main Nov 17, 2025
3 checks passed
@YaroslavLitvinov YaroslavLitvinov deleted the yaro/queries branch November 17, 2025 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants