Skip to content
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

Implenet new datamodel on the backend #9

Merged
merged 5 commits into from
Sep 6, 2024

Conversation

j-maynard
Copy link
Collaborator

@j-maynard j-maynard commented Aug 14, 2024

Make all the changes to the backend to support the new database model.

Copy link

@andyjpb andyjpb left a comment

Choose a reason for hiding this comment

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

A nice start! :-)

Just a few actions:

  • Separate out stream refactoring into its own commit.
  • Separate out structural model stuff into its own commit.
  • Separate out user data model stuff into its own commit.
  • Separate out routes and stuff into their own commit(s) that build on the groundwork from the structural model commit.
  • Provide a commit full of tests / example data to fill up the structural model: at least a few cubes with a few different dimensions, revisions and sources that demonstrate all the functionality so far.
  • Provide commit messages for all commits to explain rationale, design, progress so far, limitations, assumptions and general documentation for what we're thinking.

src/controllers/blob-storage.ts Outdated Show resolved Hide resolved
src/controllers/csv-processor.ts Show resolved Hide resolved
src/controllers/csv-processor.ts Outdated Show resolved Hide resolved
src/controllers/csv-processor.ts Outdated Show resolved Hide resolved
src/entity2/import.ts Outdated Show resolved Hide resolved
src/route/dataset-route.ts Outdated Show resolved Hide resolved
src/route/dataset-route.ts Outdated Show resolved Hide resolved
src/route/dataset-route.ts Outdated Show resolved Hide resolved
src/route/dataset-route.ts Outdated Show resolved Hide resolved
src/route/dataset-route.ts Outdated Show resolved Hide resolved
This now makes better use of streams.  It completes the use of the new
data model with end points for viewing the dataset and getting a preview
of the uploaded datafile.
@j-maynard j-maynard changed the title Implenet new datamodel on the backend (DRAFT) Implenet new datamodel on the backend Sep 3, 2024
Copy link
Collaborator

@wheelsandcogs wheelsandcogs left a comment

Choose a reason for hiding this comment

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

Looks pretty good, I've added quite a few comments but some of it is for my understanding and the rest are bitty things that should be easy to remedy.

If you find I'm too pedantic let me know and I can tweak the levels down a bit 😄

Some general comments:

  • We're missing return types on most functions - is this something we want to start getting into the habit of providing? If so, we can add a lint warning when they're missing?
  • This is just semantics but I'd say BlobStorageService and CSVProcessor are both services rather than controllers. Do we want to make CSVProcessor a class also?
  • The switching of column types based on environment == test feels a bit strange, I'm assuming it's to do with some issue you had using the proper types when testing? I've not had to do this before so maybe we can resolve it with test config or mocks?
  • There are currently no indexes on any of the entities, we might want to do a pass looking at what fields are used in queries and adding indexes on those fields.

.prettierrc Outdated Show resolved Hide resolved
src/controllers/csv-processor.ts Outdated Show resolved Hide resolved
src/controllers/csv-processor.ts Outdated Show resolved Hide resolved
src/controllers/csv-processor.ts Outdated Show resolved Hide resolved
src/controllers/csv-processor.ts Outdated Show resolved Hide resolved
src/entity2/users.ts Outdated Show resolved Hide resolved
src/entity2/users.ts Outdated Show resolved Hide resolved
src/entity2/users.ts Outdated Show resolved Hide resolved
src/migration/1723729297617-migration.ts Show resolved Hide resolved
src/migration/1723729297617-migration.ts Show resolved Hide resolved
@j-maynard j-maynard force-pushed the SW-95-implement-new-data-model branch from bbda21e to 29db52e Compare September 6, 2024 12:44
Copy link
Collaborator

@wheelsandcogs wheelsandcogs left a comment

Choose a reason for hiding this comment

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

ship it 🚢

@j-maynard j-maynard merged commit 263433c into main Sep 6, 2024
3 checks passed
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.

3 participants