ORM
  • Introduction
  • Basics of Usage
    • Connecting to the Database
    • Creating a Model
    • Simple Queries
  • Configuration
  • Core Features
    • Models
    • CRUD Operations (Create, Read, Update, Delete): examples
    • Relationships
    • Transactions
  • Advanced Usage
    • Data Definition Language
    • Indexes
    • Triggers
    • Caching
  • Examples and templates
  • Security
    • Query parameterization and protection against SQL injections
    • Logging
    • Monitoring
    • Sanitization
  • ORM-CLI
    • Installing
    • Commands and usage
  • System architecture and implementation
    • Support of various databases
      • Implementation using a pattern strategy
      • Implementation using generics
      • Implementation using metaprogramming
    • Decorators
    • Migrations
      • Assignment of id in Tables and Columns
      • Assigning IDs to indexes and triggers
      • Working with migrations in ORM-CLI
        • Implementation of a pattern command for migration
    • QueryBuilder
    • Caching
    • File structure
  • API
    • Decorators
      • Column
      • ComputedColumn
      • Index
      • ForeignKey
      • PrimaryGeneratedColumn
      • Relations
      • Table
      • Trigger
      • Types decorators
        • Integer
        • Numeric
        • Float
        • Boolean
        • String
    • DDL
    • QueryBuilder
    • Additional API
Powered by GitBook
On this page
  • ORM:
  • ORM-CLI:
  1. System architecture and implementation

File structure

A simple description of the file structure of my ORM and ORM-CLI

ORM:

  • context - a folder where most of the application's logic resides, divided into subfolders, each handling a small part of the application's logic, most of which will be invoked from data-source-context.ts.

  • core - a folder containing interfaces, constants, and other shared data for the entire application.

  • decorators - a folder containing all decorators.

  • strategies - a folder containing database strategies, in our case, Postgres and MySQL.

  • utils - reusable code snippets that have been separated from the main application logic.

  • database-manager.ts - the entry point to the application.

ORM-CLI:

  • common - shared data.

  • managers - a folder containing the migration manager.

  • strategies - a folder containing database strategies, in our case, Postgres and MySQL.

  • cli.ts - a file that configures and manages database connections, migrations, and initialization via the command line.

PreviousCachingNextDecorators

Last updated 9 months ago