NeonN
Neon13mo ago
9 replies
endless-jade

Rust crate or example for AWS lambda or Netlify Functions

I'm using Netlify Functions (AWS lambda with Rust) to connect to Neon (postgres) and have it working fine.

The only issue I had was to have to config tokio-postgres to use IPv4 due to an error ("Address family not supported by protocol"), but want to use the host instead. I'm sure the IP address could change at any time and will break eventually. (Fixed: Not sure if it was due to moving my lambda region to match the region I'm using for Neon or updating the node version of the lambda build).

Questions:

- Is there an official rust serverless crate for AWS lambda provided by Neon I should use?
- If there isn't a crate, do you have an example of an AWS lambda endpoint using Rust?

Note: I plan to post an example once I get pooling working. See Pooled Gist below (recommended)
Was this page helpful?