Class SQLiteConnectionManager

Connection manager for an SQLite connection based on ADO.NET.

Inheritance
object
DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>
SQLiteConnectionManager
Implements
IConnectionManager<SQLiteConnection, SQLiteTransaction>
System.IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: ETLBox.SQLite
Assembly: ETLBox.SQLite.dll
Syntax
    public class SQLiteConnectionManager : DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>, IConnectionManager<SQLiteConnection, SQLiteTransaction>, IConnectionManager, IDisposable
Examples
ControlFlow.DefaultDbConnection =
  new.SQLiteConnectionManager(new SQLiteConnectionString(
    "Data Source=.\db\SQLite.db;Version=3;"));

Constructors

SQLiteConnectionManager()

Declaration
    public SQLiteConnectionManager()
Examples
ControlFlow.DefaultDbConnection =
  new.SQLiteConnectionManager(new SQLiteConnectionString(
    "Data Source=.\db\SQLite.db;Version=3;"));

SQLiteConnectionManager(SQLiteConnectionString)

Declaration
    public SQLiteConnectionManager(SQLiteConnectionString connectionString)
Parameters
TypeNameDescription
SQLiteConnectionStringconnectionString
Examples
ControlFlow.DefaultDbConnection =
  new.SQLiteConnectionManager(new SQLiteConnectionString(
    "Data Source=.\db\SQLite.db;Version=3;"));

SQLiteConnectionManager(string)

Declaration
    public SQLiteConnectionManager(string connectionString)
Parameters
TypeNameDescription
stringconnectionString
Examples
ControlFlow.DefaultDbConnection =
  new.SQLiteConnectionManager(new SQLiteConnectionString(
    "Data Source=.\db\SQLite.db;Version=3;"));

Properties

BulkInserts

Instead of using single values inserts (with a INSERT INTO .. VALUES () statement), data is inserted in batches using a INSERT INTO .. VALUES (), (), () syntax. All other connectors already use the batch variant, but SQLite is optimized for single inserts and sometimes has issues with a bigger amount of parameters passed into a sql statement. Using bulk inserts is not compatible with older version (SQLite < 3.15.0)

Declaration
    public bool BulkInserts { get; set; }
Property Value
TypeDescription
bool

ConnectionType

The database type for the connection manager.

Declaration
    public override ConnectionType ConnectionType { get; protected set; }
Property Value
TypeDescription
ConnectionType
Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.ConnectionType

MaxParameterSizeSql

Returns the maximum amount of parameters that can be passed into a sql query.

Declaration
    public override int MaxParameterSizeSql { get; set; }
Property Value
TypeDescription
int
Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.MaxParameterSizeSql

ModifyDBSettings

Will set the PRAGMA synchronous = OFF and PRAGMA journal_mode = MEMORY settings before the bulk insert. The changes will be reverted after the bulk insert operation.

Declaration
    public bool ModifyDBSettings { get; set; }
Property Value
TypeDescription
bool

QB

The quotation begin character that is used in the database. E.g. SqlServer uses: '[' and Postgres: '"'

Declaration
    public override string QB { get; protected set; }
Property Value
TypeDescription
string
Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.QB

QE

The quotation end character that is used in the database. E.g. SqlServer uses: ']' and Postgres: '"'

Declaration
    public override string QE { get; protected set; }
Property Value
TypeDescription
string
Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.QE

SupportDatabases

Indicates if database server does support multiple databases. A database in ETLBox means a schema in MySql.

Declaration
    public override bool SupportDatabases { get; }
Property Value
TypeDescription
bool
Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.SupportDatabases

SupportProcedures

Indicates if the database supports procedures

Declaration
    public override bool SupportProcedures { get; }
Property Value
TypeDescription
bool
Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.SupportProcedures

SupportSchemas

Indicates if the database supports schemas In MySql, this is false because the schema here is a database in ETLBox. Use SupportDatabases instead

Declaration
    public override bool SupportSchemas { get; }
Property Value
TypeDescription
bool
Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.SupportSchemas

Methods

BulkDelete(ITableData)

Performs a bulk delete

Declaration
    public override void BulkDelete(ITableData data)
Parameters
TypeNameDescription
ITableDatadata

Batch of data

Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.BulkDelete(ETLBox.ITableData)

BulkInsert(ITableData)

Performs a bulk insert

Declaration
    public override void BulkInsert(ITableData data)
Parameters
TypeNameDescription
ITableDatadata

Batch of data

Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.BulkInsert(ETLBox.ITableData)

BulkSelect(ITableData, ICollection<string>, Action, Action, params Action<object>[])

Declaration
    public override void BulkSelect(ITableData data, ICollection<string> selectColumnNames, Action beforeRowReadAction, Action afterRowReadAction, params Action<object>[] rowActions)
Parameters
TypeNameDescription
ITableDatadata
System.Collections.Generic.ICollection<T><string>selectColumnNames
System.ActionbeforeRowReadAction
System.ActionafterRowReadAction
System.Action<T><object>[]rowActions
Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.BulkSelect(ETLBox.ITableData, System.Collections.Generic.ICollection<string>, System.Action, System.Action, params System.Action<object>[])

BulkUpdate(ITableData, ICollection<string>, ICollection<string>)

Performs a bulk update

Declaration
    public override void BulkUpdate(ITableData data, ICollection<string> setColumnNames, ICollection<string> joinColumnNames)
Parameters
TypeNameDescription
ITableDatadata

Batch of data

System.Collections.Generic.ICollection<T><string>setColumnNames

The column names used in the set part of the update statement

System.Collections.Generic.ICollection<T><string>joinColumnNames

The column names to join for the update

Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.BulkUpdate(ETLBox.ITableData, System.Collections.Generic.ICollection<string>, System.Collections.Generic.ICollection<string>)

CleanUpBulkInsert(string)

Called after the whole bulk insert operation to change back settings made to improve bulk insert performance

Declaration
    public override void CleanUpBulkInsert(string tablename)
Parameters
TypeNameDescription
stringtablename
Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.CleanUpBulkInsert(string)

Clone()

Cretes a clone of the current connection manager

Declaration
    public override IConnectionManager Clone()
Returns
TypeDescription
IConnectionManager

A instance copy of the current connection manager

Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.Clone()

PrepareBulkInsert(string)

Performs preparations needed to improved performance of a bulk insert operation

Declaration
    public override void PrepareBulkInsert(string tablename)
Parameters
TypeNameDescription
stringtablename
Overrides
ETLBox.DbConnectionManager<SQLiteConnection, SQLiteTransaction, SQLiteParameter>.PrepareBulkInsert(string)

Implements

System.IDisposable