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
  1. API
  2. Decorators

Table

Table Decorator

The Table decorator is used to define a table in the database. It takes a TableDecoratorInterface object as a parameter.

Parameters of TableDecoratorInterface

  • name:

    • Type: string

    • Description: The name of the table in the database.

  • options:

    • Type: TableOptionsPostgresqlInterface | TableOptionsMysqlInterface

    • Description: An object containing additional options for configuring the table.

Parameters of TableOptionsPostgresqlInterface (for PostgreSQL only)

  • checkConstraint:

    • Type: ConstraintInterface | ConstraintInterface[]

    • Description: Defines CHECK constraint conditions for the table.

  • unique:

    • Type: string[][] | string[]

    • Description: Defines unique groups of columns in the table.

  • primaryKeys:

    • Type: string[]

    • Description: Defines columns that are primary keys.

Parameters of TableOptionsMysqlInterface (for MySQL only)

  • unique:

    • Type: string[][] | string[]

    • Description: Defines unique groups of columns in the table.

  • primaryKeys:

    • Type: string[]

    • Description: Defines columns that are primary keys.

PreviousRelationsNextTrigger

Last updated 9 months ago