net/indexeddb/engines/sqlite/
object_store_model.rs1use rusqlite::Row;
5use sea_query::Iden;
6
7#[derive(Iden)]
8#[expect(unused)]
9pub enum Column {
10 #[iden = "object_store"]
11 Table,
12 Id,
13 Name,
14 KeyPath,
15 AutoIncrement,
16}
17
18#[derive(Clone, Debug, Eq, PartialEq)]
19pub struct Model {
20 pub id: i32,
21 pub name: String,
22 pub key_path: Option<Vec<u8>>,
23 pub auto_increment: i32,
24}
25
26impl TryFrom<&Row<'_>> for Model {
27 type Error = rusqlite::Error;
28
29 fn try_from(value: &Row) -> Result<Self, Self::Error> {
30 Ok(Self {
31 id: value.get(0)?,
32 name: value.get(1)?,
33 key_path: value.get(2)?,
34 auto_increment: value.get(3)?,
35 })
36 }
37}