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

Component metadata and ApiDefinition data serde #629

Merged
merged 32 commits into from
Jul 12, 2024
Merged

Conversation

justcoon
Copy link
Contributor

@justcoon justcoon commented Jun 29, 2024

related to: #498

  • added namespace to component, metadata using proto for serialization, with version
  • repository and service moved to golem-component-service-base
  • fixed naming for FunctionParameter, FunctionResult - tpe -> typ
  • api definition serialization changed from bincode to proto, proto for golem-rib

golem-component-service-base/src/repo/component.rs Outdated Show resolved Hide resolved
golem-component-service-base/src/repo/component.rs Outdated Show resolved Hide resolved
golem-component-service-base/src/repo/component.rs Outdated Show resolved Hide resolved
golem-component-service-base/src/repo/component.rs Outdated Show resolved Hide resolved
golem-component-service-base/src/repo/component.rs Outdated Show resolved Hide resolved
sqlx::query(
r#"
INSERT INTO components
(namespace, component_id, name)
Copy link
Contributor

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

Copy link
Contributor

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

Copy link
Contributor

@senia-psm senia-psm Jul 3, 2024

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.

@afsalthaj
Copy link
Contributor

So I can see response mapping being a string in proto, while previously bincode - encode decode directly serde'd.
While there is a serde involved, it is definitely faster than combine-parsing Expr again!

https://zivergeteam.slack.com/archives/C057S2E4XT5/p1720164992876289?thread_ts=1720164896.439539&cid=C057S2E4XT5

@afsalthaj afsalthaj dismissed their stale review July 5, 2024 09:45

Changes to be done after we moved to profobuf

Copy link
Contributor

@senia-psm senia-psm left a 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.

@justcoon justcoon merged commit e68f3f5 into main Jul 12, 2024
14 checks passed
@justcoon justcoon deleted the component_serde branch July 12, 2024 17:06
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.

3 participants