Our great sponsors
-
pgx
Discontinued Build Postgres Extensions with Rust! [Moved to: https://github.com/tcdi/pgrx] (by tcdi)
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
Do you ever wish you could do more with tuples, without manually coding cases for each tuple length? What about tedious cases of mapping each type to a wrapper struct like a Result or Option? I know I do. If that sounds interesting to you, then tuple_tricks might be for you. The basic idea is to allow induction on tuples, so if you can define your trait on a tuple of length one, and given a tuple of length n you can define it recursively for a tuple of length n+1. Github repo here: tuple_tricks.
This actually came out of a desire to automate de-serialising tuples of structs from select statements while playing around with SPI in pgx. But as another example, I've implemented a simple method for tuple addition: