Skip to main content

systemprompt_database/models/
info.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Serialize, Deserialize)]
4pub struct DatabaseInfo {
5    pub path: String,
6    pub size: u64,
7    pub version: String,
8    pub tables: Vec<TableInfo>,
9}
10
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct TableInfo {
13    pub name: String,
14    pub row_count: i64,
15    #[serde(default)]
16    pub size_bytes: i64,
17    pub columns: Vec<ColumnInfo>,
18}
19
20#[derive(Debug, Clone, Serialize, Deserialize)]
21pub struct ColumnInfo {
22    pub name: String,
23    pub data_type: String,
24    pub nullable: bool,
25    pub primary_key: bool,
26    pub default: Option<String>,
27}
28
29#[derive(Debug, Clone, Serialize, Deserialize)]
30pub struct IndexInfo {
31    pub name: String,
32    pub columns: Vec<String>,
33    pub unique: bool,
34}