Index: Doc/Extra/version.html
==================================================================
--- Doc/Extra/version.html
+++ Doc/Extra/version.html
@@ -48,10 +48,11 @@
Updated to SQLite 3.8.1.
Use declared column sizes for the AnsiStringFixedLength and StringFixedLength mapped database types. Fix for [3113734605].
Check the result of sqlite3_column_name function against NULL.
Return false for the SQLiteParameterCollection.IsSynchronized property because it is not thread-safe.
Raise the static SQLiteConnection.Changed event when any SQLiteCommand, SQLiteDataReader, or CriticalHandle derived object instance is created. Fix for [aba4549801].
+ Add SQLiteCommand.Execute, SQLiteCommand.ExecuteNonQuery, and SQLiteCommand.ExecuteScalar method overloads that take a CommandBehavior parameter.
Revise how the extra object data is passed to the static SQLiteConnection.Changed event. ** Potentially Incompatible Change **
Include the XML documentation files in the NuGet packages. Fix for [5970d5b0a6].
1.0.88.0 - August 7, 2013
Index: System.Data.SQLite/SQLiteCommand.cs
==================================================================
--- System.Data.SQLite/SQLiteCommand.cs
+++ System.Data.SQLite/SQLiteCommand.cs
@@ -22,12 +22,14 @@
#endif
public sealed class SQLiteCommand : DbCommand, ICloneable
{
///
/// The default connection string to be used when creating a temporary
- /// connection to execute a command via the static
- /// method.
+ /// connection to execute a command via the static
+ /// or
+ ///
+ /// methods.
///
private static readonly string DefaultConnectionString = "Data Source=:memory:;";
///
/// The command text this command is based on
@@ -690,10 +692,52 @@
string commandText,
SQLiteExecuteType executeType,
string connectionString,
params object[] args
)
+ {
+ return Execute(
+ commandText, executeType, CommandBehavior.Default,
+ connectionString, args);
+ }
+
+ ///
+ /// This method creates a new connection, executes the query using the given
+ /// execution type and command behavior, closes the connection, and returns
+ /// the results. If the connection string is null, a temporary in-memory
+ /// database connection will be used.
+ ///
+ ///
+ /// The text of the command to be executed.
+ ///
+ ///
+ /// The execution type for the command. This is used to determine which method
+ /// of the command object to call, which then determines the type of results
+ /// returned, if any.
+ ///
+ ///
+ /// The command behavior flags for the command.
+ ///
+ ///
+ /// The connection string to the database to be opened, used, and closed. If
+ /// this parameter is null, a temporary in-memory databse will be used.
+ ///
+ ///
+ /// The SQL parameter values to be used when building the command object to be
+ /// executed, if any.
+ ///
+ ///
+ /// The results of the query -OR- null if no results were produced from the
+ /// given execution type.
+ ///
+ public static object Execute(
+ string commandText,
+ SQLiteExecuteType executeType,
+ CommandBehavior commandBehavior,
+ string connectionString,
+ params object[] args
+ )
{
if (connectionString == null)
connectionString = DefaultConnectionString;
using (SQLiteConnection connection = new SQLiteConnection(connectionString))
@@ -724,19 +768,19 @@
//
break;
}
case SQLiteExecuteType.NonQuery:
{
- return command.ExecuteNonQuery();
+ return command.ExecuteNonQuery(commandBehavior);
}
case SQLiteExecuteType.Scalar:
{
- return command.ExecuteScalar();
+ return command.ExecuteScalar(commandBehavior);
}
case SQLiteExecuteType.Reader:
{
- return command.ExecuteReader();
+ return command.ExecuteReader(commandBehavior);
}
}
}
}
@@ -744,11 +788,11 @@
}
///
/// Overrides the default behavior to return a SQLiteDataReader specialization class
///
- /// The flags to be associated with the reader
+ /// The flags to be associated with the reader.
/// A SQLiteDataReader
public new SQLiteDataReader ExecuteReader(CommandBehavior behavior)
{
CheckDisposed();
SQLiteConnection.Check(_cnn);
@@ -780,17 +824,32 @@
}
///
/// Execute the command and return the number of rows inserted/updated affected by it.
///
- ///
+ /// The number of rows inserted/updated affected by it.
public override int ExecuteNonQuery()
+ {
+ CheckDisposed();
+ SQLiteConnection.Check(_cnn);
+ return ExecuteNonQuery(CommandBehavior.Default);
+ }
+
+ ///
+ /// Execute the command and return the number of rows inserted/updated affected by it.
+ ///
+ /// The flags to be associated with the reader.
+ /// The number of rows inserted/updated affected by it.
+ public int ExecuteNonQuery(
+ CommandBehavior behavior
+ )
{
CheckDisposed();
SQLiteConnection.Check(_cnn);
- using (SQLiteDataReader reader = ExecuteReader(CommandBehavior.SingleRow | CommandBehavior.SingleResult))
+ using (SQLiteDataReader reader = ExecuteReader(behavior |
+ CommandBehavior.SingleRow | CommandBehavior.SingleResult))
{
while (reader.NextResult()) ;
return reader.RecordsAffected;
}
}
@@ -797,17 +856,33 @@
///
/// Execute the command and return the first column of the first row of the resultset
/// (if present), or null if no resultset was returned.
///
- /// The first column of the first row of the first resultset from the query
+ /// The first column of the first row of the first resultset from the query.
public override object ExecuteScalar()
{
CheckDisposed();
SQLiteConnection.Check(_cnn);
+ return ExecuteScalar(CommandBehavior.Default);
+ }
+
+ ///
+ /// Execute the command and return the first column of the first row of the resultset
+ /// (if present), or null if no resultset was returned.
+ ///
+ /// The flags to be associated with the reader.
+ /// The first column of the first row of the first resultset from the query.
+ public object ExecuteScalar(
+ CommandBehavior behavior
+ )
+ {
+ CheckDisposed();
+ SQLiteConnection.Check(_cnn);
- using (SQLiteDataReader reader = ExecuteReader(CommandBehavior.SingleRow | CommandBehavior.SingleResult))
+ using (SQLiteDataReader reader = ExecuteReader(behavior |
+ CommandBehavior.SingleRow | CommandBehavior.SingleResult))
{
if (reader.Read())
return reader[0];
}
return null;
Index: System.Data.SQLite/SQLiteConvert.cs
==================================================================
--- System.Data.SQLite/SQLiteConvert.cs
+++ System.Data.SQLite/SQLiteConvert.cs
@@ -1472,25 +1472,29 @@
///
None = 0,
///
/// The command is not expected to return a result -OR- the result is not
- /// needed. The method will
- /// be called.
+ /// needed. The or
+ /// method
+ /// will be called.
///
NonQuery = 1,
///
/// The command is expected to return a scalar result -OR- the result should
- /// be limited to a scalar result. The
- /// method will be called.
+ /// be limited to a scalar result. The
+ /// or method will
+ /// be called.
///
Scalar = 2,
///
/// The command is expected to return result.
- /// The method will be called.
+ /// The or
+ /// method will
+ /// be called.
///
Reader = 3,
///
/// Use the default command execution type. Using this value is the same
Index: Tests/tkt-e06c4caff3.eagle
==================================================================
--- Tests/tkt-e06c4caff3.eagle
+++ Tests/tkt-e06c4caff3.eagle
@@ -31,11 +31,11 @@
cleanupDb $fileName
unset -nocomplain NaN db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} \
--returnCodes 1 -match regexp -result [string map [list \n \r\n]\
+-returnCodes 1 -match regexp -result [string map [list \n \r\n] \
{^System\.Data\.SQLite\.SQLiteException \(0x80004005\): constraint failed
t1\.x may not be NULL
.*$}]}
###############################################################################
Index: readme.htm
==================================================================
--- readme.htm
+++ readme.htm
@@ -193,10 +193,11 @@
- Updated to SQLite 3.8.1.
- Use declared column sizes for the AnsiStringFixedLength and StringFixedLength mapped database types. Fix for [3113734605].
- Check the result of sqlite3_column_name function against NULL.
- Return false for the SQLiteParameterCollection.IsSynchronized property because it is not thread-safe.
- Raise the static SQLiteConnection.Changed event when any SQLiteCommand, SQLiteDataReader, or CriticalHandle derived object instance is created. Fix for [aba4549801].
+ - Add SQLiteCommand.Execute, SQLiteCommand.ExecuteNonQuery, and SQLiteCommand.ExecuteScalar method overloads that take a CommandBehavior parameter.
- Revise how the extra object data is passed to the static SQLiteConnection.Changed event. ** Potentially Incompatible Change **
- Include the XML documentation files in the NuGet packages. Fix for [5970d5b0a6].
1.0.88.0 - August 7, 2013
Index: www/news.wiki
==================================================================
--- www/news.wiki
+++ www/news.wiki
@@ -9,10 +9,11 @@
Updated to [http://www.sqlite.org/src/info/trunk|SQLite 3.8.1].
Use declared column sizes for the AnsiStringFixedLength and StringFixedLength mapped database types. Fix for [3113734605].
Check the result of sqlite3_column_name function against NULL.
Return false for the SQLiteParameterCollection.IsSynchronized property because it is not thread-safe.
Raise the static SQLiteConnection.Changed event when any SQLiteCommand, SQLiteDataReader, or CriticalHandle derived object instance is created. Fix for [aba4549801].
+ Add SQLiteCommand.Execute, SQLiteCommand.ExecuteNonQuery, and SQLiteCommand.ExecuteScalar method overloads that take a CommandBehavior parameter.
Revise how the extra object data is passed to the static SQLiteConnection.Changed event. ** Potentially Incompatible Change **
Include the XML documentation files in the NuGet packages. Fix for [5970d5b0a6].
1.0.88.0 - August 7, 2013