Commit f4b54a5
74 add persistence backend sqlite for long term record history (#75)
* implement optional SQLite persistence backend for long-term record history
* update persistence backend documentation and implementation details for SQLite integration
* feat: add generic extension storage for AimDbBuilder and AimDb
- Introduced `Extensions` struct for storing typed state during builder configuration and record setup.
- Updated `AimDbBuilder` and `AimDb` to use the new `Extensions` for external crate integration.
feat: implement record.query handler for persistence
- Added `handle_record_query` function to process `record.query` requests.
- Integrated a type-erased query handler mechanism to allow persistence backends to register query handlers.
feat: create SQLite persistence backend
- Added `aimdb-persistence-sqlite` crate with a `SqliteBackend` implementation.
- Implemented asynchronous storage and querying of records using SQLite.
feat: define persistence backend trait and extensions
- Created `PersistenceBackend` trait for pluggable persistence backends.
- Added builder and record registration extensions for persistence configuration.
feat: implement query extensions for AimDb
- Added `AimDbQueryExt` trait to provide query capabilities for latest and range queries.
- Integrated error handling and deserialization for queried results.
test: add unit tests for persistence functionality
- Implemented tests for storing, querying, and cleaning up records in the SQLite backend.
- Verified correct behavior for pattern matching and time range queries.
* chore: update subproject commit reference for embassy
* feat: add regex dependency for improved pattern matching
* feat: enhance SQLite persistence backend with improved error handling and type safety
* feat: add changelog and README for aimdb-persistence and aimdb-persistence-sqlite
* feat: update query_range to accept optional limit_per_record parameter
* format
* Update aimdb-core/src/remote/handler.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update aimdb-core/src/remote/handler.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update aimdb-persistence-sqlite/src/lib.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update aimdb-persistence/src/ext.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add NoStdStartFnType for non-std environments and improve retention handling
* Add integration tests for query handling
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent b9bb2e6 commit f4b54a5
25 files changed
Lines changed: 3322 additions & 4 deletions
File tree
- _external
- aimdb-core/src
- remote
- aimdb-persistence-sqlite
- src
- aimdb-persistence
- src
- tests
- docs/design
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
63 | 67 | | |
64 | 68 | | |
65 | 69 | | |
| |||
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
94 | 102 | | |
95 | | - | |
| 103 | + | |
96 | 104 | | |
97 | 105 | | |
98 | 106 | | |
| |||
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
104 | | - | |
| 112 | + | |
105 | 113 | | |
106 | 114 | | |
107 | 115 | | |
| |||
140 | 148 | | |
141 | 149 | | |
142 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
143 | 155 | | |
144 | 156 | | |
145 | 157 | | |
| |||
163 | 175 | | |
164 | 176 | | |
165 | 177 | | |
| 178 | + | |
| 179 | + | |
166 | 180 | | |
167 | 181 | | |
168 | 182 | | |
| |||
- ci.sh+1
- embassy-mcxa/Cargo.toml+1-1
- embassy-mcxa/src/clocks/mod.rs+1-1
- embassy-mcxa/src/gpio.rs+3-3
- embassy-mcxa/src/i2c/target.rs+5-5
- embassy-stm32/Cargo.toml+3-3
- embassy-stm32/build.rs+125-16
- embassy-stm32/src/adc/ringbuffered.rs+22
- embassy-stm32/src/can/fdcan.rs+4-1
- embassy-stm32/src/dac/mod.rs+228-25
- embassy-stm32/src/dac/tsel.rs-303
- embassy-stm32/src/dma/dma_bdma.rs+12
- embassy-stm32/src/dma/gpdma/ringbuffered.rs+12
- embassy-stm32/src/dma/ringbuffer/mod.rs+65
- embassy-stm32/src/dma/ringbuffer/tests/mod.rs+198
- embassy-stm32/src/exti/mod.rs+41-1
- embassy-stm32/src/flash/asynch.rs+3-3
- embassy-stm32/src/flash/common.rs+6-6
- embassy-stm32/src/flash/f7.rs-47
- embassy-stm32/src/flash/h7.rs+2-2
- embassy-stm32/src/flash/mod.rs+9-4
- embassy-stm32/src/gpio.rs+11
- embassy-stm32/src/lib.rs+4-1
- embassy-stm32/src/macros.rs+26
- embassy-stm32/src/rcc/mod.rs+16-1
- examples/boot/bootloader/stm32-dual-bank/src/main.rs+1-1
- examples/boot/bootloader/stm32/src/main.rs+1-1
- examples/boot/bootloader/stm32wb-dfu/src/main.rs+1-1
- examples/boot/bootloader/stm32wba-dfu/src/main.rs+1-1
- examples/stm32h7/src/bin/dac_dma.rs+5-3
- examples/stm32l4/src/bin/dac_dma.rs+5-3
- tests/mcxa/.cargo/config.toml+8
- tests/mcxa/Cargo.toml+63
- tests/mcxa/README.md+32
- tests/mcxa/build.rs+18
- tests/mcxa/memory.x+5
- tests/mcxa/src/bin/adc.rs+74
- tests/mcxa/src/bin/cdog.rs+59
- tests/mcxa/src/bin/crc.rs+157
- tests/mcxa/src/bin/ctimer_capture.rs+64
- tests/mcxa/src/bin/dma.rs+43
- tests/mcxa/src/bin/gpio.rs+82
- tests/mcxa/src/bin/i2c.rs+93
- tests/mcxa/src/bin/i3c.rs+74
- tests/mcxa/src/bin/lpuart.rs+102
- tests/mcxa/src/bin/pwm.rs+56
- tests/mcxa/src/bin/rtc_alarm.rs+42
- tests/mcxa/src/bin/trng.rs+91
- tests/mcxa/src/bin/wwdt_interrupt.rs+64
0 commit comments