New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support citext postgres type #1000

Closed
lancecarlson opened this Issue Jul 5, 2017 · 6 comments

Comments

Projects
None yet
5 participants
@lancecarlson
Contributor

lancecarlson commented Jul 5, 2017

Likely this should be fine:

type Citext = Text

Also need to check if the right coersions exist and that codegen will place nice with citext[]

Notes from gitter^ :)

@killercup

This comment has been minimized.

Member

killercup commented Jul 11, 2017

The citext module provides a case-insensitive character string type, citext. Essentially, it internally calls lower when comparing values. Otherwise, it behaves almost exactly like text.

https://www.postgresql.org/docs/9.6/static/citext.html

@sgrif

This comment has been minimized.

Member

sgrif commented Jul 12, 2017

This will have the same caveats as varchar when it comes to arrays.

screen shot 2017-07-12 at 1 46 01 pm

screen shot 2017-07-12 at 1 49 00 pm

Other than that this should be fine. The binary representation is identical to text.

@Lukazoid

This comment has been minimized.

Lukazoid commented Aug 5, 2018

Should this not be reopened now support for citext has been removed?

@sgrif

This comment has been minimized.

Member

sgrif commented Aug 5, 2018

No, this isn't something anybody on the team is actively working on -- We'll be publishing a new policy soon about what we're doing with the issue tracker, but we're moving towards issues open here either being on the team's roadmap or things that are good for new contributors. If you'd like to discuss implementing this feature, you can start a thread at https://discourse.diesel.rs

@Boscop

This comment has been minimized.

Boscop commented Aug 30, 2018

Does this mean that citext is not supported anymore? Why?
I really want to use citext for e.g. username and email address columns.

@sgrif

This comment has been minimized.

Member

sgrif commented Aug 30, 2018

@Boscop Because the support we had was broken, and requires a more complete solution. We only accepted it in the first place because it was initially thought that a type alias would be sufficient. In general we don't support extensions in Diesel proper, since they can easily live in third party crates. Supporting this type is no different than supporting any other custom type as I've mentioned in #1624 (comment). If you're interested in supporting a crate for this and have questions after taking a swing at it feel free to ask in Gitter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment