Open RoDmitry opened 3 years ago
I have an "unmapped" (to DB, meaning table does not contain a corresponding column) property User.phones in my struct:
User.phones
use serde::{Deserialize, Serialize}; use ormx::Table; #[derive(Serialize, Deserialize, Default, Debug, Clone, Table)] #[ormx(table = "users", id = id, insertable)] pub struct User { #[ormx(default)] pub id: i32, pub username: String, pub password: String, #[ormx(default)] pub phones: Vec<Phone>, }
On compile it says: error returned from database: 1054 (42S22): Unknown column 'phones' in 'field list'
error returned from database: 1054 (42S22): Unknown column 'phones' in 'field list'
As we discussed in the Discord, it needs something like #[ormx(skip)].
#[ormx(skip)]
More variants to name it: #[ormx(unmapped)], #[ormx(mapped = false)], #[ormx(column = "false")], #[ormx(column = false)], #[ormx(column = none)], #[ormx(nocolumn)].
#[ormx(unmapped)]
#[ormx(mapped = false)]
#[ormx(column = "false")]
#[ormx(column = false)]
#[ormx(column = none)]
#[ormx(nocolumn)]
I have an "unmapped" (to DB, meaning table does not contain a corresponding column) property
User.phones
in my struct:On compile it says:
error returned from database: 1054 (42S22): Unknown column 'phones' in 'field list'
As we discussed in the Discord, it needs something like
#[ormx(skip)]
.