feat: add PostgreSQL database integration for projects

- Add SQLx with Postgres support and migration system
- Create projects table with status enum and auto-updated timestamps
- Implement database queries and API response conversion layer
- Add Justfile commands for database management and seeding
- Integrate health checks for both Bun and database connectivity
This commit is contained in:
2026-01-06 01:53:49 -06:00
parent 5fc7277cd7
commit b4c708335b
11 changed files with 1235 additions and 90 deletions
@@ -0,0 +1,20 @@
{
"db_name": "PostgreSQL",
"query": "SELECT 1 as check",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "check",
"type_info": "Int4"
}
],
"parameters": {
"Left": []
},
"nullable": [
null
]
},
"hash": "42799df09f28f38b73c4a0f90516dc432e7660d679d3ce8eb448cde2dad81608"
}
@@ -0,0 +1,98 @@
{
"db_name": "PostgreSQL",
"query": "\n SELECT \n id, \n slug, \n title, \n description, \n status as \"status: ProjectStatus\", \n github_repo, \n demo_url, \n priority, \n icon, \n last_github_activity, \n created_at, \n updated_at\n FROM projects\n WHERE status != 'hidden'\n ORDER BY priority DESC, created_at DESC\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "slug",
"type_info": "Text"
},
{
"ordinal": 2,
"name": "title",
"type_info": "Text"
},
{
"ordinal": 3,
"name": "description",
"type_info": "Text"
},
{
"ordinal": 4,
"name": "status: ProjectStatus",
"type_info": {
"Custom": {
"name": "project_status",
"kind": {
"Enum": [
"active",
"maintained",
"archived",
"hidden"
]
}
}
}
},
{
"ordinal": 5,
"name": "github_repo",
"type_info": "Text"
},
{
"ordinal": 6,
"name": "demo_url",
"type_info": "Text"
},
{
"ordinal": 7,
"name": "priority",
"type_info": "Int4"
},
{
"ordinal": 8,
"name": "icon",
"type_info": "Text"
},
{
"ordinal": 9,
"name": "last_github_activity",
"type_info": "Timestamptz"
},
{
"ordinal": 10,
"name": "created_at",
"type_info": "Timestamptz"
},
{
"ordinal": 11,
"name": "updated_at",
"type_info": "Timestamptz"
}
],
"parameters": {
"Left": []
},
"nullable": [
false,
false,
false,
false,
false,
true,
true,
false,
true,
true,
false,
false
]
},
"hash": "8adc48c833126d2cd690612a83c1637347e8bdfd230bf46c60ceef8fa096391e"
}