Skip to main content
Module

x/typeorm/src/index.ts

Forked from https://github.com/typeorm/typeorm
Latest
import * as typeorm from "https://deno.land/x/typeorm@v0.2.23-rc10/src/index.ts";

Classes

Provides abstract class for custom repositories that do not inherit from original orm Repository. Contains all most-necessary methods to simplify code in the custom repository. All methods are protected thus not exposed and it allows to create encapsulated custom repository.

Performs logging of the events in TypeORM. This version of logger uses console to log events and use syntax highlighting.

Base abstract entity for all entities, used in ActiveRecord patterns.

Syntax sugar. Allows to use brackets in WHERE expressions for better syntax.

Connection is a single database ORM connection to a specific database. Its not required to be a database connection, depend on database type it can create connection pool. You can have multiple connections to multiple databases in your application.

ConnectionManager is used to store and manage multiple orm connections. It also provides useful factory methods to simplify connection creation.

Reads connection options from the ormconfig. Can read from multiple file extensions including env, json, js, xml and yml.

Naming strategy that is used by default.

Allows to build complex sql queries in a fashion way and execute those queries.

Result object returned by DeleteQueryBuilder execution.

Entity manager supposed to work with any entity, automatically find its repository and call its methods, whatever entity type are you passing.

Contains all entity metadata.

Interface for entity metadata mappings stored inside "schemas" instead of models decorated by decorators.

Performs logging of the events in TypeORM. This version of logger logs everything into ormlogs.log file.

Find Operator used in Find Conditions.

Utilities to work with FindOptions.

Allows to build complex sql queries in a fashion way and execute those queries.

Result object returned by InsertQueryBuilder execution.

Represents entity of the migration in the database.

Executes migrations: runs pending and reverts previously executed migrations.

Entity manager supposed to work with any entity, automatically find its repository and call its methods, whatever entity type are you passing.

Repository used to manage mongodb documents of a single entity type.

Utils to help to work with Promise objects.

c
QueryBuilder
abstract

Allows to build complex sql queries in a fashion way and execute those queries.

Thrown when query execution has failed.

Allows to work with entity relations and perform specific operations with those relations.

Repository is supposed to work with your entity objects. Find entities, insert, update, delete, etc.

Allows to build complex sql queries in a fashion way and execute those queries.

Performs logging of the events in TypeORM. This version of logger uses console to log events and does not use syntax highlighting.

Table in the database represented in this class.

Database's table check constraint stored in this class.

Table's columns in the database represented in this class.

Database's table exclusion constraint stored in this class.

Foreign key from the database stored in this class.

Database's table index stored in this class.

Database's table unique constraint stored in this class.

Repository with additional functions to work with trees.

Allows to build complex sql queries in a fashion way and execute those queries.

Result object returned by UpdateQueryBuilder execution.

Functions

Calls a method on which this decorator is applied after this entity insertion.

Calls a method on which this decorator is applied after entity is loaded.

Calls a method on which this decorator is applied after this entity removal.

Calls a method on which this decorator is applied after this entity update.

Find Options Operator. Example: { someField: Any([...]) }

Calls a method on which this decorator is applied before this entity insertion.

Calls a method on which this decorator is applied before this entity removal.

Calls a method on which this decorator is applied before this entity update.

Find Options Operator. Example: { someField: Between(x, y) }

Creates a database check. Can be used on entity property or on entity. Can create checks with composite columns when used on entity.

Special type of the table used in the single-table inherited tables.

Column decorator is used to mark a specific class property as a table column. Only properties decorated with this decorator will be persisted to the database when entity be saved.

Creates a new connection and registers it in the manager. Only one connection from ormconfig will be created (name "default" or connection without name).

Creates new connections and registers them in the manager.

This column will store a creation date of the inserted object. Creation date is generated and inserted only once, at the first time when you create an object, the value is inserted into the table, and is never touched again.

Creates a new query builder.

This decorator is used to mark classes that will be an entity (table or document depend on database type). Database schema will be created for all classes decorated with it, and Repository can be retrieved and used for it.

Used to declare a class as a custom repository. Custom repository can manage some specific entity or just be generic. Custom repository optionally can extend AbstractRepository, Repository or TreeRepository.

Find Options Operator. Example: { someField: Equal("value") }

Classes decorated with this decorator will listen to ORM events and their methods will be triggered when event occurs. Those classes must implement EventSubscriberInterface interface.

Creates a database exclusion. Can be used on entity. Can create exclusions with composite columns when used on entity.

Marks a column to generate a value on entity insertion. There are three types of generation strategy - increment, uuid and rowid (cockroachdb only). Increment uses a number which increases by one on each insertion. Uuid generates a special UUID token. Rowid supports only in CockroachDB and uses unique_rowid() function

Gets connection from the connection manager. If connection name wasn't specified, then "default" connection will be retrieved.

Gets a ConnectionManager which creates connections.

Reads connection options stored in ormconfig configuration file.

Gets tree repository for the given entity class.

Gets the IOC container used by this library.

Gets entity manager from the connection. If connection name wasn't specified, then "default" connection will be retrieved.

Gets metadata args storage.

Gets MongoDB entity manager from the connection. If connection name wasn't specified, then "default" connection will be retrieved.

Gets mongodb repository for the given entity class or name.

Gets repository for the given entity class.

Gets Sqljs entity manager from connection name. "default" connection is used, when no name is specified. Only works when Sqljs driver is used.

Gets tree repository for the given entity class.

Find Options Operator. Example: { someField: In([...]) }

Creates a database index. Can be used on entity property or on entity. Can create indices with composite columns when used on entity.

Find Options Operator. Example: { someField: IsNull() }

JoinColumn decorator used on one-to-one relations to specify owner side of relationship. It also can be used on both one-to-one and many-to-one relations to specify custom column name or custom referenced column.

JoinTable decorator is used in many-to-many relationship to specify owner side of relationship. Its also used to set a custom junction table's name, column names and referenced columns.

Find Options Operator. Example: { someField: LessThan(10) }

Find Options Operator. Example: { someField: LessThanOrEqual(10) }

Find Options Operator. Example: { someField: Like("%some sting%") }

Many-to-many is a type of relationship when Entity1 can have multiple instances of Entity2, and Entity2 can have multiple instances of Entity1. To achieve it, this type of relation creates a junction table, where it storage entity1 and entity2 ids. This is owner side of the relationship.

Many-to-one relation allows to create type of relation when Entity1 can have single instance of Entity2, but Entity2 can have a multiple instances of Entity1. Entity1 is an owner of the relationship, and storages Entity2 id on its own side.

Find Options Operator. Example: { someField: MoreThan(10) }

Find Options Operator. Example: { someField: MoreThanOrEqual(10) }

Find Options Operator. Used to negotiate expression. Example: { title: not("hello") } will return entities where title not equal to "hello".

Special type of column that is available only for MongoDB database. Marks your entity's column to be an object id.

One-to-many relation allows to create type of relation when Entity2 can have multiple instances of Entity1. Entity1 have only one Entity2. Entity1 is an owner of the relationship, and storages Entity2 id on its own side.

One-to-one relation allows to create direct relation between two entities. Entity1 have only one Entity2. Entity1 is an owner of the relationship, and storages Entity1 id on its own side.

Column decorator is used to mark a specific class property as a table column. Only properties decorated with this decorator will be persisted to the database when entity be saved. Primary columns also creates a PRIMARY KEY for this column in a db.

Column decorator is used to mark a specific class property as a table column.

Find Options Operator. Example: { someField: Raw([...]) }

f
RelationCount
deprecated

Holds a number of children in the closure table of the column.

Special decorator used to extract relation id into separate entity property.

Sets for entity to use table inheritance pattern.

Wraps some method into the transaction.

Injects transaction's entity manager into the method wrapped with @Transaction decorator.

Injects transaction's repository into the method wrapped with @Transaction decorator.

Marks entity to work like a tree. Tree pattern that will be used for the tree entity should be specified.

Marks a entity property as a children of the tree. "Tree children" will contain all children (bind) of this entity.

Creates a "level"/"length" column to the table that holds a closure table.

Marks a entity property as a parent of the tree. "Tree parent" indicates who owns (is a parent) of this entity in tree structure.

Composite unique constraint must be set on entity classes and must specify entity's fields to be unique.

This column will store an update date of the updated object. This date is being updated each time you persist the object.

Sets container to be used by this library.

This column will store a number - version of the entity. Every time your entity will be persisted, this number will be increased by one - so you can organize visioning and update strategies of your entity.

ViewColumn decorator is used to mark a specific class property as a view column.

This decorator is used to mark classes that will be an entity view. Database schema will be created for all classes decorated with it, and Repository can be retrieved and used for it.

Interfaces

Describes all column's options.

Driver organizes TypeORM communication with specific database management system.

Describes all entity's options.

Classes that implement this interface are subscribers that subscribe for the specific events in the ORM.

Defines a special criteria to find specific entities.

Defines a special criteria to find specific entity.

Describes all index options.

InsertEvent is an object that broadcaster sends to the entity subscriber when entity is inserted to the database.

Describes join column options.

Used to specify what entity relations should be loaded.

Describes join table options.

Performs logging of the events in TypeORM.

Migrations should implement this interface and all its methods.

Naming strategy defines how auto-generated names for such things like table name, or table column gonna be generated.

Interface of the simple literal object with any string keys.

Runs queries on a single database connection.

Describes all relation's options.

RemoveEvent is an object that broadcaster sends to the entity subscriber when entity is being removed to the database.

Special options passed to Repository#remove and Repository#delete methods.

Special options passed to Repository#save, Repository#insert and Repository#update methods.

UpdateEvent is an object that broadcaster sends to the entity subscriber when entity is being updated in the database.

Container options.

Interface for objects that deal with (un)marshalling data.

Query Builders can implement this interface to support where expression

Type Aliases

Any column type column can be.

ConnectionOptions is an interface with settings and options for specific connection. Options contain database and other connection-related settings. Consumer must provide connection options for each of your connections.

Database type.

Same as Partial but goes deeper and makes Partial all its properties and sub-properties.

Used for find operations.

List of types that FindOperator can be.

Represents some Type of the Object.

Special object that defines order condition for ORDER BY in sql.