https://github.com/supabase-community/postgres-wasm-fdw
A WebAssembly foreign data wrapper example project
https://github.com/supabase-community/postgres-wasm-fdw
foreign-data-wrapper postgres rust wasm webassembly
Last synced: 6 months ago
JSON representation
A WebAssembly foreign data wrapper example project
- Host: GitHub
- URL: https://github.com/supabase-community/postgres-wasm-fdw
- Owner: supabase-community
- License: apache-2.0
- Created: 2024-07-07T14:50:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-09T07:12:56.000Z (about 1 year ago)
- Last Synced: 2025-08-30T06:28:29.562Z (6 months ago)
- Topics: foreign-data-wrapper, postgres, rust, wasm, webassembly
- Language: Rust
- Homepage:
- Size: 55.7 KB
- Stars: 21
- Watchers: 3
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Postgres Wasm FDW [Template]
This project demostrates how to create a Postgres Foreign Data Wrapper with Wasm, using the [Wrappers framework](https://github.com/supabase/wrappers).
This example reads the [realtime GitHub events](https://api.github.com/events) into a Postgres database.
## Project Structure
```bash
├── src
│ └── lib.rs # The package source code. We will implement the FDW logic, in this file.
├── supabase-wrappers-wit # The Wasm Interface Type provided by Supabase. See below for a detailed description.
│ ├── http.wit
│ ├── jwt.wit
│ ├── routines.wit
│ ├── stats.wit
│ ├── time.wit
│ ├── types.wit
│ ├── utils.wit
│ └── world.wit
└── wit # The WIT interface this project will use to build the Wasm package.
└── world.wit
```
A [Wasm Interface Type](https://github.com/bytecodealliance/wit-bindgen) (WIT) defines the interfaces between the Wasm FDW (guest) and the Wasm runtime (host). For example, the `http.wit` defines the HTTP related types and functions can be used in the guest, and the `routines.wit` defines the functions the guest needs to implement.
## Getting started
To get started, visit the [Wasm FDW developing guide](https://fdw.dev/guides/create-wasm-wrapper/).
## License
[Apache License Version 2.0](./LICENSE)