Replies: 2 comments
-
I manually edited the tasks.rs file to turn Option to i32. But I don't think I should have to do that. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I have added an Issue about the facts that the entity files with an sqlite autoincrement primary key won't even compile. #2051 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have the following schema in sqlite3. id is autoincrement which I understand to mean is not nullable. But sea-orm-cli defines it as 'pub id: Option'. I don't see why it should be an Option. Is that a bug, or is there a reason for it? If it's a bug, will it cause a problem for me? (I'm new to SeaORM and almost new to Rust!)
CREATE TABLE IF NOT EXISTS "tasks" (
id INTEGER PRIMARY KEY AUTOINCREMENT,
task_num INTEGER NOT NULL unique,
creation_date DATE,
can_start_date DATE,
should_have_started_date DATE,
deadline_date DATE,
deadline_criticality TEXT,
periodicity TEXT,
monthly_basis_date DATE,
name TEXT,
desc TEXT,
finished_forever_date DATE,
finished_for_period_date DATE
, tags TEXT);
Generated by sea-orm-cli:
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(table_name = "tasks")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: Option,
pub task_num: i32,
pub creation_date: Option,
pub can_start_date: Option,
pub should_have_started_date: Option,
pub deadline_date: Option,
pub deadline_criticality: Option,
pub periodicity: Option,
pub monthly_basis_date: Option,
pub name: Option,
pub desc: Option,
pub finished_forever_date: Option,
pub finished_for_period_date: Option,
pub tags: Option,
}
Beta Was this translation helpful? Give feedback.
All reactions