⚡
LightningUserVault
  • Introduction
  • GETTING STARTED
    • Quickstart Guide
      • Docker Deployment
      • Local Deployment
    • Server Commands
  • Architecture
    • Overview
    • API Server
    • Data Storage:
      • Key-Value Databases
        • Pebbel DB
      • SQL Databases
        • PostgreSQL
    • Caching Mechanism:
      • MEMCACHE
  • Additional Features
    • Swagger
    • Postman Collection
    • Prometheus
    • Grafana
  • Releases
  • Contribution
Powered by GitBook
On this page
  1. Architecture
  2. Data Storage:
  3. SQL Databases

PostgreSQL

PreviousSQL DatabasesNextCaching Mechanism:

Last updated 1 year ago

PostgreSQL is a robust open-source relational database. Known for its reliability and data integrity, it's ideal for applications needing advanced data operations.

Integration with LightningUserVault:

To use PostgreSQL within LightningUserVault, ensure the STORAGE_TYPE is set to POSTRESQL.

🛠️Configuration Commands:

  • DB_HOST: Address of your database host. Default: postgres:5432

  • DB_USER: Username for your database. Default: postgres

  • DB_PASS: Password for your database user. Default: postgres

  • DB_NAME: Name of your database. Default: postgres

🔄 Go Integration: For seamless integration with Go, we've employed the ORM called . It simplifies database operations and ensures type-safe data manipulations

🔄 Auto-Migration: On server start, LightningUserVault performs an auto-migration to ensure the necessary tables and items are in place. Here's a glimpse of the user table structure:

type User struct {
    ID   int64  `gorm:"primaryKey"`
    Name string `gorm:"type:varchar(255)"`
}
GORM