Skip to main content

systemprompt_database/models/
info.rs

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