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

[documentation] database schema #624

Open
jaimeventura opened this issue May 27, 2021 · 4 comments
Open

[documentation] database schema #624

jaimeventura opened this issue May 27, 2021 · 4 comments
Labels
tech-debt General code-cleanup

Comments

@jaimeventura
Copy link

jaimeventura commented May 27, 2021

Hello.
Im looking at file https://github.com/lacuna-tech/mds-core/blob/develop/packages/mds-db/schema.ts, for analysing the database schema.
But, is there any documentation about it?
I can do some educated guesses about it. Still it would be great to have de detailed explanation of each table and column.

Thanks.

@avatarneil
Copy link

Hi @jaimeventura, thanks for making this issue! Sorry for not getting to this for a couple weeks; too many GitHub notifications 😅

mds-db is currently being phased out in favor of TypeORM managed services (because of the size of this repo and the lack of immediate business value, it has been a rather slow process). The schema definitions found in mds-db there are considered reasonably deprecated, and exist solely so the legacy DB access methods (anything in mds-db) still typecheck. At the moment, most services in this repo are simply using TypeORM for table management (schemas, migrations, etc...) as opposed to using TypeORM for read/write methods; however, some examples of using TypeORM for db access can be found in the mds-geography-service (we're starting to phase them in where we find immediate need).

I absolutely agree that there should be some more documentation around the table schemas, and the hope is that once we've migrated all of the db access methods to the individual services, it will be self-documenting in a sense (usage of the tables will be very clear, and isolated to services which describe them in the README at a high-level). This, in combination with JSDoc comments, ought to satisfy documentation desires! We've historically used TypeDoc for generating documentation straight from the Typescript codebase (it pulls in JSDoc comments for additional context and all that jazz), however that's in a bit of a messy state (at least last I checked, I'll poke around again tonight) due to TypeDoc undergoing extremely breaking changes a couple versions ago (changes which, unfortunately, completely bork our monorepo-wide documentation generation), and the legacy version of TypeDoc doesn't support newer versions of Typescript so it's unusable for this project.

What I imagine you're most interested in, is the schemas which directly relate to the Agency, Policy, and Geography APIs.

While we work on this long lived tech debt cleanup, are there any entities you have specific questions about I could help answer?

@avatarneil avatarneil added the tech-debt General code-cleanup label Jun 10, 2021
@avatarneil
Copy link

Some more follow-up on this, I'm investigating getting TypeDoc working again in this project! Seems like support for monorepos was recently added, which is fantastic, however there are some performance issues we're running into given the size of this project. See TypeStrong/typedoc#1606 for details :)

@jaimeventura
Copy link
Author

Hey @avatarneil

While we work on this long lived tech debt cleanup, are there any entities you have specific questions about I could help answer?
Not really. Im considering starting a project to provide a frontend app do manage the data on the database.
As far as i understood, there's so such app where i could for instance, add policies to be available to the providers via MDS API, provide stats over the vehicle usage, ...

Knowing about the spec and looking at the database, i can make educated guesses about this. Still, having a formal document would be nice.

Thanks,

@jaimeventura
Copy link
Author

@avatarneil, sorry i mistakenly closed the issue.
but im dont know if its worth to keep it open until someone create such document or not. I'll leave the decision to you.

@avatarneil avatarneil reopened this Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech-debt General code-cleanup
Projects
None yet
Development

No branches or pull requests

2 participants