Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OracleDriver

Organizes communication with Oracle RDBMS.

Hierarchy

  • OracleDriver

Implements

Index

Constructors

constructor

Properties

connection

connection: Connection

Connection used by driver.

Optional database

database: string

Master database used to perform all write queries.

isReplicated

isReplicated: boolean = false

Indicates if replication is enabled.

master

master: any

Pool for master database.

maxAliasLength

maxAliasLength: number = 30

Max length allowed by Oracle for aliases.

see

https://docs.oracle.com/database/121/SQLRF/sql_elements008.htm#SQLRF51129

The following list of rules applies to both quoted and nonquoted identifiers unless otherwise indicated Names must be from 1 to 30 bytes long with these exceptions: [...]

Since Oracle 12.2 (with a compatible driver/client), the limit has been set to 128.

see

https://docs.oracle.com/en/database/oracle/oracle-database/12.2/sqlrf/Database-Object-Names-and-Qualifiers.html

If COMPATIBLE is set to a value of 12.2 or higher, then names must be from 1 to 128 bytes long with these exceptions

options

Connection options.

oracle

oracle: any

Underlying oracle library.

slaves

slaves: any[] = []

Pool for slave databases. Used in replication.

spatialTypes

spatialTypes: ColumnType[] = []

Gets list of spatial column data types.

supportedDataTypes

supportedDataTypes: ColumnType[] = ["char","nchar","nvarchar2","varchar2","long","raw","long raw","number","numeric","float","dec","decimal","integer","int","smallint","real","double precision","date","timestamp","timestamp with time zone","timestamp with local time zone","interval year to month","interval day to second","bfile","blob","clob","nclob","rowid","urowid"]

treeSupport

treeSupport: boolean = true

Indicates if tree tables are supported by this driver.

withLengthColumnTypes

withLengthColumnTypes: ColumnType[] = ["char","nchar","nvarchar2","varchar2","varchar","raw"]

Gets list of column data types that support length by a driver.

withPrecisionColumnTypes

withPrecisionColumnTypes: ColumnType[] = ["number","float","timestamp","timestamp with time zone","timestamp with local time zone"]

Gets list of column data types that support precision by a driver.

withScaleColumnTypes

withScaleColumnTypes: ColumnType[] = ["number"]

Gets list of column data types that support scale by a driver.

Methods

afterConnect

  • afterConnect(): Promise<void>

buildTableName

  • buildTableName(tableName: string, schema?: string, database?: string): string
  • Build full table name with database name, schema name and table name. Oracle does not support table schemas. One user can have only one schema.

    Parameters

    • tableName: string
    • Optional schema: string
    • Optional database: string

    Returns string

Protected closePool

  • closePool(pool: any): Promise<void>

columnTypeToNativeParameter

  • columnTypeToNativeParameter(type: ColumnType): any

connect

  • connect(): Promise<void>
  • Performs connection to the database. Based on pooling options, it can either create connection immediately, either create a pool and create connection when needed.

    Returns Promise<void>

createFullType

createGeneratedMap

createParameter

  • createParameter(parameterName: string, index: number): string

Protected createPool

createQueryRunner

createSchemaBuilder

disconnect

  • disconnect(): Promise<void>

escape

  • escape(columnName: string): string

escapeQueryWithParameters

findChangedColumns

getColumnLength

isReturningSqlSupported

  • isReturningSqlSupported(): boolean

isUUIDGenerationSupported

  • isUUIDGenerationSupported(): boolean

Protected loadDependencies

  • loadDependencies(): void

normalizeDefault

normalizeIsUnique

normalizeType

  • normalizeType(column: object): string
  • Creates a database type from a given column metadata.

    Parameters

    • column: object
      • Optional isArray?: boolean
      • Optional length?: number | string
      • Optional precision?: number | null
      • Optional scale?: number
      • Optional type?: ColumnType

    Returns string

obtainMasterConnection

  • obtainMasterConnection(): Promise<any>

obtainSlaveConnection

  • obtainSlaveConnection(): Promise<any>

prepareHydratedValue

  • prepareHydratedValue(value: any, columnMetadata: ColumnMetadata): any

preparePersistentValue

  • preparePersistentValue(value: any, columnMetadata: ColumnMetadata): any

Object literals

dataTypeDefaults

dataTypeDefaults: object

Default values of length, precision and scale depends on column data type. Used in the cases when length/precision/scale is not specified by user.

char

char: object

length

length: number = 1

float

float: object

precision

precision: number = 126

nchar

nchar: object

length

length: number = 1

nvarchar2

nvarchar2: object

length

length: number = 255

raw

raw: object

length

length: number = 2000

timestamp

timestamp: object

precision

precision: number = 6

timestamp with local time zone

timestamp with local time zone: object

precision

precision: number = 6

timestamp with time zone

timestamp with time zone: object

precision

precision: number = 6

varchar

varchar: object

length

length: number = 255

varchar2

varchar2: object

length

length: number = 255

mappedDataTypes

mappedDataTypes: object

Orm has special columns and we need to know what database column types should be for those types. Column types are driver dependant.

cacheDuration

cacheDuration: "number" = "number"

cacheId

cacheId: "number" = "number"

cacheIdentifier

cacheIdentifier: "varchar2" = "varchar2"

cacheQuery

cacheQuery: "clob" = "clob"

cacheResult

cacheResult: "clob" = "clob"

cacheTime

cacheTime: "number" = "number"

createDate

createDate: "timestamp" = "timestamp"

createDateDefault

createDateDefault: string = "CURRENT_TIMESTAMP"

metadataDatabase

metadataDatabase: "varchar2" = "varchar2"

metadataName

metadataName: "varchar2" = "varchar2"

metadataSchema

metadataSchema: "varchar2" = "varchar2"

metadataTable

metadataTable: "varchar2" = "varchar2"

metadataType

metadataType: "varchar2" = "varchar2"

metadataValue

metadataValue: "clob" = "clob"

migrationId

migrationId: "number" = "number"

migrationName

migrationName: "varchar2" = "varchar2"

migrationTimestamp

migrationTimestamp: "number" = "number"

treeLevel

treeLevel: "number" = "number"

updateDate

updateDate: "timestamp" = "timestamp"

updateDateDefault

updateDateDefault: string = "CURRENT_TIMESTAMP"

version

version: "number" = "number"

Generated using TypeDoc