rename sql_method to query and adjust the syntax to more closely match function definitions

This commit is contained in:
Kay Simmons
2022-12-03 16:06:01 -08:00
committed by Mikayla Maki
parent 1cc3e4820a
commit 359b8aaf47
7 changed files with 192 additions and 124 deletions
+4 -3
View File
@@ -5,7 +5,7 @@ pub mod model;
use std::path::Path;
use anyhow::{anyhow, bail, Context, Result};
use db::{connection, sql_method, sqlez::connection::Connection};
use db::{connection, query, sqlez::connection::Connection};
use gpui::Axis;
use indoc::indoc;
@@ -201,9 +201,10 @@ impl WorkspaceDb {
.await;
}
sql_method! {
async next_id() -> Result<WorkspaceId>:
query! {
pub async fn next_id() -> Result<WorkspaceId> {
"INSERT INTO workspaces DEFAULT VALUES RETURNING workspace_id"
}
}
/// Returns the previous workspace ids sorted by last modified along with their opened worktree roots