pub struct ProjectStore<'a> { /* private fields */ }Implementations§
Source§impl<'a> ProjectStore<'a>
impl<'a> ProjectStore<'a>
pub fn new(pool: &'a SqlitePool) -> Self
Sourcepub async fn create(
&self,
id: &str,
name: &str,
description: Option<&str>,
target_base_url: Option<&str>,
env_config_json: Option<&str>,
now_ms: i64,
) -> Result<ProjectRecord, StoreError>
pub async fn create( &self, id: &str, name: &str, description: Option<&str>, target_base_url: Option<&str>, env_config_json: Option<&str>, now_ms: i64, ) -> Result<ProjectRecord, StoreError>
Insert a new project. id is the stable row id; name is unique
and surfaced to operators in UI / CLI listings. now_ms populates
both created_at and updated_at.
Sourcepub async fn create_with_runtime_profile(
&self,
id: &str,
name: &str,
description: Option<&str>,
target_base_url: Option<&str>,
env_config_json: Option<&str>,
runtime_profile_json: Option<&str>,
now_ms: i64,
) -> Result<ProjectRecord, StoreError>
pub async fn create_with_runtime_profile( &self, id: &str, name: &str, description: Option<&str>, target_base_url: Option<&str>, env_config_json: Option<&str>, runtime_profile_json: Option<&str>, now_ms: i64, ) -> Result<ProjectRecord, StoreError>
Insert a new project with an optional serialized runtime profile.
Sourcepub async fn ensure_default(
&self,
now_ms: i64,
) -> Result<ProjectRecord, StoreError>
pub async fn ensure_default( &self, now_ms: i64, ) -> Result<ProjectRecord, StoreError>
Idempotent: insert the default project row if it does not exist. Used as a transitional bootstrap so legacy callers without an explicit project context can still upsert repos against the FK.
pub async fn get(&self, id: &str) -> Result<Option<ProjectRecord>, StoreError>
pub async fn get_by_name( &self, name: &str, ) -> Result<Option<ProjectRecord>, StoreError>
pub async fn list(&self) -> Result<Vec<ProjectRecord>, StoreError>
Sourcepub async fn update(
&self,
id: &str,
patch: &ProjectPatch,
) -> Result<bool, StoreError>
pub async fn update( &self, id: &str, patch: &ProjectPatch, ) -> Result<bool, StoreError>
Partial update. Returns Ok(false) if no row with id exists.
pub async fn delete(&self, id: &str) -> Result<u64, StoreError>
Auto Trait Implementations§
impl<'a> Freeze for ProjectStore<'a>
impl<'a> !RefUnwindSafe for ProjectStore<'a>
impl<'a> Send for ProjectStore<'a>
impl<'a> Sync for ProjectStore<'a>
impl<'a> Unpin for ProjectStore<'a>
impl<'a> UnsafeUnpin for ProjectStore<'a>
impl<'a> !UnwindSafe for ProjectStore<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more