-
Notifications
You must be signed in to change notification settings - Fork 270
How to design the WIT layer for pg host component #576
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
Comments
Oh, I found the item of https://github.com/bytecodealliance/wit-bindgen/blob/main/WIT.md#item-resource Wish it helps. |
I agree that representing a
Since PostgreSQL has a lot of types, that would end up being a lot of methods, and even then it wouldn't support all the user-defined |
I found that the redis outbound sample is too simple, on every publish/set/get, it open and close the connection in the host function implementation. This design avoids the definition of something like |
And for the returned results of |
I've done the concept verification, later pull request. |
@miketang84 You might find this interesting: https://github.com/theduke/wasi-sql/blob/main/schema/sql_v1_alpha1.wit |
Cool, thank you! @dicej |
Spin now has an official Postgres host component, and there's an ongoing effort to define a standard interface for SQL, so I'm going to close this. Further discussion should probably happen at the |
Uh oh!
There was an error while loading. Please reload this page.
Hi, I'm designing the feature of supporting the postgres as a host component, the first problem is:
The client.query() returns
Vec<Row>
which is defined in https://docs.rs/tokio-postgres/0.7.6/tokio_postgres/row/struct.Row.html.And the outbound-redis sample just uses a plain string as parameters.
I wonder that if I need to map the definition of Row and its inner types into the wit types one by one (maybe it's difficult, and it has two generics in its' method parameters), or is there some simple way to just use the string as input and output parameters.
Thank you.
The text was updated successfully, but these errors were encountered: