Comments (3)
Unfortunately, the current preview of WASI (WebAssembly System Interface) does not provide for outbound sockets, so TinyGo cannot emit socket code when targeting WASI. This means that libraries that depend on socket code do not compile (and the error, as you see, don't clearly identify the root cause). (This is why Spin has to special-case HTTP.)
As WASI Preview 2 stabilises, hopefully TinyGo will port their standard library to that, and sockets code will start working.
Sorry for the inconvenience and thanks for trying it out!
from spin.
Thanks @itowlson for your awesome explanation.
One more Question if I created a Postgres db locally instant of that MongoDB then it will work?
from spin.
Spin does have a Postgres interface (see https://developer.fermyon.com/spin/rdbms-storage) but, unfortunately, it's not surfaced in the Go SDK at the moment, only Rust (and C#, but that SDK is a bit out of date). And I don't think you'd be able to use the Go Postgres drivers, because even with a local instance they'll be using sockets.
I'm afraid Spin's Go relational database story is not great right now - MySQL is also Rust/C#-only, and SQLite doesn't yet have a Go SDK because of some implementation issues (hopefully soon though!). If a key-value store works for you then Go does have both Spin's built-in key-value storage, and "bring your own instance" Redis...?
from spin.
Related Issues (20)
- Added flexibility to Spin allowed outbound hosts
- inconsistencies when making outbound http requests HOT 1
- Custom trigger with other WASI worlds requires trait implementation for `spin_core::Data<T>` HOT 2
- SQLITE error after update from 2.5.1 to 2.6.0 HOT 3
- spin can not login docker private registry while docker login success HOT 5
- Follow OCI container image annotation standards when generating containers HOT 2
- Generate and sign SBOM through spin HOT 5
- Maintain a CHANGELOG.md file? HOT 2
- Spin (Re)Factors tracking issue
- Add native support for Golang, Python, and JavaScript Azure SDKs HOT 3
- Add native support for Golang and Python AWS SDKs
- Registry metadata support in application manifest HOT 3
- add MAINTAINERS.md file to each repository in Spin project HOT 1
- `spin update` An easier way to update to latest spin version HOT 1
- Endless re-compile in `spin watch` for Spin Apps that consist of multiple components HOT 1
- Hide old plugin versions in `spin plugins list`
- Spin-telemetry: consider eliminating the use of `set_global_default` HOT 1
- inconsistent preopened dirs between wasmtime and spin HOT 8
- Abstract pg client type in factor-outbound-pg
- Need CORS config for HTTP trigger
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spin.