-
Notifications
You must be signed in to change notification settings - Fork 42
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
Kick off data sources service #5022
base: main
Are you sure you want to change the base?
Conversation
5e93fb8
to
cb82429
Compare
85d8635
to
5d646db
Compare
This service will contain all the business logic to deal with data sources. Signed-off-by: Juan Antonio Osorio <[email protected]>
5d646db
to
f63c683
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might be wrong here, please keep me honest.
-- name: AddDataSourceFunction :one | ||
INSERT INTO data_sources_functions (data_source_id, name, type, definition) | ||
VALUES ($1, $2, $3, $4) RETURNING *; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: INSERTS
should always specify project_id
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@blkt there is no project_id in this table. It points to a data_sources row which already has a project ID check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add it?
-- name: UpdateDataSourceFunction :one | ||
UPDATE data_sources_functions | ||
SET type = $3, definition = $4, updated_at = NOW() | ||
WHERE data_source_id = $1 AND name = $2 | ||
RETURNING *; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: these statements should filter by project_id
as well.
-- name: DeleteDataSourceFunction :one | ||
DELETE FROM data_sources_functions | ||
WHERE data_source_id = $1 AND name = $2 | ||
RETURNING *; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: these statements should filter by project_id
as well.
-- name: ListDataSourceFunctions :many | ||
SELECT * FROM data_sources_functions | ||
WHERE data_source_id = $1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: this statement should join data sources to filter by project_id
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as above.
@blkt @teodor-yanev and I talked about this and agreed to include the project ID in the functions and relationships tables. @blkt will bring this in and I'll rebase on top of it. |
Summary
This service will contain all the business logic to deal with data
sources.
For the moment this only kicks off the
get
calls. But populating this shouldallow others to work on other function definitions.
Change Type
Mark the type of change your PR introduces:
Testing
Outline how the changes were tested, including steps to reproduce and any relevant configurations.
Attach screenshots if helpful.
Review Checklist: