project_workspace
The
project_workspaces table: the working directories that belong to a project.struct Model
pub struct ModelA workspace directory that belongs to a super::Project.
Workspaces represent distinct working directories within a project. Each
workspace is tied to exactly one project via project_id
and is uniquely constrained on the (path, project_id) pair.
| Field | Type | Description |
|---|---|---|
created_at |
DateTime<Utc> | When the workspace was first registered. |
id |
Id | Stable identifier assigned at creation. |
path |
PathBuf | Absolute path to the workspace directory. |
project_id |
Id | Project this workspace belongs to. |
updated_at |
DateTime<Utc> | When the workspace record was last modified. |
Implements Clone, Debug, Deserialize<'de>, Eq, PartialEq, Serialize, TryFrom<Row>.
Model::created_at
pub fn created_at(&self) -> &DateTime<Utc>When the workspace was first registered.
| Parameter | Type | Description |
|---|---|---|
| returns | &DateTime<Utc> |
Model::id
pub fn id(&self) -> &IdStable identifier assigned at creation.
| Parameter | Type | Description |
|---|---|---|
| returns | &Id |
Model::path
pub fn path(&self) -> &PathBufAbsolute path to the workspace directory.
| Parameter | Type | Description |
|---|---|---|
| returns | &PathBuf |
Model::project_id
pub fn project_id(&self) -> &IdProject this workspace belongs to.
| Parameter | Type | Description |
|---|---|---|
| returns | &Id |
Model::updated_at
pub fn updated_at(&self) -> &DateTime<Utc>When the workspace record was last modified.
| Parameter | Type | Description |
|---|---|---|
| returns | &DateTime<Utc> |
Model::new
pub fn new(path: PathBuf, project_id: Id) -> SelfCreate a new project workspace with a fresh Id and timestamps set to now.
| Parameter | Type | Description |
|---|---|---|
path |
PathBuf | the workspace directory |
project_id |
Id | the project that the workspace belongs to |
| returns | Self | The workspace, not yet saved. |