Finished up initial sqlite implemention

Co-Authored-By: kay@zed.dev
This commit is contained in:
Mikayla Maki 2022-10-18 15:58:05 -07:00
parent b06366ebb7
commit 84c7aa9cad
11 changed files with 136 additions and 60 deletions

View file

@ -52,11 +52,9 @@ fn main() {
.or_else(|| app.platform().app_version().ok())
.map_or("dev".to_string(), |v| v.to_string());
init_panic_hook(app_version, http.clone(), app.background());
let db = app.background().spawn(async move {
project::Db::open(&*zed::paths::DB)
.log_err()
.unwrap_or_else(project::Db::open_in_memory())
});
let db = app
.background()
.spawn(async move { project::Db::open(&*zed::paths::DB_DIR) });
load_embedded_fonts(&app);

View file

@ -6,7 +6,6 @@ lazy_static::lazy_static! {
pub static ref LOGS_DIR: PathBuf = HOME.join("Library/Logs/Zed");
pub static ref LANGUAGES_DIR: PathBuf = HOME.join("Library/Application Support/Zed/languages");
pub static ref DB_DIR: PathBuf = HOME.join("Library/Application Support/Zed/db");
pub static ref DB: PathBuf = DB_DIR.join("zed.sqlite");
pub static ref SETTINGS: PathBuf = CONFIG_DIR.join("settings.json");
pub static ref KEYMAP: PathBuf = CONFIG_DIR.join("keymap.json");
pub static ref LAST_USERNAME: PathBuf = CONFIG_DIR.join("last-username.txt");

View file

@ -63,6 +63,7 @@ actions!(
DecreaseBufferFontSize,
ResetBufferFontSize,
InstallCommandLineInterface,
ResetDatabase,
]
);