Implements an IDbAccess for SQLite.
Default constructor
public Void SQLiteDbAccess()
Whether the database connection is opened.
public Boolean IsConnectionOpen { get; }
Whether an opened connection is runing a transaction.
public Boolean IsInTransaction { get; }
Password for the database.
public String Password { set; }
User name.
public String UserName { set; }
This value is not use in SQLite.
Adds a parameter to command.
public Void AddParameter(command, name, type, direction, size, value)
Name | Type | Summary |
---|---|---|
command | IDbCommand | An SQLiteCommand. |
name | String | Quoted parameter name. |
type | DbType | Parameter data type. |
direction | ParameterDirection | Direction. |
size | Int32 | Size of the data. |
value | Object | Parameter value. |
Type | Summary |
---|---|
DataAccessException | Thrown when there are an error casting the parameter value. |
Initiates a database transaction.
public IDbTransaction BeginTransaction()
An object representing the new transaction.
Initiates a database transaction with the specified isolation level.
public IDbTransaction BeginTransaction(iso)
An object representing the new transaction.
Name | Type | Summary |
---|---|---|
iso | IsolationLevel | Isolation level for the transaction. |
Closes the database connection if it is opened.
public Void CloseConnection()
Commits the running database transaction.
public Void CommitTransaction()
Creates a new database command.
public IDbCommand CreateCommand(commandType)
A new SQLiteCommand.
Name | Type | Summary |
---|---|---|
commandType | CommandType | Type of the command to create. |
Type | Summary |
---|---|
InvalidOperationException | Thrown when commandType is not supported. |
Performs application-defined tasks associated with freeing, releasing, or reseting unmaneged resources
public Void Dispose()
Executes the command.
public Int32 ExecuteCommand(command, dataTable)
Quantity of records affected by the command.
If the command returns a set of records, the dataTable parameter must contain an initialize DataTable, otherwise it must be null
Name | Type | Summary |
---|---|---|
command | IDbCommand | A SQLiteCommand to execute. |
dataTable | DataTable | An initialized DataTable object or null |
Type | Summary |
---|---|
DataAccessException | Thrown when an unindentify error occurs. |
OpenConnectionException | Thrown when a connection could not be openned. |
DuplicatedPrimaryKeyException | Thrown when a primary key or unique index constraint fails. |
ConstraintViolationException | Thrown if a constraint is violated. |
Asyncronously executes the command.
public Task<Int32> ExecuteCommandAsync(command, dataTable)
Quantity of records affected by the command.
If the command returns a set of records, the dataTable parameter must contain an initialize DataTable, otherwise it must be null
Name | Type | Summary |
---|---|---|
command | IDbCommand | A SQLiteCommand to execute. |
dataTable | DataTable | An initialized DataTable object or null |
Type | Summary |
---|---|
DataAccessException | Thrown when an unindentify error occurs. |
OpenConnectionException | Thrown when a connection could not be openned. |
DuplicatedPrimaryKeyException | Thrown when a primary key or unique index constraint fails. |
ConstraintViolationException | Thrown if a constraint is violated. |
Executes the command.
public IDataReader ExecuteReader(command)
An IDataReader with command result.
Name | Type | Summary |
---|---|---|
command | IDbCommand | A SQLiteCommand to execute. |
Type | Summary |
---|---|
DataAccessException | Thrown when an unindentify error occurs. |
InvalidOperationException | Thrown when the database connection is not open. |
Asyncronously executes the command.
public Task<IDataReader> ExecuteReaderAsync(command)
An IDataReader with command result.
Name | Type | Summary |
---|---|---|
command | IDbCommand | A SQLiteCommand to execute. |
Type | Summary |
---|---|
DataAccessException | Thrown when an unindentify error occurs. |
InvalidOperationException | Thrown when the database connection is not open. |
Executes the command and returns the first field of the first record.
public Object ExecuteScalar(command)
The value of the first field of the first record.
Name | Type | Summary |
---|---|---|
command | IDbCommand | An SQLiteCommand to execute. |
Type | Summary |
---|---|
DataAccessException | Thrown when an unindentify error occurs. |
OpenConnectionException | Thrown when a connection could not be openned. |
Asyncronously executes the command and returns the first field of the first record.
public Task<Object> ExecuteScalarAsync(command)
The value of the first field of the first record.
Name | Type | Summary |
---|---|---|
command | IDbCommand | An SQLiteCommand to execute. |
Type | Summary |
---|---|
DataAccessException | Thrown when an unindentify error occurs. |
OpenConnectionException | Thrown when a connection could not be openned. |
Ejecutes the underlaying connection GetSchema() method.
public DataTable GetSchema()
A DataTable as obtained from the GetSchema() method.
Type | Summary |
---|---|
DataAccessException | Thrown when an unindentify error occurs. |
Ejecutes the underlaying connection GetSchema() method.
public DataTable GetSchema(collectionName)
A DataTable as obtained from the GetSchema() method.
Name | Type | Summary |
---|---|---|
collectionName | String | The name of the collection to retrieve. |
Type | Summary |
---|---|
DataAccessException | Thrown when an unindentify error occurs. |
Ejecutes the underlaying connection GetSchema() method.
public DataTable GetSchema(collectionName, restrictionValues)
A DataTable as obtained from the GetSchema() method.
Name | Type | Summary |
---|---|---|
collectionName | String | The name of the collection to retrieve. |
restrictionValues | String[] | A set of restriction values. |
Type | Summary |
---|---|
DataAccessException | Thrown when an unindentify error occurs. |
Gets the server version.
public String GetServerVersion()
The version of the SQLite NuGet package.
Opens a connection.
public Void OpenConnection()
Type | Summary |
---|---|
OpenConnectionException | Thrown when the connection could'nt be openned. |
Opens a connection asyncronously.
public Task OpenConnectionAsync()
Type | Summary |
---|---|
OpenConnectionException | Thrown when the connection could'nt be openned. |
Aborts the current transaction.
public Void RollbackTransaction()
In this document