Closed bikeshedder closed 8 months ago
@sfackler Sorry for bothering you. Is there a chance this PR could be merged soon? I'm in need of this feature for an upcoming code generation tool for type safe queries based on tokio-postgres.
Thanks! Sorry for the delay.
Hmm, actually I think I'm going to adjust the return values to Option<u32>
rather than use NonZeroU32
. That's what we use elsewhere in the API.
@sfackler Is there a chance you could release a new tokio-postgres
version. I'm in progress of releasing a crate that does depend on this feature. I can't push this to crates.io
unless a new version of tokio-postgres
is published first.
I plan on releasing my crate in 1-2 weeks so a release of tokio-postgres
would be highly appreciated.
I want to access the underlying table and column of a query and found those two information not exposed in the
statement::Column
structure.I also simplified the
Debug
implementation ofColumn
by usingr#type
rather thantype_
so#[derive(Debug)]
can be used. As the argument list grew longer I also removed thenew
method in favor of making all the fieldspub(crate)
.Should we maybe expose the three remaining fields as well?
type_size: i16
type_modifier: i32
format: i16
I don't have an immediate need for them. They could provide useful in the future, though.
What are your thoughts on using
NonZeroU32
andNonZeroI16
? I'm not 100% sure if that's really a good choice for the type. Yet it felt somewhat natural to use it as0
denotes that this information is not available.