orientdb-rs icon indicating copy to clipboard operation
orientdb-rs copied to clipboard

Field not found with `sugar` mapping

Open wolf4ood opened this issue 4 years ago • 0 comments

The mapping to structs should use optional when specified for optional fields.

Currently this emit an error

    #[derive(orientdb_client::derive::FromResult, Debug, PartialEq)]
        struct Person {
            name: String,
            age : Option<i32>
        }

        let result: Option<Person> = session
            .query("select from OUser where name = ?")
            .positional(&[&"admin"])
            .fetch_one()
            .unwrap();

but it should work since age is optional

wolf4ood avatar Jun 22 '20 21:06 wolf4ood