Open dolzenko opened 6 years ago
ok, thx, i'll look into it.
i'm not quite sure i want to add support for a database specific datatype, that needs to be explicity enabled (postgres module). You can easily get the same (search-wise) via a functional index. Why not use that instead?
Understandable, I think I went for citext
instead of index mostly for 'purist' reasons
Conceptually the index is an implementation detail and uniqueness should be associated only with constraints.
ok, well, then we probably need to define datatype aliases/mappings or some kind of plugin architecture, such that the main code base stays clean. However, the benefit of adding support for aliases/mappings seems limited. Take #28 for instance, which can't be easily mapped to an existing datatype due to the inet
prefix required within queries. Adding a plugin architecture doesn't seem to provide much benefit either, because users will easily end up in sql injection issues as they need to handle all the sql generation themselves.
Citext column type is useful on Postgres for case-insesitive comparisons [0], currently searching for such column fails with
placing following code in initializer fixes it (I could add a PR but not sure about tests)
[0] https://www.postgresql.org/docs/10/static/citext.html