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