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

Add discovery repository #8

Merged
merged 1 commit into from
Sep 14, 2023
Merged

Add discovery repository #8

merged 1 commit into from
Sep 14, 2023

Conversation

michalsidzej
Copy link
Contributor

Resolves L2B-2261

@linear
Copy link

linear bot commented Sep 13, 2023

L2B-2261 Set up the DB repository for DiscoveryIndexer

Take it from L2Beat

@vercel
Copy link

vercel bot commented Sep 13, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
lz-monitoring-frontend ✅ Ready (Inspect) Visit Preview Sep 14, 2023 2:01pm

@@ -11,8 +11,14 @@ declare module 'knex/types/tables' {
last_updated: Date
}

interface DiscoveryRow {
one_row_id: true
Copy link
Member

Choose a reason for hiding this comment

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

Why one_row_id? 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a trick that makes sure we store only one row in this table.


function toRecord(row: DiscoveryRow): DiscoveryRecord {
return {
discoveryOutput: row.discovery_json_blob as unknown as DiscoveryOutput,
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should consider schema validation in the future ❔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is not necessary, as only this repository will write to this table. I think that we could be storing individual values in the future (maybe). I agree that this is something we should think about.

@michalsidzej michalsidzej merged commit bf58ac5 into main Sep 14, 2023
5 checks passed
@michalsidzej michalsidzej deleted the feat/discovery-repository branch September 14, 2023 14:04
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.

2 participants