scryer-db 0.2.0

Database models and Turso/SQLite storage layer for Scryer code intelligence
use super::{ProjectDependency, SourceFile, Symbol};
use toasty::Model;

#[derive(Debug, Clone, Model)]
#[table = "dependency_package"]
pub struct DependencyPackage {
    #[key]
    #[auto]
    pub id: u64,
    #[index]
    pub name: String,
    #[index]
    pub version: String,
    pub source_type: String, // "cratesio", "git", "path"
    #[index]
    pub package_hash: String,
    pub root_path: String,
    pub manifest_path: String,
    pub indexed_at: String,
    #[has_many]
    pub project_dependencies: toasty::Deferred<Vec<ProjectDependency>>,
    #[has_many]
    pub files: toasty::Deferred<Vec<SourceFile>>,
    #[has_many]
    pub symbols: toasty::Deferred<Vec<Symbol>>,
}