Database Layer

This directory contains the database schema and query functions for the Side Hustle Hub application.

Files

  • migrations.ts: Contains the database schema definitions and initial setup
  • queries.ts: Contains typed query functions for interacting with the database

Database Schema

The application uses SQLite with the following tables:

  1. side_hustle_users_1: Stores user information
  2. side_hustle_opportunities_1: Stores side hustle opportunities
  3. side_hustle_chat_rooms_1: Stores chat room information
  4. side_hustle_messages_1: Stores chat messages

Usage

The database is initialized when the application starts by calling runMigrations() from the main backend entry point.

Query functions are exported from queries.ts and provide typed access to the database.