Closed nikhiljha closed 2 years ago
I'm not sure about adding these impls. I want to avoid to the greatest extent possible conversions that only work for a subset of inputs.
My impression was that all URLs (per the URL standard) can be represented as a string. Unless you mean inputs == what's in the database, but doesn't it seem reasonable to expect errors if you set your type to url::Url and then try to read a db column that has non-URLs?
I think it would be better to have a conversion to a struct that uses String
instead of Url
. Is there a way to do that listlessly within the url
crate?
Yes, there are many values of strings that can be stored in the database that are not valid URLs.
Okay so it looks like the URL crate is mappable to pguri, but I'm guessing you don't want to support postgres extensions from this crate.
In that case, thanks for your time! I'll close this.
I have a whole bunch of url::Url types in my structs, so here's a simple impl that renders it out as a TEXT string and back (this is probably the best/most interoperable way to implement it?)
My commit message is horrible so you'll want to squash/merge this if you decide this is something you want.