stuff happened

This commit is contained in:
wymiller committed 2025-06-29 23:41:20 -04:00
1 parent 3600166dc5
commit 82e118a0e5
34 files changed
+1907 -261

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
pub mod authors;
pub mod comments;
pub mod posts;
pub mod projects;
@@ -0,0 +1,15 @@
use sqlx::{FromRow, Pool, Postgres, Row};
use crate::routes::projects::Project;
pub struct ProjectsDatasource;
impl ProjectsDatasource {
pub async fn get_all(pool: &Pool<Postgres>) -> Result<Vec<Project>, sqlx::Error> {
sqlx::query_as!(
Project,
"SELECT project_id, title, repo, summary, tech, wip, created_at FROM projects p WHERE deleted_at IS NULL ORDER BY p.created_at DESC"
)
.fetch_all(pool)
.await
}
}