Skip to end of metadata
Go to start of metadata

Represents an async open connection to a SQLite database.

Definition

public class SQLiteAsyncConnection : ISQLiteAsyncConnection

Summary

The following table summarizes the members exposed in this class.

Public Constructors

SQLiteAsyncConnection Constructor(string) Initializes a new instance of the SQLiteAsyncConnection class.

Public Properties

Connection Gets the SQLite connection.

Public Methods

ClearTableAsync<T>() Clears the table data asynchronously.
ClearTableAsync(Type) Clears the table asynchronous.
CreateTableAsync<T>() Creates the table asynchronously.
CreateTableAsync<T>(bool) Creates the table asynchronously.
CreateTableAsync(Type, bool) Creates the table asynchronously.
CreateTablesAsync(Type[]) Creates the tables asynchronously.
CreateTablesAsync(bool, Type[]) Creates the tables asynchronously.
DeferredQueryAsync<T>(string, Object[]) Deferres the query asynchronously.
DeferredQueryAsync(Type, string, Object[]) Deferres the query asynchronously.
DeleteAsync(object) Deletes the specified item asynchronously.
Dispose() Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
DropTableAsync<T>() Drops the table asynchronously.
DropTableAsync(Type) Drops the table asynchronously.
ExecuteAsync(string, Object[]) Executes the query asynchronously.
ExecuteScalarAsync<T>(string, Object[]) Executes the scalar query asynchronously.
FinalizeSynchronizationAsync(IEnumerable, IEnumerable) Finalizes synchronization item asynchronously.
FindAsync<T>(object, Object[]) Finds an entity based on the specified primary keys asynchronously.
FindAsync(Type, object, Object[]) Finds an entity based on the specified primary keys asynchronously.
FindAsync<T>(Expression<Func<T, bool>>) Finds an entity based on the specified function the asynchronously.
GetAsync<T>(object, Object[]) Gets the entity based on the specified primary keys asynchronously.
GetAsync(Type, object, Object[]) Gets the entity based on the specified primary keys asynchronously.
GetAsync<T>(Expression<Func<T, bool>>) Gets the entity based on the specified function asynchronously.
GetPendingChangesAsync(Type, QueryDescriptor) Gets the pending changes from the specified table and query descriptor
GetPendingChangesAsync(Dictionary<Type, QueryDescriptor>) Gets the pending changes from the specified tables and query descriptors
GetPendingChangesAsync(bool, Dictionary<Type, QueryDescriptor>) Gets the pending changes from the specified tables and query descriptors
GetPendingChangesAsync(Type[]) Gets the pending changes from the specified tables asynchronously.
GetPendingChangesAsync(bool, Type[]) Gets the pending changes from the specified tables asynchronously.
GetTable(Type) Gets the table query.
InsertAllAsync(IEnumerable) Inserts the specified items asynchronously.
InsertAllAsync(IEnumerable, bool) Inserts the specified items asynchronously.
InsertAllAsync(IEnumerable, SqliteConflictResolution) Inserts the specified items asynchronously.
InsertAllAsync(IEnumerable, SqliteConflictResolution, bool) Inserts the specified items asynchronously.
InsertAsync(object) Inserts the specified item asynchronously.
InsertAsync(object, bool) Inserts the specified item asynchronously.
InsertAsync(object, SqliteConflictResolution) Inserts the specified item asynchronously.
InsertAsync(object, SqliteConflictResolution, bool) Inserts the specified item asynchronously.
QueryAsync<T>(string, Object[]) Execute the query asynchronously.
QueryAsync(Type, string, Object[]) Execute the query asynchronously.
RunInTransactionAsync(Action<ISQLiteConnection>) Runs the query in transaction asynchronously.
SaveChangesAsync(IEnumerable<IEntity>) Saves the changes from the specified items.
SaveChangesAsync(IEnumerable<IEntity>, SqliteConflictResolution) Saves the changes from the specified items.
Table<T>() Gets the table query.
UpdateAllAsync(IEnumerable) Updates the specified items asynchronously.
UpdateAsync(object) Updates the specified item asynchronously.
UpdateAsync(object, Type) Updates the specified item asynchronously.

Protected Methods

Dispose(bool) Releases unmanaged and - optionally - managed resources.
Finalize() Allows an object to try to free resources and perform other cleanup operations before the System.Object is reclaimed by garbage collection.

Public Constructors

public SQLiteAsyncConnection(string databasePath)

Initializes a new instance of the SQLiteAsyncConnection class.

Parameters

databasePath The database path.

Public Properties

public ISQLiteConnection Connection { get; }

Gets the SQLite connection.

Public Methods

public Task<int> ClearTableAsync<T>()

Clears the table data asynchronously.

Type Parameters

T The table type.

public Task<int> ClearTableAsync(Type type)

Clears the table asynchronous.

Parameters

type The table type.

public Task<int> CreateTableAsync<T>()

Creates the table asynchronously.

Type Parameters

T The table type.

public Task<int> CreateTableAsync<T>(bool createIndexes)

Creates the table asynchronously.

Type Parameters

T The table type.

Parameters

createIndexes if set to true create indexes.

public Task<int> CreateTableAsync(Type type, bool createIndexes)

Creates the table asynchronously.

Parameters

type The table type.
createIndexes if set to true create indexes.

public Task<CreateTablesResult> CreateTablesAsync(Type[] types)

Creates the tables asynchronously.

Parameters

types The table types.

public Task<CreateTablesResult> CreateTablesAsync(bool createIndexes, Type[] types)

Creates the tables asynchronously.

Parameters

createIndexes if set to true create indexes.
types The types.

public Task<IEnumerable<T>> DeferredQueryAsync<T>(string query, Object[] arguments)

Deferres the query asynchronously.

Type Parameters

T The query type.

Parameters

query The query.
arguments The arguments.

public Task<IEnumerable<object>> DeferredQueryAsync(Type type, string query, Object[] arguments)

Deferres the query asynchronously.

Parameters

type The entity type.
query The query.
arguments The arguments.

public Task<int> DeleteAsync(object item)

Deletes the specified item asynchronously.

Parameters

item The item.

public void Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public Task<int> DropTableAsync<T>()

Drops the table asynchronously.

Type Parameters

T The table type.

public Task<int> DropTableAsync(Type type)

Drops the table asynchronously.

Parameters

type The table type.

public Task<int> ExecuteAsync(string query, Object[] arguments)

Executes the query asynchronously.

Parameters

query The query.
arguments The arguments.

public Task<T> ExecuteScalarAsync<T>(string query, Object[] arguments)

Executes the scalar query asynchronously.

Type Parameters

T The type of the entity.

Parameters

query The query.
arguments The arguments.

public Task<int> FinalizeSynchronizationAsync(IEnumerable pendingChanges, IEnumerable finalItems)

Finalizes synchronization item asynchronously.

Parameters

pendingChanges The pending items to be updated.
finalItems The final items to be inserted.

public Task<T> FindAsync<T>(object primaryKey, Object[] primaryKeys)

Finds an entity based on the specified primary keys asynchronously.

Type Parameters

T The entity type.

Parameters

primaryKey The primary key.
primaryKeys The primary keys.

public Task<object> FindAsync(Type type, object primaryKey, Object[] primaryKeys)

Finds an entity based on the specified primary keys asynchronously.

Parameters

type The entity type.
primaryKey The primary key.
primaryKeys The primary keys.

public Task<T> FindAsync<T>(Expression<Func<T, bool>> predicate)

Finds an entity based on the specified function the asynchronously.

Type Parameters

T The entity type.

Parameters

predicate The predicate function.

public Task<T> GetAsync<T>(object primaryKey, Object[] primaryKeys)

Gets the entity based on the specified primary keys asynchronously.

Type Parameters

T The entity type.

Parameters

primaryKey The primary key.
primaryKeys The primary keys.

public Task<object> GetAsync(Type type, object primaryKey, Object[] primaryKeys)

Gets the entity based on the specified primary keys asynchronously.

Parameters

type The entity type.
primaryKey The primary key.
primaryKeys The primary keys.

public Task<T> GetAsync<T>(Expression<Func<T, bool>> predicate)

Gets the entity based on the specified function asynchronously.

Type Parameters

T The entity type.

Parameters

predicate The predicate function.

public Task<IEnumerable<object>> GetPendingChangesAsync(Type type, QueryDescriptor queryDescriptor)

Gets the pending changes from the specified table and query descriptor

Parameters

type The entity type.
queryDescriptor The query descriptor.

public Task<IEnumerable> GetPendingChangesAsync(Dictionary<Type, QueryDescriptor> types)

Gets the pending changes from the specified tables and query descriptors

Parameters

types A key pair value that represents table and its query descriptor.

public Task<IEnumerable> GetPendingChangesAsync(bool restoreEntityState, Dictionary<Type, QueryDescriptor> types)

Gets the pending changes from the specified tables and query descriptors

Parameters

restoreEntityState Restore entity state when retrieving pending changes.
types A key pair value that represents table and its query descriptor.

public Task<IEnumerable> GetPendingChangesAsync(Type[] types)

Gets the pending changes from the specified tables asynchronously.

Parameters

types The tables type.

public Task<IEnumerable> GetPendingChangesAsync(bool restoreEntityState, Type[] types)

Gets the pending changes from the specified tables asynchronously.

Parameters

restoreEntityState Restore entity state when retrieving pending changes.
types The tables type.

public IAsyncTableQuery GetTable(Type type)

Gets the table query.

Parameters

type The table type.

public Task<int> InsertAllAsync(IEnumerable items)

Inserts the specified items asynchronously.

Parameters

items The items.

public Task<int> InsertAllAsync(IEnumerable items, bool recursive)

Inserts the specified items asynchronously.

Parameters

items The items.
recursive if set to true insert the child table recursivel..

public Task<int> InsertAllAsync(IEnumerable items, SqliteConflictResolution conflictResolution)

Inserts the specified items asynchronously.

Parameters

items The items.
conflictResolution The conflict resolution.

public Task<int> InsertAllAsync(IEnumerable items, SqliteConflictResolution conflictResolution, bool recursive)

Inserts the specified items asynchronously.

Parameters

items The items.
conflictResolution The conflict resolution.
recursive if set to true insert the child table recursively.

public Task<int> InsertAsync(object item)

Inserts the specified item asynchronously.

Parameters

item The item.

public Task<int> InsertAsync(object item, bool recursive)

Inserts the specified item asynchronously.

Parameters

item The item.
recursive if set to true insert the child table recursively.

public Task<int> InsertAsync(object item, SqliteConflictResolution conflictResolution)

Inserts the specified item asynchronously.

Parameters

item The item.
conflictResolution The conflict resolution.

public Task<int> InsertAsync(object item, SqliteConflictResolution conflictResolution, bool recursive)

Inserts the specified item asynchronously.

Parameters

item The item.
conflictResolution The conflict resolution.
recursive if set to true insert the child table recursively.

public Task<List<T>> QueryAsync<T>(string query, Object[] arguments)

Execute the query asynchronously.

Type Parameters

T The entity type.

Parameters

query The query.
arguments The arguments.

public Task<List<object>> QueryAsync(Type type, string query, Object[] arguments)

Execute the query asynchronously.

Parameters

type The type.
query The query.
arguments The arguments.

public Task RunInTransactionAsync(Action<ISQLiteConnection> action)

Runs the query in transaction asynchronously.

Parameters

action The action.

public Task<SaveResult> SaveChangesAsync(IEnumerable<IEntity> items)

Saves the changes from the specified items.

Parameters

items Items to be saved.

Return Types

The save result.

public Task<SaveResult> SaveChangesAsync(IEnumerable<IEntity> items, SqliteConflictResolution conflicResolution)

Saves the changes from the specified items.

Parameters

items Items to be saved.
conflicResolution The conflic resolution.

Return Types

The save result.

public IAsyncTableQuery<T> Table<T>()

Gets the table query.

Type Parameters

T The table type.

public Task<int> UpdateAllAsync(IEnumerable items)

Updates the specified items asynchronously.

Parameters

items The items.

public Task<int> UpdateAsync(object item)

Updates the specified item asynchronously.

Parameters

item The item.

public Task<int> UpdateAsync(object item, Type itemType)

Updates the specified item asynchronously.

Parameters

item The item.
itemType Type of the item.

Protected Methods

protected void Dispose(bool disposing)

Releases unmanaged and - optionally - managed resources.

Parameters

disposing true to release both managed and unmanaged resources; false to release only unmanaged resources.

protected void Finalize()

Allows an object to try to free resources and perform other cleanup operations before the System.Object is reclaimed by garbage collection.

  • No labels