Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

DataSource.Postgres: move the history read out of PostgresDataProvider

Open
#121 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
72/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp, postgresql
Domain
database

Research direction

Start with SemiPlot/SemiPlot.DataSource.Postgres/PostgresDataProvider.cs and trace the listed history methods, then read PostgresHistoryReadTests.cs, ExplainPlanTests, and PostgresCompositionTests for the constraints on moving them. Move the history path into an internal reader constructed by the provider, preserving logging category, clock, exception mapping, and registrations. Done when both classes are under 300 lines, the architecture document names the reader, and dotnet test SemiPlot.slnx passes.

Written by the indexing model from the issue text.

Description

Problem

PostgresDataProvider (SemiPlot/SemiPlot.DataSource.Postgres/PostgresDataProvider.cs) is 600 lines against
the 300-line class limit in AGENTS.md. It holds four concerns: the realtime poll wiring, the pen catalogue read,
the archive extent read and the history read. The history read is the largest and the one that keeps growing:
QueryHistoryAsync (:123), ReadHistoryAsync (:199), LogHistoryRead (:246), BindLocalWindow
(:329), BindLocalBucketedWindow (:345), BucketFor (:367), ReadWindowAsync (:379),
ReadBucketedWindowAsync (:403), FillFreshTailAsync (:428), the row readers (:457-:482) and
HistoryReadOutcome (:594).

Proposed change

Move the history read into an internal type in SemiPlot.DataSource.Postgres (e.g. PostgresHistoryReader)
that PostgresDataProvider.QueryHistoryAsync delegates to. A pure refactor: no change to SQL, results, logging or
the IDataProvider surface.

Constraints

  • BindLocalWindow, BindLocalBucketedWindow and BucketFor are called by ExplainPlanTests and
    PostgresHistoryReadTests; they move with the reader and the tests follow.
  • The history-read log tests filter on the provider's logger category
    (PostgresHistoryReadTests.cs:659, entry.Category == typeof(PostgresDataProvider).FullName). Either the
    reader logs through ILogger<PostgresDataProvider>, or the category changes and the tests and the field-triage
    text in docs/architecture/data-integration.md follow.
  • PostgresCompositionTests builds the provider directly and pins the AddPostgresData registrations; the reader
    is constructed by the provider, not registered.
  • The fresh tail's clock (TimeProvider) and the exception mapper go to the reader with the read.

Acceptance

  • PostgresDataProvider.cs under 300 lines; the reader under 300 lines.
  • dotnet test SemiPlot.slnx green with no behaviour test changed beyond the moved member names.
  • docs/architecture/data-integration.md names the reader where it names the provider's history path.
Dominant language
C#
Stars
0
Forks
0
Avg merge
3h 25m
Merged PRs (30d)
31

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Semiteq/SemiPlot

All issues in Semiteq/SemiPlot

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.