psqltrying to connect to the database. Checkout postgres documentation about authentication methods for details on how to fix that. In general it's really hard for someone without access to your system to give concrete instructions on such configuration issues.
DELETE exhibition, exhibition_ownership FROM exhibition INNER JOIN exhibition_ownership ON exhibition.id = exhibition_ownership.exhibition_id WHERE client_id = ?;
It seems easier to write all my queries in raw SQL. Is that less performant than using the built-in DSL?
It really depends on your usecase, but assuming you write the same query using raw SQL (via
sql_query) and the built-in DSL, using the DSL should normally generate a more performant variant as we know much more about the query at compile time.
let results = posts .filter(published.eq(diesel_demo::models::MyEnum::A)) // cannot be used as a look-up criteria .limit(5) .load::<Post>(&connection) .expect("Error loading posts");
Citext. I also have a
db/mod.rsfile that has
pub mod sql_typesin import_types in my diesel.toml I have
schema.rsafter you added the
import_typesstatement to your
warning: unused import:crate::db::sql_types::Citext``?
patch_file = "src/schema.patch"but I see an error when I try to run the diesel cli
No such file or directory (os error 2).
unused_importslint: That works like any other lint. You put a
#[allow(unused_imports)]on the corresponding item and the warning will disappear. Note that this also works as outer or inner attribute for a module.
@Jovons It's impossible to say what exactly is wrong with your implementation without knowing details about the implementation. Either include more details or have a look at the corresponding test case.
I tried the same
custom_types as in the link you mentioned. But it still gives the same error after running
cargo test. And I also pushed the code I have here: https://github.com/Jovons/diesel_demo/blob/master/tests/custom_types.rs