-
Notifications
You must be signed in to change notification settings - Fork 91
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
Component metadata and ApiDefinition data serde #629
Conversation
golem-component-service-base/tests/db/migration/sqlite/001__init.sql
Outdated
Show resolved
Hide resolved
golem-component-service-base/tests/db/migration/sqlite/001__init.sql
Outdated
Show resolved
Hide resolved
golem-component-service-base/tests/db/migration/sqlite/001__init.sql
Outdated
Show resolved
Hide resolved
golem-component-service-base/tests/db/migration/postgres/001__init.sql
Outdated
Show resolved
Hide resolved
golem-component-service-base/tests/db/migration/postgres/001__init.sql
Outdated
Show resolved
Hide resolved
golem-component-service-base/tests/db/migration/postgres/001__init.sql
Outdated
Show resolved
Hide resolved
sqlx::query( | ||
r#" | ||
INSERT INTO components | ||
(namespace, component_id, name) |
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.
if namespace and component_id are part of key, then you can avoid extra checks probably
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.
and Unique
name for each namespace
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.
@afsalthaj there is already a unique index on (namespace, name)
. And component_id
is a PK.
We are creating a new version here (in component_version
). And for each new version we are creating component
record first. It might exists already (if there are other versions) or not (if we are creating the first versions) - both options are not an error.
The only problem here is if we are trying to create a new version for some component id with different namespace or name comparing to the previous version.
So I can see response mapping being a string in proto, while previously bincode - encode decode directly serde'd. |
Changes to be done after we moved to profobuf
# Conflicts: # golem-worker-service/src/grpcapi/api_definition.rs # golem-worker-service/src/grpcapi/worker.rs
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.
Unused index and no name validation on create. Otherwise perfect.
related to: #498
golem-component-service-base
FunctionParameter
,FunctionResult
-tpe
->typ