scryer-db 0.2.0

Database models and Turso/SQLite storage layer for Scryer code intelligence
use super::SourceFile;
use toasty::Model;

#[derive(Debug, Clone, Model)]
#[table = "scope"]
pub struct Scope {
    #[key]
    #[auto]
    pub id: u64,
    #[index]
    pub project_id: u64,
    #[index]
    pub file_id: u64,
    #[belongs_to(key = file_id)]
    pub source_file: toasty::Deferred<SourceFile>,
    pub parent_scope_id: Option<u64>,
    pub scope_kind: String, // "module", "class", "function", "closure", "block"
    pub start_byte: usize,
    pub end_byte: usize,
    pub start_line: u32,
    pub end_line: u32,
}