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

feat(sdk/go): implement mysql SDK for TinyGo #1794

Merged
merged 10 commits into from
Oct 17, 2023

Conversation

Patrick0308
Copy link
Contributor

feat(sdk/go): implement mysql SDK for TinyGo

@Patrick0308
Copy link
Contributor Author

Test spin build error. See:

Building component tinygo-mysql with `tinygo build -target=wasi -gc=leaking -o main.wasm main.go`
# github.com/fermyon/spin/sdk/go/mysql
../../../../../../opt/homebrew/Cellar/tinygo/0.30.0/lib/clang/include/stdbool.h:20:14: undefined: C._Bool
Error: Build command for component tinygo-mysql failed with status Exited(1)

I create a issue on Tinygo tinygo-org/tinygo#3926 .

@itowlson
Copy link
Contributor

Thanks for this, and for flagging the upstream problem to the TinyGo folks - looks like they already have a fix so hopefully in the next version...

@Patrick0308
Copy link
Contributor Author

@adamreese PTAL

Copy link
Member

@adamreese adamreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I tested out on TinyGo dev. We need to wait to merge until the C._Bool issue is released in TinyGo.

sdk/go/mysql/internals.go Outdated Show resolved Hide resolved
@itowlson
Copy link
Contributor

@Patrick0308 I think a rebase will take care of the weird wit-bindgen compilation errors in CI. Thanks for sticking with this!

Signed-off-by: Patrick <patrickjiang0530@gmail.com>
Signed-off-by: Patrick <patrickjiang0530@gmail.com>
Signed-off-by: Patrick <patrickjiang0530@gmail.com>
Signed-off-by: Patrick <patrickjiang0530@gmail.com>
Signed-off-by: Patrick <patrickjiang0530@gmail.com>
Signed-off-by: Patrick <patrickjiang0530@gmail.com>
Signed-off-by: Patrick <patrickjiang0530@gmail.com>
Signed-off-by: Patrick <patrickjiang0530@gmail.com>
Signed-off-by: Patrick <patrickjiang0530@gmail.com>
Signed-off-by: Patrick <patrickjiang0530@gmail.com>
@Patrick0308
Copy link
Contributor Author

@adamreese @itowlson I replaced C._Bool to bool then testing the program went smoothly. So we don't need to wait util tinygo-org/tinygo#3926 is released.

Copy link
Member

@adamreese adamreese left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your great work on this feature! This is awesome

@adamreese adamreese merged commit 4a4fdb3 into fermyon:main Oct 17, 2023
9 checks passed
@Patrick0308 Patrick0308 deleted the feat-tingo-mysql-sdk branch October 26, 2023 01:46
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