Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Implements

Index

Constructors

constructor

Properties

connection

connection: Connection

Connection used by driver.

dataTypeDefaults

dataTypeDefaults: DataTypeDefaults

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.

Optional database

database: undefined | string

Master database used to perform all write queries.

databaseConnection

databaseConnection: any

Real database connection with sqlite database.

isReplicated

isReplicated: boolean = false

Indicates if replication is enabled.

options

Optional queryRunner

queryRunner: QueryRunner

Sqlite has a single QueryRunner because it works on a single database connection.

spatialTypes

spatialTypes: ColumnType[] = []

Gets list of spatial column data types.

sqlite

sqlite: any

SQLite underlying library.

supportedDataTypes

supportedDataTypes: ColumnType[] = ["int","integer","tinyint","smallint","mediumint","bigint","unsigned big int","int2","int8","integer","character","varchar","varying character","nchar","native character","nvarchar","text","clob","text","blob","real","double","double precision","float","real","numeric","decimal","boolean","date","time","datetime"]

Gets list of supported column data types by a driver.

see

https://www.tutorialspoint.com/sqlite/sqlite_data_types.htm

see

https://sqlite.org/datatype3.html

treeSupport

treeSupport: boolean = true

Indicates if tree tables are supported by this driver.

withLengthColumnTypes

withLengthColumnTypes: ColumnType[] = ["character","varchar","varying character","nchar","native character","nvarchar","text","blob","clob"]

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

withPrecisionColumnTypes

withPrecisionColumnTypes: ColumnType[] = []

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

withScaleColumnTypes

withScaleColumnTypes: ColumnType[] = []

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

Methods

afterConnect

  • afterConnect(): Promise<void>

autoSave

  • autoSave(): Promise<void>
  • This gets called by the QueryRunner when a change to the database is made. If a custom autoSaveCallback is specified, it get's called with the database as Uint8Array, otherwise the save method is called which saves it to file (Node.js) or localstorage (browser).

    Returns Promise<void>

buildTableName

  • buildTableName(tableName: string, schema?: undefined | string, database?: undefined | string): string

connect

  • connect(): Promise<void>

Protected createDatabaseConnection

  • createDatabaseConnection(): Promise<any>

Protected createDatabaseConnectionWithImport

  • createDatabaseConnectionWithImport(database?: Uint8Array): Promise<any>
  • Creates connection with an optional database. If database is specified it is loaded, otherwise a new empty database is created.

    Parameters

    • Optional database: Uint8Array

    Returns Promise<any>

createFullType

createGeneratedMap

  • createGeneratedMap(metadata: EntityMetadata, insertResult: any): any

createParameter

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

createQueryRunner

  • createQueryRunner(mode?: "master" | "slave"): QueryRunner

createSchemaBuilder

disconnect

  • disconnect(): Promise<void>

escape

  • escape(columnName: string): string

escapeQueryWithParameters

export

  • export(): Uint8Array

findChangedColumns

getColumnLength

isReturningSqlSupported

  • isReturningSqlSupported(): boolean

isUUIDGenerationSupported

  • isUUIDGenerationSupported(): boolean

load

  • load(fileNameOrLocalStorageOrData: string | Uint8Array, checkIfFileOrLocalStorageExists?: boolean): Promise<any>
  • Loads a database from a given file (Node.js), local storage key (browser) or array. This will delete the current database!

    Parameters

    • fileNameOrLocalStorageOrData: string | Uint8Array
    • Default value checkIfFileOrLocalStorageExists: boolean = true

    Returns Promise<any>

Protected loadDependencies

  • loadDependencies(): void

normalizeDefault

normalizeIsUnique

normalizeType

  • normalizeType(column: object): string

obtainMasterConnection

  • obtainMasterConnection(): Promise<any>

obtainSlaveConnection

  • obtainSlaveConnection(): Promise<any>

prepareHydratedValue

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

preparePersistentValue

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

save

  • save(location?: undefined | string): Promise<void>
  • Saved the current database to the given file (Node.js) or local storage key (browser). If no location path is given, the location path in the options (if specified) will be used.

    Parameters

    • Optional location: undefined | string

    Returns Promise<void>

Object literals

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: "int" = "int"

cacheId

cacheId: "int" = "int"

cacheIdentifier

cacheIdentifier: "varchar" = "varchar"

cacheQuery

cacheQuery: "text" = "text"

cacheResult

cacheResult: "text" = "text"

cacheTime

cacheTime: "bigint" = "bigint"

createDate

createDate: "datetime" = "datetime"

createDateDefault

createDateDefault: string = "datetime('now')"

migrationId

migrationId: "integer" = "integer"

migrationName

migrationName: "varchar" = "varchar"

migrationTimestamp

migrationTimestamp: "bigint" = "bigint"

treeLevel

treeLevel: "integer" = "integer"

updateDate

updateDate: "datetime" = "datetime"

updateDateDefault

updateDateDefault: string = "datetime('now')"

version

version: "integer" = "integer"

Generated using TypeDoc