Database Overview
Ever Gauzy supports multiple databases and ORMs, providing flexibility for different deployment scenarios.
Supported Databasesβ
| Database | Production | Development | Default |
|---|---|---|---|
| PostgreSQL | β Recommended | β | β |
| MySQL / MariaDB | β | β | β |
| SQLite | β οΈ Demo only | β | β |
| better-sqlite3 | β οΈ Demo only | β | β |
Supported ORMsβ
| ORM | Role | Configuration |
|---|---|---|
| TypeORM | Primary ORM | DB_ORM=typeorm |
| MikroORM | Alternative ORM | DB_ORM=mikro-orm |
| Knex | Query builder | Always available |
Database Configurationβ
Core Environment Variablesβ
# Database type
DB_TYPE=postgres # postgres | mysql | sqlite | better-sqlite3
# ORM selection
DB_ORM=typeorm # typeorm | mikro-orm
# Connection settings
DB_HOST=localhost
DB_PORT=5432
DB_NAME=gauzy
DB_USER=postgres
DB_PASS=your-password
DB_SSL_MODE=false
# Connection pool
DB_POOL_SIZE=40
DB_CONNECTION_TIMEOUT=5000
DB_IDLE_TIMEOUT=10000
# Logging
DB_LOGGING=false # true | false | query | error | schema
SQLite Configurationβ
For development with SQLite:
DB_TYPE=sqlite
DB_NAME=gauzy.sqlite3
SQLite requires no host, port, user, or password settings.
PostgreSQL Configurationβ
DB_TYPE=postgres
DB_HOST=localhost
DB_PORT=5432
DB_NAME=gauzy
DB_USER=postgres
DB_PASS=root
DB_SSL_MODE=false
MySQL Configurationβ
DB_TYPE=mysql
DB_HOST=localhost
DB_PORT=3306
DB_NAME=gauzy
DB_USER=root
DB_PASS=root
Database Schemaβ
The platform has approximately 200+ database tables organized into domains:
Core Tablesβ
| Table | Entity | Description |
|---|---|---|
tenant | Tenant | Multi-tenant root |
user | User | User accounts |
role | Role | Role definitions |
role_permission | RolePermission | Role-permission mappings |
organization | Organization | Organizations within tenants |
HRM Tablesβ
| Table | Entity | Description |
|---|---|---|
employee | Employee | Employee profiles |
time_log | TimeLog | Time tracking entries |
timesheet | Timesheet | Weekly/monthly timesheets |
time_slot | TimeSlot | 10-minute activity slots |
screenshot | Screenshot | Activity screenshots |
activity | Activity | App/URL activity tracking |
time_off_request | TimeOffRequest | Leave requests |
time_off_policy | TimeOffPolicy | Leave policies |
PM Tablesβ
| Table | Entity | Description |
|---|---|---|
organization_project | OrganizationProject | Projects |
task | Task | Task management |
task_status | TaskStatus | Custom task statuses |
task_priority | TaskPriority | Custom priorities |
organization_sprint | OrganizationSprint | Sprint management |
organization_project_module | ProjectModule | Project modules |
ERP Tablesβ
| Table | Entity | Description |
|---|---|---|
invoice | Invoice | Invoices and estimates |
invoice_item | InvoiceItem | Invoice line items |
expense | Expense | Expense records |
payment | Payment | Payment records |
income | Income | Income records |
CRM / ATS Tablesβ
| Table | Entity | Description |
|---|---|---|
organization_contact | OrganizationContact | Contacts/leads |
pipeline | Pipeline | Sales pipelines |
pipeline_stage | PipelineStage | Pipeline stages |
candidate | Candidate | Job candidates |
candidate_interview | CandidateInterview | Interview schedule |
Integration Tablesβ
| Table | Entity | Description |
|---|---|---|
integration | Integration | Active integrations |
integration_type | IntegrationType | Available integration types |
integration_setting | IntegrationSetting | Integration configs |
integration_entity_setting | IntegrationEntitySetting | Entity sync settings |
Entity Relationshipsβ
Tenant βββ¬ββ Organization βββ¬ββ Employee ββββ TimeLog
β βββ Project ββββ Task
β βββ Contact
β βββ Invoice
β βββ Expense
β
βββ User ββββ Role ββββ RolePermission
β
βββ Integration
Database Initializationβ
Auto-Migrationβ
TypeORM can automatically synchronize the schema:
DB_SYNCHRONIZE=true # β οΈ Development only - drops/recreates tables
warning
Never enable DB_SYNCHRONIZE=true in production. Use migrations instead.
Seedingβ
The platform includes seed data for demo/development:
yarn seed:all # Seed all demo data
yarn seed:module:all # Seed module-specific data
See Database Seeding for details.
Related Pagesβ
- TypeORM Setup β TypeORM configuration
- MikroORM Setup β MikroORM configuration
- Knex Setup β Knex query builder
- Migrations β schema migration management
- Seeding β demo and test data
- Multi-ORM Entities β entity definition patterns
- Tenant Filtering β tenant-scoped data access