stuff happened

This commit is contained in:
2025-06-29 23:41:20 -04:00
parent 3600166dc5
commit 82e118a0e5
34 changed files with 1907 additions and 261 deletions

View File

@@ -1,3 +1,4 @@
pub mod authors;
pub mod comments;
pub mod posts;
pub mod projects;

View File

@@ -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
}
}