Skip to content

Query as API - #165

Open
breadchris wants to merge 7 commits into
scratchdata:mainfrom
breadchris:queries-as-an-api-164
Open

Query as API#165
breadchris wants to merge 7 commits into
scratchdata:mainfrom
breadchris:queries-as-an-api-164

Conversation

@breadchris

Copy link
Copy Markdown
Contributor

Resolves #164

Comment thread pkg/storage/database/models/models.go Outdated
Destination Destination `gorm:"constraint:OnDelete:CASCADE"`
HashedAPIKey string `gorm:"index"`
// If the API key is specific to a saved query
SavedQueryID uint

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.

One comment here (I realize this is copied from my existing branch.) I'd started to refactor this so that the APIKey table does not have a SavedQuery, and instead use a Join table, ie, apikey_savedquery. Then I just added an APIKey "type" (QUERY, GENERAL - or something more descriptive) that tells me about who the key belongs to.

This also then lets me create a single API key and give it access to multiple endpoints. And it didn't make sense the QueryParams be in this table either since it's such a specific use case.

@breadchris
breadchris marked this pull request as ready for review April 19, 2024 17:30
@breadchris breadchris mentioned this pull request Apr 20, 2024
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.

Queries as an API

2 participants