Closed notriddle closed 3 years ago
I have the same problem, but since I must edit the generated schema.rs
anyway to add use diesel_full_text_search::TsVector
in the table!
macros that uses it, I just edit Tsvector
to TsVector
manually for now.
Unfortunatley, the table!
macro does not support use diesel_full_text_search::TsVector as Tsvector;
, which might otherwise be a nice way to fix it.
It would be nice to have the schema generator procude a working schema.rs
automatically.
This should be fixed now with https://github.com/diesel-rs/diesel/pull/2060
Supporting use diesel_full_text_search::TsVector as Tsvector;
in the table!
macro seems like a good idea. If someone want's to work on this, basically only this line needs to be changed in such a way that the renaming of an import is also matched.
This should be fixed now with diesel-rs/diesel#2060
I don't think so. Since the sql name is TSVECTOR
(and not TS_VECTOR
) it will be camelcased as Tsvector
with a lower-case v.
A PR adding a hidden type alias with the name generated by diesel cli would definitively something I would accept.
strange I manually added:
use diesel_full_text_search::TsVector;
and changed Tsvector
to TsVector
but seems still not working:
what shall I do to fix this? @weiznich
Ok sorry seems I need to write like:
table! {
+ use diesel_full_text_search::TsVector;
+ use diesel::sql_types::VarChar;
+ use diesel::sql_types::Float8;
venues (id) {
- id -> Varchar,
- street -> Varchar,
- city -> Varchar,
- postcode -> Varchar,
+ id -> VarChar,
+ street -> VarChar,
+ city -> VarChar,
+ postcode -> VarChar,
lat -> Float8,
lng -> Float8,
- market_id -> Varchar,
+ market_id -> VarChar,
+ street_city_poscode_search_entity -> TsVector,
}
}
Should be fixed with #24
When I ran
diesel migration redo
, it generated a type with the nameTsvector
in the schema.rs file, while this library exposes a type calledTsVector
.That seems wrong. Am I doing something wrong here?