SQL - Extended
1.0.0
Pi-Con: Small utilities makes the difference
|
A pooled asynchronous connection to a SQLite database. More...
Public Member Functions | |
SQLiteAsyncConnection (string databasePath, bool storeDateTimeAsTicks=true) | |
Constructs a new SQLiteAsyncConnection and opens a pooled SQLite database specified by databasePath. More... | |
SQLiteAsyncConnection (string databasePath, SQLiteOpenFlags openFlags, bool storeDateTimeAsTicks=true) | |
Constructs a new SQLiteAsyncConnection and opens a pooled SQLite database specified by databasePath. More... | |
SQLiteAsyncConnection (SQLiteConnectionString connectionString) | |
Constructs a new SQLiteAsyncConnection and opens a pooled SQLite database using the given connection string. More... | |
TimeSpan | GetBusyTimeout () |
The amount of time to wait for a table to become unlocked. More... | |
Task | SetBusyTimeoutAsync (TimeSpan value) |
Sets the amount of time to wait for a table to become unlocked. More... | |
Task | EnableWriteAheadLoggingAsync () |
Enables the write ahead logging. WAL is significantly faster in most scenarios by providing better concurrency and better disk IO performance than the normal journal mode. You only need to call this function once in the lifetime of the database. More... | |
SQLiteConnectionWithLock | GetConnection () |
Gets the pooled lockable connection used by this async connection. You should never need to use this. This is provided only to add additional functionality to SQLite-net. If you use this connection, you must use the Lock method on it while using it. More... | |
Task | CloseAsync () |
Closes any pooled connections used by the database. More... | |
Task | EnableLoadExtensionAsync (bool enabled) |
Enable or disable extension loading. More... | |
Task< CreateTableResult > | CreateTableAsync< T > (CreateFlags createFlags=CreateFlags.None) |
Executes a "create table if not exists" on the database. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping. More... | |
Task< CreateTableResult > | CreateTableAsync (Type ty, CreateFlags createFlags=CreateFlags.None) |
Executes a "create table if not exists" on the database. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping. More... | |
Task< CreateTablesResult > | CreateTablesAsync< T, T2 > (CreateFlags createFlags=CreateFlags.None) |
Executes a "create table if not exists" on the database for each type. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping. More... | |
Task< CreateTablesResult > | CreateTablesAsync< T, T2, T3 > (CreateFlags createFlags=CreateFlags.None) |
Executes a "create table if not exists" on the database for each type. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping. More... | |
Task< CreateTablesResult > | CreateTablesAsync< T, T2, T3, T4 > (CreateFlags createFlags=CreateFlags.None) |
Executes a "create table if not exists" on the database for each type. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping. More... | |
Task< CreateTablesResult > | CreateTablesAsync< T, T2, T3, T4, T5 > (CreateFlags createFlags=CreateFlags.None) |
Executes a "create table if not exists" on the database for each type. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping. More... | |
Task< CreateTablesResult > | CreateTablesAsync (CreateFlags createFlags=CreateFlags.None, params Type[] types) |
Executes a "create table if not exists" on the database for each type. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping. More... | |
Task< int > | DropTableAsync< T > () |
Executes a "drop table" on the database. This is non-recoverable. More... | |
Task< int > | DropTableAsync (TableMapping map) |
Executes a "drop table" on the database. This is non-recoverable. More... | |
Task< int > | CreateIndexAsync (string tableName, string columnName, bool unique=false) |
Creates an index for the specified table and column. More... | |
Task< int > | CreateIndexAsync (string indexName, string tableName, string columnName, bool unique=false) |
Creates an index for the specified table and column. More... | |
Task< int > | CreateIndexAsync (string tableName, string[] columnNames, bool unique=false) |
Creates an index for the specified table and columns. More... | |
Task< int > | CreateIndexAsync (string indexName, string tableName, string[] columnNames, bool unique=false) |
Creates an index for the specified table and columns. More... | |
Task< int > | CreateIndexAsync< T > (Expression< Func< T, object >> property, bool unique=false) |
Creates an index for the specified object property. e.g. CreateIndex<Client>(c => c.Name); More... | |
Task< int > | InsertAsync (object obj) |
Inserts the given object and retrieves its auto incremented primary key if it has one. More... | |
Task< int > | InsertAsync (object obj, Type objType) |
Inserts the given object (and updates its auto incremented primary key if it has one). The return value is the number of rows added to the table. More... | |
Task< int > | InsertAsync (object obj, string extra) |
Inserts the given object (and updates its auto incremented primary key if it has one). The return value is the number of rows added to the table. More... | |
Task< int > | InsertAsync (object obj, string extra, Type objType) |
Inserts the given object (and updates its auto incremented primary key if it has one). The return value is the number of rows added to the table. More... | |
Task< int > | InsertOrReplaceAsync (object obj) |
Inserts the given object (and updates its auto incremented primary key if it has one). The return value is the number of rows added to the table. If a UNIQUE constraint violation occurs with some pre-existing object, this function deletes the old object. More... | |
Task< int > | InsertOrReplaceAsync (object obj, Type objType) |
Inserts the given object (and updates its auto incremented primary key if it has one). The return value is the number of rows added to the table. If a UNIQUE constraint violation occurs with some pre-existing object, this function deletes the old object. More... | |
Task< int > | UpdateAsync (object obj) |
Updates all of the columns of a table using the specified object except for its primary key. The object is required to have a primary key. More... | |
Task< int > | UpdateAsync (object obj, Type objType) |
Updates all of the columns of a table using the specified object except for its primary key. The object is required to have a primary key. More... | |
Task< int > | UpdateAllAsync (IEnumerable objects, bool runInTransaction=true) |
Updates all specified objects. More... | |
Task< int > | DeleteAsync (object objectToDelete) |
Deletes the given object from the database using its primary key. More... | |
Task< int > | DeleteAsync< T > (object primaryKey) |
Deletes the object with the specified primary key. More... | |
Task< int > | DeleteAsync (object primaryKey, TableMapping map) |
Deletes the object with the specified primary key. More... | |
Task< int > | DeleteAllAsync< T > () |
Deletes all the objects from the specified table. WARNING WARNING: Let me repeat. It deletes ALL the objects from the specified table. Do you really want to do that? More... | |
Task< int > | DeleteAllAsync (TableMapping map) |
Deletes all the objects from the specified table. WARNING WARNING: Let me repeat. It deletes ALL the objects from the specified table. Do you really want to do that? More... | |
Task | BackupAsync (string destinationDatabasePath, string databaseName="main") |
Backup the entire database to the specified path. More... | |
Task< T > | GetAsync< T > (object pk) |
Attempts to retrieve an object with the given primary key from the table associated with the specified type. Use of this method requires that the given type have a designated PrimaryKey (using the PrimaryKeyAttribute). More... | |
Task< object > | GetAsync (object pk, TableMapping map) |
Attempts to retrieve an object with the given primary key from the table associated with the specified type. Use of this method requires that the given type have a designated PrimaryKey (using the PrimaryKeyAttribute). More... | |
Task< T > | GetAsync< T > (Expression< Func< T, bool >> predicate) |
Attempts to retrieve the first object that matches the predicate from the table associated with the specified type. More... | |
Task< T > | FindAsync< T > (object pk) |
Attempts to retrieve an object with the given primary key from the table associated with the specified type. Use of this method requires that the given type have a designated PrimaryKey (using the PrimaryKeyAttribute). More... | |
Task< object > | FindAsync (object pk, TableMapping map) |
Attempts to retrieve an object with the given primary key from the table associated with the specified type. Use of this method requires that the given type have a designated PrimaryKey (using the PrimaryKeyAttribute). More... | |
Task< T > | FindAsync< T > (Expression< Func< T, bool >> predicate) |
Attempts to retrieve the first object that matches the predicate from the table associated with the specified type. More... | |
Task< T > | FindWithQueryAsync< T > (string query, params object[] args) |
Attempts to retrieve the first object that matches the query from the table associated with the specified type. More... | |
Task< object > | FindWithQueryAsync (TableMapping map, string query, params object[] args) |
Attempts to retrieve the first object that matches the query from the table associated with the specified type. More... | |
Task< TableMapping > | GetMappingAsync (Type type, CreateFlags createFlags=CreateFlags.None) |
Retrieves the mapping that is automatically generated for the given type. More... | |
Task< TableMapping > | GetMappingAsync< T > (CreateFlags createFlags=CreateFlags.None) |
Retrieves the mapping that is automatically generated for the given type. More... | |
Task< List< SQLiteConnection.ColumnInfo > > | GetTableInfoAsync (string tableName) |
Query the built-in sqlite table_info table for a specific tables columns. More... | |
Task< int > | ExecuteAsync (string query, params object[] args) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. Use this method instead of Query when you don't expect rows back. Such cases include INSERTs, UPDATEs, and DELETEs. You can set the Trace or TimeExecution properties of the connection to profile execution. More... | |
Task< int > | InsertAllAsync (IEnumerable objects, bool runInTransaction=true) |
Inserts all specified objects. More... | |
Task< int > | InsertAllAsync (IEnumerable objects, string extra, bool runInTransaction=true) |
Inserts all specified objects. More... | |
Task< int > | InsertAllAsync (IEnumerable objects, Type objType, bool runInTransaction=true) |
Inserts all specified objects. More... | |
Task | RunInTransactionAsync (Action< SQLiteConnection > action) |
Executes action within a (possibly nested) transaction by wrapping it in a SAVEPOINT. If an exception occurs the whole transaction is rolled back, not just the current savepoint. The exception is rethrown. More... | |
AsyncTableQuery< T > | Table< T > () |
Returns a queryable interface to the table represented by the given type. More... | |
Task< T > | ExecuteScalarAsync< T > (string query, params object[] args) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. Use this method when return primitive values. You can set the Trace or TimeExecution properties of the connection to profile execution. More... | |
Task< List< T > > | QueryAsync< T > (string query, params object[] args) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. It returns each row of the result using the mapping automatically generated for the given type. More... | |
Task< List< T > > | QueryScalarsAsync< T > (string query, params object[] args) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. It returns the first column of each row of the result. More... | |
Task< List< object > > | QueryAsync (TableMapping map, string query, params object[] args) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. It returns each row of the result using the specified mapping. This function is only used by libraries in order to query the database via introspection. It is normally not used. More... | |
Task< IEnumerable< T > > | DeferredQueryAsync< T > (string query, params object[] args) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. It returns each row of the result using the mapping automatically generated for the given type. More... | |
Task< IEnumerable< object > > | DeferredQueryAsync (TableMapping map, string query, params object[] args) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. It returns each row of the result using the specified mapping. This function is only used by libraries in order to query the database via introspection. It is normally not used. More... | |
Static Public Member Functions | |
static void | ResetPool () |
Closes all connections to all async databases. You should never need to do this. This is a blocking operation that will return when all connections have been closed. More... | |
Public Attributes | |
string | DatabasePath => GetConnection().DatabasePath |
Gets the database path used by this connection. More... | |
int | LibVersionNumber => GetConnection().LibVersionNumber |
Gets the SQLite library version number. 3007014 would be v3.7.14 More... | |
string | DateTimeStringFormat => GetConnection().DateTimeStringFormat |
The format to use when storing DateTime properties as strings. Ignored if StoreDateTimeAsTicks is true. More... | |
bool | StoreDateTimeAsTicks => GetConnection().StoreDateTimeAsTicks |
Whether to store DateTime properties as ticks (true) or strings (false). More... | |
bool | StoreTimeSpanAsTicks => GetConnection().StoreTimeSpanAsTicks |
Whether to store TimeSpan properties as ticks (true) or strings (false). More... | |
IEnumerable< TableMapping > | TableMappings => GetConnection().TableMappings |
Returns the mappings from types to tables that the connection currently understands. More... | |
Properties | |
bool | Trace [get, set] |
Whether to writer queries to Tracer during execution. More... | |
Action< string > | Tracer [get, set] |
The delegate responsible for writing trace lines. More... | |
bool | TimeExecution [get, set] |
Whether Trace lines should be written that show the execution time of queries. More... | |
A pooled asynchronous connection to a SQLite database.
SQLite.SQLiteAsyncConnection.SQLiteAsyncConnection | ( | string | databasePath, |
bool | storeDateTimeAsTicks = true |
||
) |
Constructs a new SQLiteAsyncConnection and opens a pooled SQLite database specified by databasePath.
databasePath | Specifies the path to the database file. |
storeDateTimeAsTicks | Specifies whether to store DateTime properties as ticks (true) or strings (false). You absolutely do want to store them as Ticks in all new projects. The value of false is only here for backwards compatibility. There is a significant speed advantage, with no down sides, when setting storeDateTimeAsTicks = true. If you use DateTimeOffset properties, it will be always stored as ticks regardingless the storeDateTimeAsTicks parameter. |
SQLite.SQLiteAsyncConnection.SQLiteAsyncConnection | ( | string | databasePath, |
SQLiteOpenFlags | openFlags, | ||
bool | storeDateTimeAsTicks = true |
||
) |
Constructs a new SQLiteAsyncConnection and opens a pooled SQLite database specified by databasePath.
databasePath | Specifies the path to the database file. |
openFlags | Flags controlling how the connection should be opened. Async connections should have the FullMutex flag set to provide best performance. |
storeDateTimeAsTicks | Specifies whether to store DateTime properties as ticks (true) or strings (false). You absolutely do want to store them as Ticks in all new projects. The value of false is only here for backwards compatibility. There is a significant speed advantage, with no down sides, when setting storeDateTimeAsTicks = true. If you use DateTimeOffset properties, it will be always stored as ticks regardingless the storeDateTimeAsTicks parameter. |
SQLite.SQLiteAsyncConnection.SQLiteAsyncConnection | ( | SQLiteConnectionString | connectionString | ) |
Constructs a new SQLiteAsyncConnection and opens a pooled SQLite database using the given connection string.
connectionString | Details on how to find and open the database. |
Task SQLite.SQLiteAsyncConnection.BackupAsync | ( | string | destinationDatabasePath, |
string | databaseName = "main" |
||
) |
Backup the entire database to the specified path.
destinationDatabasePath | Path to backup file. |
databaseName | The name of the database to backup (usually "main"). |
Task SQLite.SQLiteAsyncConnection.CloseAsync | ( | ) |
Closes any pooled connections used by the database.
Task<int> SQLite.SQLiteAsyncConnection.CreateIndexAsync | ( | string | indexName, |
string | tableName, | ||
string | columnName, | ||
bool | unique = false |
||
) |
Creates an index for the specified table and column.
indexName | Name of the index to create |
tableName | Name of the database table |
columnName | Name of the column to index |
unique | Whether the index should be unique |
Task<int> SQLite.SQLiteAsyncConnection.CreateIndexAsync | ( | string | indexName, |
string | tableName, | ||
string[] | columnNames, | ||
bool | unique = false |
||
) |
Creates an index for the specified table and columns.
indexName | Name of the index to create |
tableName | Name of the database table |
columnNames | An array of column names to index |
unique | Whether the index should be unique |
Task<int> SQLite.SQLiteAsyncConnection.CreateIndexAsync | ( | string | tableName, |
string | columnName, | ||
bool | unique = false |
||
) |
Creates an index for the specified table and column.
tableName | Name of the database table |
columnName | Name of the column to index |
unique | Whether the index should be unique |
Task<int> SQLite.SQLiteAsyncConnection.CreateIndexAsync | ( | string | tableName, |
string[] | columnNames, | ||
bool | unique = false |
||
) |
Creates an index for the specified table and columns.
tableName | Name of the database table |
columnNames | An array of column names to index |
unique | Whether the index should be unique |
Task<int> SQLite.SQLiteAsyncConnection.CreateIndexAsync< T > | ( | Expression< Func< T, object >> | property, |
bool | unique = false |
||
) |
Creates an index for the specified object property. e.g. CreateIndex<Client>(c => c.Name);
T | Type to reflect to a database table. |
property | Property to index |
unique | Whether the index should be unique |
Task<CreateTableResult> SQLite.SQLiteAsyncConnection.CreateTableAsync | ( | Type | ty, |
CreateFlags | createFlags = CreateFlags.None |
||
) |
Executes a "create table if not exists" on the database. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping.
ty | Type to reflect to a database table. |
createFlags | Optional flags allowing implicit PK and indexes based on naming conventions. |
Task<CreateTableResult> SQLite.SQLiteAsyncConnection.CreateTableAsync< T > | ( | CreateFlags | createFlags = CreateFlags.None | ) |
Executes a "create table if not exists" on the database. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping.
T | : | new() |
Task<CreateTablesResult> SQLite.SQLiteAsyncConnection.CreateTablesAsync | ( | CreateFlags | createFlags = CreateFlags.None , |
params Type[] | types | ||
) |
Executes a "create table if not exists" on the database for each type. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping.
Task<CreateTablesResult> SQLite.SQLiteAsyncConnection.CreateTablesAsync< T, T2 > | ( | CreateFlags | createFlags = CreateFlags.None | ) |
Executes a "create table if not exists" on the database for each type. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping.
T | : | new() | |
T2 | : | new() |
Task<CreateTablesResult> SQLite.SQLiteAsyncConnection.CreateTablesAsync< T, T2, T3 > | ( | CreateFlags | createFlags = CreateFlags.None | ) |
Executes a "create table if not exists" on the database for each type. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping.
T | : | new() | |
T2 | : | new() | |
T3 | : | new() |
Task<CreateTablesResult> SQLite.SQLiteAsyncConnection.CreateTablesAsync< T, T2, T3, T4 > | ( | CreateFlags | createFlags = CreateFlags.None | ) |
Executes a "create table if not exists" on the database for each type. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping.
T | : | new() | |
T2 | : | new() | |
T3 | : | new() | |
T4 | : | new() |
Task<CreateTablesResult> SQLite.SQLiteAsyncConnection.CreateTablesAsync< T, T2, T3, T4, T5 > | ( | CreateFlags | createFlags = CreateFlags.None | ) |
Executes a "create table if not exists" on the database for each type. It also creates any specified indexes on the columns of the table. It uses a schema automatically generated from the specified type. You can later access this schema by calling GetMapping.
T | : | new() | |
T2 | : | new() | |
T3 | : | new() | |
T4 | : | new() | |
T5 | : | new() |
Task<IEnumerable<object> > SQLite.SQLiteAsyncConnection.DeferredQueryAsync | ( | TableMapping | map, |
string | query, | ||
params object[] | args | ||
) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. It returns each row of the result using the specified mapping. This function is only used by libraries in order to query the database via introspection. It is normally not used.
map | A TableMapping to use to convert the resulting rows into objects. |
query | The fully escaped SQL. |
args | Arguments to substitute for the occurences of '?' in the query. |
Task<IEnumerable<T> > SQLite.SQLiteAsyncConnection.DeferredQueryAsync< T > | ( | string | query, |
params object[] | args | ||
) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. It returns each row of the result using the mapping automatically generated for the given type.
query | The fully escaped SQL. |
args | Arguments to substitute for the occurences of '?' in the query. |
T | : | new() |
Task<int> SQLite.SQLiteAsyncConnection.DeleteAllAsync | ( | TableMapping | map | ) |
Deletes all the objects from the specified table. WARNING WARNING: Let me repeat. It deletes ALL the objects from the specified table. Do you really want to do that?
map | The TableMapping used to identify the table. |
Task<int> SQLite.SQLiteAsyncConnection.DeleteAllAsync< T > | ( | ) |
Deletes all the objects from the specified table. WARNING WARNING: Let me repeat. It deletes ALL the objects from the specified table. Do you really want to do that?
T | The type of objects to delete. |
Task<int> SQLite.SQLiteAsyncConnection.DeleteAsync | ( | object | objectToDelete | ) |
Deletes the given object from the database using its primary key.
objectToDelete | The object to delete. It must have a primary key designated using the PrimaryKeyAttribute. |
Task<int> SQLite.SQLiteAsyncConnection.DeleteAsync | ( | object | primaryKey, |
TableMapping | map | ||
) |
Deletes the object with the specified primary key.
primaryKey | The primary key of the object to delete. |
map | The TableMapping used to identify the table. |
Task<int> SQLite.SQLiteAsyncConnection.DeleteAsync< T > | ( | object | primaryKey | ) |
Deletes the object with the specified primary key.
primaryKey | The primary key of the object to delete. |
T | The type of object. |
Task<int> SQLite.SQLiteAsyncConnection.DropTableAsync | ( | TableMapping | map | ) |
Executes a "drop table" on the database. This is non-recoverable.
map | The TableMapping used to identify the table. |
Task<int> SQLite.SQLiteAsyncConnection.DropTableAsync< T > | ( | ) |
Executes a "drop table" on the database. This is non-recoverable.
T | : | new() |
Task SQLite.SQLiteAsyncConnection.EnableLoadExtensionAsync | ( | bool | enabled | ) |
Enable or disable extension loading.
Task SQLite.SQLiteAsyncConnection.EnableWriteAheadLoggingAsync | ( | ) |
Enables the write ahead logging. WAL is significantly faster in most scenarios by providing better concurrency and better disk IO performance than the normal journal mode. You only need to call this function once in the lifetime of the database.
Task<int> SQLite.SQLiteAsyncConnection.ExecuteAsync | ( | string | query, |
params object[] | args | ||
) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. Use this method instead of Query when you don't expect rows back. Such cases include INSERTs, UPDATEs, and DELETEs. You can set the Trace or TimeExecution properties of the connection to profile execution.
query | The fully escaped SQL. |
args | Arguments to substitute for the occurences of '?' in the query. |
Task<T> SQLite.SQLiteAsyncConnection.ExecuteScalarAsync< T > | ( | string | query, |
params object[] | args | ||
) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. Use this method when return primitive values. You can set the Trace or TimeExecution properties of the connection to profile execution.
query | The fully escaped SQL. |
args | Arguments to substitute for the occurences of '?' in the query. |
Task<object> SQLite.SQLiteAsyncConnection.FindAsync | ( | object | pk, |
TableMapping | map | ||
) |
Attempts to retrieve an object with the given primary key from the table associated with the specified type. Use of this method requires that the given type have a designated PrimaryKey (using the PrimaryKeyAttribute).
pk | The primary key. |
map | The TableMapping used to identify the table. |
Task<T> SQLite.SQLiteAsyncConnection.FindAsync< T > | ( | Expression< Func< T, bool >> | predicate | ) |
Attempts to retrieve the first object that matches the predicate from the table associated with the specified type.
predicate | A predicate for which object to find. |
T | : | new() |
Task<T> SQLite.SQLiteAsyncConnection.FindAsync< T > | ( | object | pk | ) |
Attempts to retrieve an object with the given primary key from the table associated with the specified type. Use of this method requires that the given type have a designated PrimaryKey (using the PrimaryKeyAttribute).
pk | The primary key. |
T | : | new() |
Task<object> SQLite.SQLiteAsyncConnection.FindWithQueryAsync | ( | TableMapping | map, |
string | query, | ||
params object[] | args | ||
) |
Attempts to retrieve the first object that matches the query from the table associated with the specified type.
map | The TableMapping used to identify the table. |
query | The fully escaped SQL. |
args | Arguments to substitute for the occurences of '?' in the query. |
Task<T> SQLite.SQLiteAsyncConnection.FindWithQueryAsync< T > | ( | string | query, |
params object[] | args | ||
) |
Attempts to retrieve the first object that matches the query from the table associated with the specified type.
query | The fully escaped SQL. |
args | Arguments to substitute for the occurences of '?' in the query. |
T | : | new() |
Task<object> SQLite.SQLiteAsyncConnection.GetAsync | ( | object | pk, |
TableMapping | map | ||
) |
Attempts to retrieve an object with the given primary key from the table associated with the specified type. Use of this method requires that the given type have a designated PrimaryKey (using the PrimaryKeyAttribute).
pk | The primary key. |
map | The TableMapping used to identify the table. |
Task<T> SQLite.SQLiteAsyncConnection.GetAsync< T > | ( | Expression< Func< T, bool >> | predicate | ) |
Attempts to retrieve the first object that matches the predicate from the table associated with the specified type.
predicate | A predicate for which object to find. |
T | : | new() |
Task<T> SQLite.SQLiteAsyncConnection.GetAsync< T > | ( | object | pk | ) |
Attempts to retrieve an object with the given primary key from the table associated with the specified type. Use of this method requires that the given type have a designated PrimaryKey (using the PrimaryKeyAttribute).
pk | The primary key. |
T | : | new() |
TimeSpan SQLite.SQLiteAsyncConnection.GetBusyTimeout | ( | ) |
The amount of time to wait for a table to become unlocked.
SQLiteConnectionWithLock SQLite.SQLiteAsyncConnection.GetConnection | ( | ) |
Gets the pooled lockable connection used by this async connection. You should never need to use this. This is provided only to add additional functionality to SQLite-net. If you use this connection, you must use the Lock method on it while using it.
Task<TableMapping> SQLite.SQLiteAsyncConnection.GetMappingAsync | ( | Type | type, |
CreateFlags | createFlags = CreateFlags.None |
||
) |
Retrieves the mapping that is automatically generated for the given type.
type | The type whose mapping to the database is returned. |
createFlags | Optional flags allowing implicit PK and indexes based on naming conventions |
Task<TableMapping> SQLite.SQLiteAsyncConnection.GetMappingAsync< T > | ( | CreateFlags | createFlags = CreateFlags.None | ) |
Retrieves the mapping that is automatically generated for the given type.
createFlags | Optional flags allowing implicit PK and indexes based on naming conventions |
T | : | new() |
Task<List<SQLiteConnection.ColumnInfo> > SQLite.SQLiteAsyncConnection.GetTableInfoAsync | ( | string | tableName | ) |
Query the built-in sqlite table_info table for a specific tables columns.
tableName | Table name. |
Task<int> SQLite.SQLiteAsyncConnection.InsertAllAsync | ( | IEnumerable | objects, |
bool | runInTransaction = true |
||
) |
Inserts all specified objects.
objects | An IEnumerable of the objects to insert.
|
Task<int> SQLite.SQLiteAsyncConnection.InsertAllAsync | ( | IEnumerable | objects, |
string | extra, | ||
bool | runInTransaction = true |
||
) |
Inserts all specified objects.
objects | An IEnumerable of the objects to insert. |
extra | Literal SQL code that gets placed into the command. INSERT {extra} INTO ... |
runInTransaction | A boolean indicating if the inserts should be wrapped in a transaction. |
Task<int> SQLite.SQLiteAsyncConnection.InsertAllAsync | ( | IEnumerable | objects, |
Type | objType, | ||
bool | runInTransaction = true |
||
) |
Inserts all specified objects.
objects | An IEnumerable of the objects to insert. |
objType | The type of object to insert. |
runInTransaction | A boolean indicating if the inserts should be wrapped in a transaction. |
Task<int> SQLite.SQLiteAsyncConnection.InsertAsync | ( | object | obj | ) |
Inserts the given object and retrieves its auto incremented primary key if it has one.
obj | The object to insert. |
Task<int> SQLite.SQLiteAsyncConnection.InsertAsync | ( | object | obj, |
string | extra | ||
) |
Inserts the given object (and updates its auto incremented primary key if it has one). The return value is the number of rows added to the table.
obj | The object to insert. |
extra | Literal SQL code that gets placed into the command. INSERT {extra} INTO ... |
Task<int> SQLite.SQLiteAsyncConnection.InsertAsync | ( | object | obj, |
string | extra, | ||
Type | objType | ||
) |
Inserts the given object (and updates its auto incremented primary key if it has one). The return value is the number of rows added to the table.
obj | The object to insert. |
extra | Literal SQL code that gets placed into the command. INSERT {extra} INTO ... |
objType | The type of object to insert. |
Task<int> SQLite.SQLiteAsyncConnection.InsertAsync | ( | object | obj, |
Type | objType | ||
) |
Inserts the given object (and updates its auto incremented primary key if it has one). The return value is the number of rows added to the table.
obj | The object to insert. |
objType | The type of object to insert. |
Task<int> SQLite.SQLiteAsyncConnection.InsertOrReplaceAsync | ( | object | obj | ) |
Inserts the given object (and updates its auto incremented primary key if it has one). The return value is the number of rows added to the table. If a UNIQUE constraint violation occurs with some pre-existing object, this function deletes the old object.
obj | The object to insert. |
Task<int> SQLite.SQLiteAsyncConnection.InsertOrReplaceAsync | ( | object | obj, |
Type | objType | ||
) |
Inserts the given object (and updates its auto incremented primary key if it has one). The return value is the number of rows added to the table. If a UNIQUE constraint violation occurs with some pre-existing object, this function deletes the old object.
obj | The object to insert. |
objType | The type of object to insert. |
Task<List<object> > SQLite.SQLiteAsyncConnection.QueryAsync | ( | TableMapping | map, |
string | query, | ||
params object[] | args | ||
) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. It returns each row of the result using the specified mapping. This function is only used by libraries in order to query the database via introspection. It is normally not used.
map | A TableMapping to use to convert the resulting rows into objects. |
query | The fully escaped SQL. |
args | Arguments to substitute for the occurences of '?' in the query. |
Task<List<T> > SQLite.SQLiteAsyncConnection.QueryAsync< T > | ( | string | query, |
params object[] | args | ||
) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. It returns each row of the result using the mapping automatically generated for the given type.
query | The fully escaped SQL. |
args | Arguments to substitute for the occurences of '?' in the query. |
T | : | new() |
Task<List<T> > SQLite.SQLiteAsyncConnection.QueryScalarsAsync< T > | ( | string | query, |
params object[] | args | ||
) |
Creates a SQLiteCommand given the command text (SQL) with arguments. Place a '?' in the command text for each of the arguments and then executes that command. It returns the first column of each row of the result.
query | The fully escaped SQL. |
args | Arguments to substitute for the occurences of '?' in the query. |
|
static |
Closes all connections to all async databases. You should never need to do this. This is a blocking operation that will return when all connections have been closed.
Task SQLite.SQLiteAsyncConnection.RunInTransactionAsync | ( | Action< SQLiteConnection > | action | ) |
Executes action within a (possibly nested) transaction by wrapping it in a SAVEPOINT. If an exception occurs the whole transaction is rolled back, not just the current savepoint. The exception is rethrown.
action | The Action to perform within a transaction. action can contain any number of operations on the connection but should never call SQLiteConnection.Commit or SQLiteConnection.Commit. |
Task SQLite.SQLiteAsyncConnection.SetBusyTimeoutAsync | ( | TimeSpan | value | ) |
Sets the amount of time to wait for a table to become unlocked.
AsyncTableQuery<T> SQLite.SQLiteAsyncConnection.Table< T > | ( | ) |
Returns a queryable interface to the table represented by the given type.
T | : | new() |
Task<int> SQLite.SQLiteAsyncConnection.UpdateAllAsync | ( | IEnumerable | objects, |
bool | runInTransaction = true |
||
) |
Updates all specified objects.
objects | An IEnumerable of the objects to insert. |
runInTransaction | A boolean indicating if the inserts should be wrapped in a transaction |
Task<int> SQLite.SQLiteAsyncConnection.UpdateAsync | ( | object | obj | ) |
Updates all of the columns of a table using the specified object except for its primary key. The object is required to have a primary key.
obj | The object to update. It must have a primary key designated using the PrimaryKeyAttribute. |
Task<int> SQLite.SQLiteAsyncConnection.UpdateAsync | ( | object | obj, |
Type | objType | ||
) |
Updates all of the columns of a table using the specified object except for its primary key. The object is required to have a primary key.
obj | The object to update. It must have a primary key designated using the PrimaryKeyAttribute. |
objType | The type of object to insert. |
string SQLite.SQLiteAsyncConnection.DatabasePath => GetConnection().DatabasePath |
Gets the database path used by this connection.
string SQLite.SQLiteAsyncConnection.DateTimeStringFormat => GetConnection().DateTimeStringFormat |
The format to use when storing DateTime properties as strings. Ignored if StoreDateTimeAsTicks is true.
The date time string format.
int SQLite.SQLiteAsyncConnection.LibVersionNumber => GetConnection().LibVersionNumber |
Gets the SQLite library version number. 3007014 would be v3.7.14
bool SQLite.SQLiteAsyncConnection.StoreDateTimeAsTicks => GetConnection().StoreDateTimeAsTicks |
Whether to store DateTime properties as ticks (true) or strings (false).
bool SQLite.SQLiteAsyncConnection.StoreTimeSpanAsTicks => GetConnection().StoreTimeSpanAsTicks |
Whether to store TimeSpan properties as ticks (true) or strings (false).
IEnumerable<TableMapping> SQLite.SQLiteAsyncConnection.TableMappings => GetConnection().TableMappings |
Returns the mappings from types to tables that the connection currently understands.
|
getset |
Whether Trace lines should be written that show the execution time of queries.
|
getset |
Whether to writer queries to Tracer during execution.
The tracer.
|
getset |
The delegate responsible for writing trace lines.
The tracer.