openehr_sqlite/lib.rs
1//! openEHR persistence for **`SQLite` 3**, with a complete embedded store.
2//!
3//! # Conformance level: **Verified**
4//!
5//! Store level, re-checked in CI on every commit. `SQLite` is bundled and
6//! compiled in, so the engine cannot be absent and the job cannot silently
7//! skip — which is what the level requires (`C0.8`).
8//!
9//! Unlike the other five engine crates, this one contains a working
10//! [`SqliteStore`] and runs [`openehr_store::conformance::run`] against a real
11//! database in its own test suite. `SQLite` is the only one of the six that can
12//! be verified without provisioning a server, so it is the one where the shared
13//! logic is actually exercised — every commit rule, every read, every index.
14//!
15//! That matters beyond `SQLite`: the store logic lives in `openehr-store` and is
16//! shared, so verifying it here verifies it for all six. What remains
17//! unverified for the others is their driver glue and their DDL against a real
18//! parser, which is exactly what `spec/conformance.md` says.
19//!
20//! This crate also hosts the cross-dialect comparison in `tests/dialects.rs`,
21//! because that comparison needs to see every dialect and `openehr-store`
22//! cannot — they depend on it.
23//!
24//! ```
25//! use openehr_sqlite::SqliteStore;
26//! use openehr_store::{Store, conformance};
27//!
28//! let mut store = SqliteStore::in_memory().unwrap();
29//! store.install().unwrap();
30//!
31//! let ehr = conformance::sample_ehr();
32//! store.create_ehr(&ehr).unwrap();
33//! assert_eq!(
34//! store.get_ehr(ehr.ehr_id()).unwrap().ehr_id().to_string(),
35//! ehr.ehr_id().to_string()
36//! );
37//! ```
38
39mod dialect;
40mod store;
41
42pub use dialect::SqliteDialect;
43pub use store::SqliteStore;