wyyerd / stripe-rs

Rust API bindings for the Stripe HTTP API.
Apache License 2.0
224 stars 88 forks source link

diesel compatibility #128

Closed vroussea closed 4 years ago

vroussea commented 4 years ago

Hello, i'm trying to store my stripe IDs CustomerId, PaymentMethodId and SubscriptionId) into a postgres database by using the diesel crate.

I can't have a model including those IDs since they don't implement the diesel::Expression/AppearsOnTable traits, so i went for storing them as Strings, but I can't create back the IDs using for exemple CustomerId::from(my_string). How am i supposed to do if i want to store those ids ?

vroussea commented 4 years ago

ok, I just needed to use the str::str::FromStr trait!