Hello and welcome to the gitter chat related to Aragog and Aragog CLI
Feel free to comment, ask questions or submit any suggestions.
Any tips on how to set up for running the tests? I have arangodb running and have all the env vars set, and the unit tests are interacting with the DB. I get a number of failed tests (27). They seem to mostly be unique constraint violation like
Conflict(DatabaseError { http_error: Conflict, arango_error: ArangoUniqueConstraintViolated, message: "unique constraint violated - in index by_name of type persistent over 'name'; conflicting key: 3265" })
or missing document like
DatabaseError { http_error: NotFound, arango_error: ArangoDocumentNotFound, message: "document not found" })
which makes me think there some setup or teardown that I'm not doing. This is on master (87b8624) with just running cargo test
(after setting the env vars)
cargo test --test-threads=1
which is what we use for the crate tests
arangors
driver should be enough but aragog
becomes incompatible with other libs that still use tokio 0.2, like actix-web
for example.
cargo test --test-threads=1
which is what we use for the crate tests
Record
structs on the rust side and it will be handled correctly through aragog's CRUD API
Owh nvm, It seems that
pub struct Foo { #[serde(rename = "_key")] pub key: String, }
works just fine.
Well apparently I say it too fast. This in turn produce when calling DatabaseRecord::create(...)
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: UnprocessableEntity { source: Error("missing field `_key`", line: 0, column: 0) }'
Have you read the book ? https://aragog.rs/book/
Yes, very well written, I learned a lot from it. but I think it is something todo with M1s, arm processor and rosetta that it start segfulating
Record
set as:#[derive(Serialize, Deserialize, Debug, Record, Clone)]
pub struct MyRecord {
#[serde(rename = "_key")]
pub key: String,
// pub data: String,
// ..
}