pub struct SqliteStore { /* private fields */ }Expand description
An openEHR repository in a SQLite database.
§Foreign keys are switched on explicitly
SQLite disables foreign-key enforcement by default, per connection, for
backward compatibility. A store that did not enable it would accept a
version pointing at a container that does not exist — and would do so
silently, which is worse than not having the constraint, because the schema
says it is there.
Implementations§
Source§impl SqliteStore
impl SqliteStore
Sourcepub fn in_memory() -> Result<Self>
pub fn in_memory() -> Result<Self>
Opens an in-memory database.
§Errors
Returns StoreError::Engine if SQLite cannot be opened or configured.
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Opens a database file, creating it if absent.
§Errors
Returns StoreError::Engine if the file cannot be opened.
Sourcepub fn from_connection(connection: Connection) -> Result<Self>
pub fn from_connection(connection: Connection) -> Result<Self>
Wraps an existing connection.
§Errors
Returns StoreError::Engine if the connection cannot be configured.
Sourcepub fn connection(&self) -> &Connection
pub fn connection(&self) -> &Connection
The underlying connection, for callers that need a query this trait does not offer.
Trait Implementations§
Source§impl Store for SqliteStore
impl Store for SqliteStore
Source§fn create_contribution(
&mut self,
ehr_id: &HierObjectId,
contribution: &Contribution,
) -> Result<()>
fn create_contribution( &mut self, ehr_id: &HierObjectId, contribution: &Contribution, ) -> Result<()>
Records a contribution. Read more
Source§fn commit_composition(
&mut self,
ehr_id: &HierObjectId,
version: &Version<Composition>,
contribution_uid: &str,
) -> Result<CommitOutcome>
fn commit_composition( &mut self, ehr_id: &HierObjectId, version: &Version<Composition>, contribution_uid: &str, ) -> Result<CommitOutcome>
Commits one version of a composition. Read more
Source§fn get_version(&self, uid: &ObjectVersionId) -> Result<VersionRow>
fn get_version(&self, uid: &ObjectVersionId) -> Result<VersionRow>
Reads one version by identifier. Read more
Source§fn latest_version(
&self,
versioned_object_uid: &HierObjectId,
) -> Result<VersionRow>
fn latest_version( &self, versioned_object_uid: &HierObjectId, ) -> Result<VersionRow>
The latest version of a container. Read more
Source§fn version_at_time(
&self,
versioned_object_uid: &HierObjectId,
at: &DvDateTime,
) -> Result<VersionRow>
fn version_at_time( &self, versioned_object_uid: &HierObjectId, at: &DvDateTime, ) -> Result<VersionRow>
The version current at a given time. Read more
Source§fn all_versions(
&self,
versioned_object_uid: &HierObjectId,
) -> Result<Vec<VersionRow>>
fn all_versions( &self, versioned_object_uid: &HierObjectId, ) -> Result<Vec<VersionRow>>
Every version of a container, oldest first. Read more
Source§fn chain_checkpoint(
&self,
versioned_object_uid: &HierObjectId,
) -> Result<String>
fn chain_checkpoint( &self, versioned_object_uid: &HierObjectId, ) -> Result<String>
A checkpoint over a container’s chain, for an external witness. Read more
Source§fn find_compositions_by_archetype(
&self,
ehr_id: &HierObjectId,
archetype_id: &str,
) -> Result<Vec<CompositionIndexRow>>
fn find_compositions_by_archetype( &self, ehr_id: &HierObjectId, archetype_id: &str, ) -> Result<Vec<CompositionIndexRow>>
Compositions in a record whose archetype matches. Read more
Auto Trait Implementations§
impl !Freeze for SqliteStore
impl !RefUnwindSafe for SqliteStore
impl !Sync for SqliteStore
impl !UnwindSafe for SqliteStore
impl Send for SqliteStore
impl Unpin for SqliteStore
impl UnsafeUnpin for SqliteStore
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