Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SqliteConnection

SQLite connection using plain driver.

By defining a connection and sharing it through multiple persistence components you can reduce number of used database connections.

Configuration parameters

  • connection(s):
    • discovery_key: (optional) a key to retrieve the connection from IDiscovery
    • database: database file path
    • uri: resource URI with file:// protocol

References

  • *:logger:*:*:1.0 (optional) ILogger components to pass log messages
  • *:discovery:*:*:1.0 (optional) IDiscovery services
  • *:credential-store:*:*:1.0 (optional) Credential stores to resolve credentials

Hierarchy

  • SqliteConnection

Implements

  • any
  • any
  • any

Index

Constructors

constructor

  • Creates a new instance of the connection component.

    Returns SqliteConnection

Properties

Protected _connection

_connection: any

The SQLite connection pool object.

Protected _connectionResolver

_connectionResolver: SqliteConnectionResolver = new SqliteConnectionResolver()

The connection resolver.

Protected _databaseName

_databaseName: string

The SQLite database name.

Protected _logger

_logger: CompositeLogger = new CompositeLogger()

The logger.

Protected _options

_options: ConfigParams = new ConfigParams()

The configuration options.

Methods

close

  • close(correlationId: string, callback?: function): void
  • Closes component and frees used resources.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • Optional callback: function

      callback function that receives error or null no errors occured.

        • (err: any): void
        • Parameters

          • err: any

          Returns void

    Returns void

configure

  • configure(config: ConfigParams): void
  • Configures component by passing configuration parameters.

    Parameters

    • config: ConfigParams

      configuration parameters to be set.

    Returns void

getConnection

  • getConnection(): any
  • Returns any

getDatabaseName

  • getDatabaseName(): string
  • Returns string

isOpen

  • isOpen(): boolean
  • Checks if the component is opened.

    Returns boolean

    true if the component has been opened and false otherwise.

open

  • open(correlationId: string, callback?: function): void
  • Opens the component.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • Optional callback: function

      callback function that receives error or null no errors occured.

        • (err: any): void
        • Parameters

          • err: any

          Returns void

    Returns void

setReferences

  • setReferences(references: IReferences): void
  • Sets references to dependent components.

    Parameters

    • references: IReferences

      references to locate the component dependencies.

    Returns void

Generated using TypeDoc