You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 29, 2023. It is now read-only.
let directory = client.host().directory(...)client.from().container().with_directory("/", directory.id().await?)
This is quite a bit more verbose, and not as efficient.
All the sdks does this differently, for dynamic languages a directory is transmuted into a directoryId on read time when a final execution is called .exit_code etc. Or in golang, where an interface is implemented to tell the serializer that it contains an ID, and that it should be called, when an arg is tried to be serialized. Such that a directory (struct) as an arg is serialized as id (string).
The benefit of this process is that the intermediary steps aren't executed eagerly. Right now .file() or .directory() are executed when passed to another function, instead of when .exit_code() or equivalent is called.
There are a few blockers for fixing this:
Serialization should be moved to execution, this means somehow storing the raw arg, this can be tricky as Rust is not very happy about dynamic types, in go the raw pointer (interface{}) is stored, this is mostly not an option in rust, it can be done, and is potentially our only option. Another option is storing a closure, this preserves input information, but again, rust really, really is janky when storing special expressions like lambdas.
Non-standard serialization: Enums are handled differently in graphql, than json, (they are explicit values TYPE instead of "type", i.e. graphql wants non string wrapped types, while json always wants strings wrapped. It isn't possible override serdes implementation here, so instead I've opted to just remove the quotes from the string manually before passing them to the requester. Again, this may be solved using a closure, or embedding extra information in the arg, or implementing an entirely custom serializer, like what is done in go.
This will probably be fixed in a single change. I am probably gonna do some experiments to see what the easiest solution will be.
The idea behind this is to support what the other sdks do with
id()
.I.e.
vs
This is quite a bit more verbose, and not as efficient.
All the sdks does this differently, for dynamic languages a directory is transmuted into a directoryId on read time when a final execution is called
.exit_code
etc. Or in golang, where an interface is implemented to tell the serializer that it contains an ID, and that it should be called, when an arg is tried to be serialized. Such that adirectory (struct)
as an arg is serialized asid (string)
.The benefit of this process is that the intermediary steps aren't executed eagerly. Right now
.file() or .directory()
are executed when passed to another function, instead of when.exit_code()
or equivalent is called.There are a few blockers for fixing this:
TYPE
instead of"type"
, i.e. graphql wants non string wrapped types, while json always wants strings wrapped. It isn't possible override serdes implementation here, so instead I've opted to just remove the quotes from the string manually before passing them to the requester. Again, this may be solved using a closure, or embedding extra information in the arg, or implementing an entirely custom serializer, like what is done in go.This will probably be fixed in a single change. I am probably gonna do some experiments to see what the easiest solution will be.
The specifics are this:
dagger-sdk/crates/dagger-sdk/src/querybuilder.rs
Line 56 in 2a29a66
should be moved to this:
dagger-sdk/crates/dagger-sdk/src/querybuilder.rs
Lines 96 to 98 in 2a29a66
The text was updated successfully, but these errors were encountered: