diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..37fdc75 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,32 @@ +# NOTE: this file is for git 1.6.6 (and possibly older) +# Post-1.7.2 there is eol and text, and crlf is deprecated +# but we can't depend on an unreleased version... + +# This file mainly controls line ending conversion behaviour, if +# the user has the setting core.autocrlf true. + +# The meaning of the attributes is a little odd +# -crlf means DO NOT convert line endings +# crlf means CONVERT to lf in the repo & Linux/Mac, crlf on Windows + +# First, turn off git line ending handling except on a case-by-case basis +# because our repo isn't normalized, in general. +# There are even files with mixed line endings. +* -crlf + +# Auto detect text files and perform LF normalization +* text=auto + +# sln is always CRLF, even on linux, so don't convert +*.sln -crlf + +# These files can be converted, since they're new +.gitattributes crlf +.gitignore crlf + +# Having proj files as crlf on windows will make VS happier +# MD can deal with (and preserve) either, so it doesn't matter. +# Unfortunately MD creates with LF, so we need to convert these. +*proj crlf + +*.sh eol=lf diff --git a/Community.CsharpSqlite.Benchmark/Classes/SQLiteDatabase.cs b/Community.CsharpSqlite.Benchmark/Classes/SQLiteDatabase.cs index 39c65ab..53a90d2 100644 --- a/Community.CsharpSqlite.Benchmark/Classes/SQLiteDatabase.cs +++ b/Community.CsharpSqlite.Benchmark/Classes/SQLiteDatabase.cs @@ -1,313 +1,313 @@ -// $Header$ -using System; -using System.Collections; -using System.Data; - -namespace Community.CsharpSqlite -{ - - using sqlite = Sqlite3.sqlite3; - using Vdbe = Sqlite3.Vdbe; - /// - /// C#-SQLite wrapper with functions for opening, closing and executing queries. - /// - public class SQLiteDatabase - { - // pointer to database - private sqlite db; - - /// - /// Creates new instance of SQLiteBase class with no database attached. - /// - public SQLiteDatabase() - { - db = null; - } - /// - /// Creates new instance of SQLiteDatabase class and opens database with given name. - /// - /// Name (and path) to SQLite database file - public SQLiteDatabase( String DatabaseName ) - { - OpenDatabase( DatabaseName ); - } - - /// - /// Opens database. - /// - /// Name of database file - public void OpenDatabase( String DatabaseName ) - { - // opens database - if ( -#if NET_35 - Sqlite3.Open -#else -Sqlite3.sqlite3_open -#endif -( DatabaseName, out db ) != Sqlite3.SQLITE_OK ) - { - // if there is some error, database pointer is set to 0 and exception is throws - db = null; - throw new Exception( "Error with opening database " + DatabaseName + "!" ); - } - } - - /// - /// Closes opened database. - /// - public void CloseDatabase() - { - // closes the database if there is one opened - if ( db != null ) - { -#if NET_35 - Sqlite3.Close -#else -Sqlite3.sqlite3_close -#endif -( db ); - } - } - - /// - /// Returns connection - /// - public sqlite Connection() - { - return db; - } - - /// - /// Returns the list of tables in opened database. - /// - /// - public ArrayList GetTables() - { - // executes query that select names of all tables in master table of the database - String query = "SELECT name FROM sqlite_master " + - "WHERE type = 'table'" + - "ORDER BY 1"; - DataTable table = ExecuteQuery( query ); - - // Return all table names in the ArrayList - ArrayList list = new ArrayList(); - foreach ( DataRow row in table.Rows ) - { - list.Add( row.ItemArray[0].ToString() ); - } - return list; - } - - /// - /// Executes query that does not return anything (e.g. UPDATE, INSERT, DELETE). - /// - /// - public void ExecuteNonQuery( String query ) - { - // calles SQLite function that executes non-query - Sqlite3.exec( db, query, 0, 0, 0 ); - // if there is error, excetion is thrown - if ( db.errCode != Sqlite3.SQLITE_OK ) - throw new Exception( "Error with executing non-query: \"" + query + "\"!\n" + -#if NET_35 - Sqlite3.Errmsg -#else -Sqlite3.sqlite3_errmsg -#endif -( db ) ); - } - - /// - /// Executes query that does return something (e.g. SELECT). - /// - /// - /// - public DataTable ExecuteQuery( String query ) - { - // compiled query - SQLiteVdbe statement = new SQLiteVdbe( this, query ); - - // table for result of query - DataTable table = new DataTable(); - - // create new instance of DataTable with name "resultTable" - table = new DataTable( "resultTable" ); - - // reads rows - do { } while ( ReadNextRow( statement.VirtualMachine(), table ) == Sqlite3.SQLITE_ROW ); - // finalize executing this query - statement.Close(); - - // returns table - return table; - } - - // private function for reading rows and creating table and columns - private int ReadNextRow( Vdbe vm, DataTable table ) - { - int columnCount = table.Columns.Count; - if ( columnCount == 0 ) - { - if ( ( columnCount = ReadColumnNames( vm, table ) ) == 0 ) return Sqlite3.SQLITE_ERROR; - } - - int resultType; - if ( ( resultType = -#if NET_35 - Sqlite3.Step -#else -Sqlite3.sqlite3_step -#endif -( vm ) ) == Sqlite3.SQLITE_ROW ) - { - object[] columnValues = new object[columnCount]; - - for ( int i = 0; i < columnCount; i++ ) - { - int columnType = -#if NET_35 - Sqlite3.ColumnType -#else -Sqlite3.sqlite3_column_type -#endif -( vm, i ); - switch ( columnType ) - { - case Sqlite3.SQLITE_INTEGER: - { - table.Columns[i].DataType = typeof( Int64 ); - columnValues[i] = -#if NET_35 - Sqlite3.ColumnInt -#else -Sqlite3.sqlite3_column_int -#endif -( vm, i ); - break; - } - case Sqlite3.SQLITE_FLOAT: - { - table.Columns[i].DataType = typeof( Double ); - columnValues[i] = -#if NET_35 - Sqlite3.ColumnDouble -#else -Sqlite3.sqlite3_column_double -#endif -( vm, i ); - break; - } - case Sqlite3.SQLITE_TEXT: - { - table.Columns[i].DataType = typeof( String ); - columnValues[i] = -#if NET_35 - Sqlite3.ColumnText -#else -Sqlite3.sqlite3_column_text -#endif -( vm, i ); - break; - } - case Sqlite3.SQLITE_BLOB: - { - table.Columns[i].DataType = typeof( Byte[] ); - columnValues[i] = -#if NET_35 - Sqlite3.ColumnBlob -#else -Sqlite3.sqlite3_column_blob -#endif -( vm, i ); - break; - } - default: - { - table.Columns[i].DataType = null; - columnValues[i] = ""; - break; - } - } - } - table.Rows.Add( columnValues ); - } - return resultType; - } - // private function for creating Column Names - // Return number of colums read - private int ReadColumnNames( Vdbe vm, DataTable table ) - { - - String columnName = ""; - int columnType = 0; - // returns number of columns returned by statement - int columnCount = -#if NET_35 - Sqlite3.ColumnCount -#else -Sqlite3.sqlite3_column_count -#endif -( vm ); - object[] columnValues = new object[columnCount]; - - try - { - // reads columns one by one - for ( int i = 0; i < columnCount; i++ ) - { - columnName = -#if NET_35 - Sqlite3.ColumnName -#else -Sqlite3.sqlite3_column_name -#endif -( vm, i ); - columnType = -#if NET_35 - Sqlite3.ColumnType -#else -Sqlite3.sqlite3_column_type -#endif -( vm, i ); - - switch ( columnType ) - { - case Sqlite3.SQLITE_INTEGER: - { - // adds new integer column to table - table.Columns.Add( columnName, Type.GetType( "System.Int64" ) ); - break; - } - case Sqlite3.SQLITE_FLOAT: - { - table.Columns.Add( columnName, Type.GetType( "System.Double" ) ); - break; - } - case Sqlite3.SQLITE_TEXT: - { - table.Columns.Add( columnName, Type.GetType( "System.String" ) ); - break; - } - case Sqlite3.SQLITE_BLOB: - { - table.Columns.Add( columnName, Type.GetType( "System.byte[]" ) ); - break; - } - default: - { - table.Columns.Add( columnName, Type.GetType( "System.String" ) ); - break; - } - } - } - } - catch - { - return 0; - } - return table.Columns.Count; - } - - } -} +// $Header$ +using System; +using System.Collections; +using System.Data; + +namespace Community.CsharpSqlite +{ + + using sqlite = Sqlite3.sqlite3; + using Vdbe = Sqlite3.Vdbe; + /// + /// C#-SQLite wrapper with functions for opening, closing and executing queries. + /// + public class SQLiteDatabase + { + // pointer to database + private sqlite db; + + /// + /// Creates new instance of SQLiteBase class with no database attached. + /// + public SQLiteDatabase() + { + db = null; + } + /// + /// Creates new instance of SQLiteDatabase class and opens database with given name. + /// + /// Name (and path) to SQLite database file + public SQLiteDatabase( String DatabaseName ) + { + OpenDatabase( DatabaseName ); + } + + /// + /// Opens database. + /// + /// Name of database file + public void OpenDatabase( String DatabaseName ) + { + // opens database + if ( +#if NET_35 + Sqlite3.Open +#else +Sqlite3.sqlite3_open +#endif +( DatabaseName, out db ) != Sqlite3.SQLITE_OK ) + { + // if there is some error, database pointer is set to 0 and exception is throws + db = null; + throw new Exception( "Error with opening database " + DatabaseName + "!" ); + } + } + + /// + /// Closes opened database. + /// + public void CloseDatabase() + { + // closes the database if there is one opened + if ( db != null ) + { +#if NET_35 + Sqlite3.Close +#else +Sqlite3.sqlite3_close +#endif +( db ); + } + } + + /// + /// Returns connection + /// + public sqlite Connection() + { + return db; + } + + /// + /// Returns the list of tables in opened database. + /// + /// + public ArrayList GetTables() + { + // executes query that select names of all tables in master table of the database + String query = "SELECT name FROM sqlite_master " + + "WHERE type = 'table'" + + "ORDER BY 1"; + DataTable table = ExecuteQuery( query ); + + // Return all table names in the ArrayList + ArrayList list = new ArrayList(); + foreach ( DataRow row in table.Rows ) + { + list.Add( row.ItemArray[0].ToString() ); + } + return list; + } + + /// + /// Executes query that does not return anything (e.g. UPDATE, INSERT, DELETE). + /// + /// + public void ExecuteNonQuery( String query ) + { + // calles SQLite function that executes non-query + Sqlite3.exec( db, query, 0, 0, 0 ); + // if there is error, excetion is thrown + if ( db.errCode != Sqlite3.SQLITE_OK ) + throw new Exception( "Error with executing non-query: \"" + query + "\"!\n" + +#if NET_35 + Sqlite3.Errmsg +#else +Sqlite3.sqlite3_errmsg +#endif +( db ) ); + } + + /// + /// Executes query that does return something (e.g. SELECT). + /// + /// + /// + public DataTable ExecuteQuery( String query ) + { + // compiled query + SQLiteVdbe statement = new SQLiteVdbe( this, query ); + + // table for result of query + DataTable table = new DataTable(); + + // create new instance of DataTable with name "resultTable" + table = new DataTable( "resultTable" ); + + // reads rows + do { } while ( ReadNextRow( statement.VirtualMachine(), table ) == Sqlite3.SQLITE_ROW ); + // finalize executing this query + statement.Close(); + + // returns table + return table; + } + + // private function for reading rows and creating table and columns + private int ReadNextRow( Vdbe vm, DataTable table ) + { + int columnCount = table.Columns.Count; + if ( columnCount == 0 ) + { + if ( ( columnCount = ReadColumnNames( vm, table ) ) == 0 ) return Sqlite3.SQLITE_ERROR; + } + + int resultType; + if ( ( resultType = +#if NET_35 + Sqlite3.Step +#else +Sqlite3.sqlite3_step +#endif +( vm ) ) == Sqlite3.SQLITE_ROW ) + { + object[] columnValues = new object[columnCount]; + + for ( int i = 0; i < columnCount; i++ ) + { + int columnType = +#if NET_35 + Sqlite3.ColumnType +#else +Sqlite3.sqlite3_column_type +#endif +( vm, i ); + switch ( columnType ) + { + case Sqlite3.SQLITE_INTEGER: + { + table.Columns[i].DataType = typeof( Int64 ); + columnValues[i] = +#if NET_35 + Sqlite3.ColumnInt +#else +Sqlite3.sqlite3_column_int +#endif +( vm, i ); + break; + } + case Sqlite3.SQLITE_FLOAT: + { + table.Columns[i].DataType = typeof( Double ); + columnValues[i] = +#if NET_35 + Sqlite3.ColumnDouble +#else +Sqlite3.sqlite3_column_double +#endif +( vm, i ); + break; + } + case Sqlite3.SQLITE_TEXT: + { + table.Columns[i].DataType = typeof( String ); + columnValues[i] = +#if NET_35 + Sqlite3.ColumnText +#else +Sqlite3.sqlite3_column_text +#endif +( vm, i ); + break; + } + case Sqlite3.SQLITE_BLOB: + { + table.Columns[i].DataType = typeof( Byte[] ); + columnValues[i] = +#if NET_35 + Sqlite3.ColumnBlob +#else +Sqlite3.sqlite3_column_blob +#endif +( vm, i ); + break; + } + default: + { + table.Columns[i].DataType = null; + columnValues[i] = ""; + break; + } + } + } + table.Rows.Add( columnValues ); + } + return resultType; + } + // private function for creating Column Names + // Return number of colums read + private int ReadColumnNames( Vdbe vm, DataTable table ) + { + + String columnName = ""; + int columnType = 0; + // returns number of columns returned by statement + int columnCount = +#if NET_35 + Sqlite3.ColumnCount +#else +Sqlite3.sqlite3_column_count +#endif +( vm ); + object[] columnValues = new object[columnCount]; + + try + { + // reads columns one by one + for ( int i = 0; i < columnCount; i++ ) + { + columnName = +#if NET_35 + Sqlite3.ColumnName +#else +Sqlite3.sqlite3_column_name +#endif +( vm, i ); + columnType = +#if NET_35 + Sqlite3.ColumnType +#else +Sqlite3.sqlite3_column_type +#endif +( vm, i ); + + switch ( columnType ) + { + case Sqlite3.SQLITE_INTEGER: + { + // adds new integer column to table + table.Columns.Add( columnName, Type.GetType( "System.Int64" ) ); + break; + } + case Sqlite3.SQLITE_FLOAT: + { + table.Columns.Add( columnName, Type.GetType( "System.Double" ) ); + break; + } + case Sqlite3.SQLITE_TEXT: + { + table.Columns.Add( columnName, Type.GetType( "System.String" ) ); + break; + } + case Sqlite3.SQLITE_BLOB: + { + table.Columns.Add( columnName, Type.GetType( "System.byte[]" ) ); + break; + } + default: + { + table.Columns.Add( columnName, Type.GetType( "System.String" ) ); + break; + } + } + } + } + catch + { + return 0; + } + return table.Columns.Count; + } + + } +} diff --git a/Community.CsharpSqlite.Benchmark/Classes/SQLiteVdbe.cs b/Community.CsharpSqlite.Benchmark/Classes/SQLiteVdbe.cs index 7b225e6..2972379 100644 --- a/Community.CsharpSqlite.Benchmark/Classes/SQLiteVdbe.cs +++ b/Community.CsharpSqlite.Benchmark/Classes/SQLiteVdbe.cs @@ -1,210 +1,210 @@ -// $Header$ -using System; - -namespace Community.CsharpSqlite -{ - - using Vdbe = Sqlite3.Vdbe; - - /// - /// C#-SQLite wrapper with functions for opening, closing and executing queries. - /// - public class SQLiteVdbe - { - private Vdbe vm = null; - private string LastError = ""; - private int LastResult = 0; - - /// - /// Creates new instance of SQLiteVdbe class by compiling a statement - /// - /// - /// Vdbe - public SQLiteVdbe( SQLiteDatabase db, String query ) - { - vm = null; - - // prepare and compile -#if NET_35 - Sqlite3.PrepareV2NoTail -#else -Sqlite3.sqlite3_prepare_v2 -#endif -( db.Connection(), query, query.Length, ref vm, 0 ); - } - - /// - /// Return Virtual Machine Pointer - /// - /// - /// Vdbe - public Vdbe VirtualMachine() - { - return vm; - } - - /// - /// - /// BindInteger - /// - /// - /// - /// LastResult - public int BindInteger( int index, int bInteger ) - { - if ( ( LastResult = -#if NET_35 - Sqlite3.BindInt -#else -Sqlite3.sqlite3_bind_int -#endif -( vm, index, bInteger ) ) == Sqlite3.SQLITE_OK ) - { LastError = ""; } - else - { - LastError = "Error " + LastError + "binding Integer [" + bInteger + "]"; - } - return LastResult; - } - - /// - /// - /// BindLong - /// - /// - /// - /// LastResult - public int BindLong( int index, long bLong ) - { - if ( ( LastResult = -#if NET_35 - Sqlite3.BindInt64 -#else -Sqlite3.sqlite3_bind_int64 -#endif -( vm, index, bLong ) ) == Sqlite3.SQLITE_OK ) - { LastError = ""; } - else - { - LastError = "Error " + LastError + "binding Long [" + bLong + "]"; - } - return LastResult; - } - - /// - /// BindText - /// - /// - /// - /// LastResult - public int BindText( int index, string bText ) - { - if ( ( LastResult = -#if NET_35 - Sqlite3.BindText -#else -Sqlite3.sqlite3_bind_text -#endif -( vm, index, bText, -1, null ) ) == Sqlite3.SQLITE_OK ) - { LastError = ""; } - else - { - LastError = "Error " + LastError + "binding Text [" + bText + "]"; - } - return LastResult; - } - - /// - /// Execute statement - /// - /// - /// LastResult - public int ExecuteStep() - { - // Execute the statement - int LastResult = -#if NET_35 - Sqlite3.Step -#else -Sqlite3.sqlite3_step -#endif -( vm ); - return LastResult; - } - - /// - /// Returns Result column as Long - /// - /// - /// Result column - public long Result_Long( int index ) - { - return -#if NET_35 - Sqlite3.ColumnInt64 -#else -Sqlite3.sqlite3_column_int64 -#endif -( vm, index ); - } - - /// - /// Returns Result column as Text - /// - /// - /// Result column - public string Result_Text( int index ) - { - return -#if NET_35 - Sqlite3.ColumnText -#else -Sqlite3.sqlite3_column_text -#endif -( vm, index ); - } - - - /// - /// Returns Count of Result Rows - /// - /// - /// Count of Results - public int ResultColumnCount() - { - return vm.pResultSet == null ? 0 : vm.pResultSet.Length; - } - - /// - /// Reset statement - /// - /// - /// - public void Reset() - { - // Reset the statment so it's ready to use again -#if NET_35 - Sqlite3.Reset -#else -Sqlite3.sqlite3_reset -#endif -( vm ); - } - - /// - /// Closes statement - /// - /// - /// LastResult - public void Close() - { -#if NET_35 - Sqlite3.Finalize -#else -Sqlite3.sqlite3_finalize -#endif -( vm ); - } - - } -} +// $Header$ +using System; + +namespace Community.CsharpSqlite +{ + + using Vdbe = Sqlite3.Vdbe; + + /// + /// C#-SQLite wrapper with functions for opening, closing and executing queries. + /// + public class SQLiteVdbe + { + private Vdbe vm = null; + private string LastError = ""; + private int LastResult = 0; + + /// + /// Creates new instance of SQLiteVdbe class by compiling a statement + /// + /// + /// Vdbe + public SQLiteVdbe( SQLiteDatabase db, String query ) + { + vm = null; + + // prepare and compile +#if NET_35 + Sqlite3.PrepareV2NoTail +#else +Sqlite3.sqlite3_prepare_v2 +#endif +( db.Connection(), query, query.Length, ref vm, 0 ); + } + + /// + /// Return Virtual Machine Pointer + /// + /// + /// Vdbe + public Vdbe VirtualMachine() + { + return vm; + } + + /// + /// + /// BindInteger + /// + /// + /// + /// LastResult + public int BindInteger( int index, int bInteger ) + { + if ( ( LastResult = +#if NET_35 + Sqlite3.BindInt +#else +Sqlite3.sqlite3_bind_int +#endif +( vm, index, bInteger ) ) == Sqlite3.SQLITE_OK ) + { LastError = ""; } + else + { + LastError = "Error " + LastError + "binding Integer [" + bInteger + "]"; + } + return LastResult; + } + + /// + /// + /// BindLong + /// + /// + /// + /// LastResult + public int BindLong( int index, long bLong ) + { + if ( ( LastResult = +#if NET_35 + Sqlite3.BindInt64 +#else +Sqlite3.sqlite3_bind_int64 +#endif +( vm, index, bLong ) ) == Sqlite3.SQLITE_OK ) + { LastError = ""; } + else + { + LastError = "Error " + LastError + "binding Long [" + bLong + "]"; + } + return LastResult; + } + + /// + /// BindText + /// + /// + /// + /// LastResult + public int BindText( int index, string bText ) + { + if ( ( LastResult = +#if NET_35 + Sqlite3.BindText +#else +Sqlite3.sqlite3_bind_text +#endif +( vm, index, bText, -1, null ) ) == Sqlite3.SQLITE_OK ) + { LastError = ""; } + else + { + LastError = "Error " + LastError + "binding Text [" + bText + "]"; + } + return LastResult; + } + + /// + /// Execute statement + /// + /// + /// LastResult + public int ExecuteStep() + { + // Execute the statement + int LastResult = +#if NET_35 + Sqlite3.Step +#else +Sqlite3.sqlite3_step +#endif +( vm ); + return LastResult; + } + + /// + /// Returns Result column as Long + /// + /// + /// Result column + public long Result_Long( int index ) + { + return +#if NET_35 + Sqlite3.ColumnInt64 +#else +Sqlite3.sqlite3_column_int64 +#endif +( vm, index ); + } + + /// + /// Returns Result column as Text + /// + /// + /// Result column + public string Result_Text( int index ) + { + return +#if NET_35 + Sqlite3.ColumnText +#else +Sqlite3.sqlite3_column_text +#endif +( vm, index ); + } + + + /// + /// Returns Count of Result Rows + /// + /// + /// Count of Results + public int ResultColumnCount() + { + return vm.pResultSet == null ? 0 : vm.pResultSet.Length; + } + + /// + /// Reset statement + /// + /// + /// + public void Reset() + { + // Reset the statment so it's ready to use again +#if NET_35 + Sqlite3.Reset +#else +Sqlite3.sqlite3_reset +#endif +( vm ); + } + + /// + /// Closes statement + /// + /// + /// LastResult + public void Close() + { +#if NET_35 + Sqlite3.Finalize +#else +Sqlite3.sqlite3_finalize +#endif +( vm ); + } + + } +} diff --git a/Community.CsharpSqlite.Benchmark/Community.CsharpSqlite.Benchmark.csproj b/Community.CsharpSqlite.Benchmark/Community.CsharpSqlite.Benchmark.csproj index ae0b75b..23ed038 100644 --- a/Community.CsharpSqlite.Benchmark/Community.CsharpSqlite.Benchmark.csproj +++ b/Community.CsharpSqlite.Benchmark/Community.CsharpSqlite.Benchmark.csproj @@ -1,391 +1,391 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F1653F20-D47D-4F29-8C55-3C835542AF5F} - Exe - Properties - Benchmark - Benchmark - Benchmark - - - 3.5 - - - false - v3.5 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - true - full - false - bin\Debug\ - NET_35 NO_TCL NDEBUG TRUE WIN32 _MSC_VER SQLITE_ASCII SQLITE_DISABLE_LFS SQLITE_MUTEX_OMIT SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_UTF16 SQLITE_OMIT_VIRTUALTABLE SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF SQLITE_POOL_MEM - prompt - 4 - 0168 ; 0169; 0414; 0618; 0649 - x86 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - NET_35 NO_TCL NDEBUG TRUE WIN32 _MSC_VER SQLITE_ASCII SQLITE_DISABLE_LFS SQLITE_HAS_CODEC SQLITE_MUTEX_OMIT SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_TRACE SQLITE_OMIT_UTF16 SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF SQLITE_POOL_MEM - prompt - 4 - AnyCPU - 0168 ; 0169; 0414; 0618; 0649 - AllRules.ruleset - - - true - bin\x86\Debug\ - NET_35 NO_TCL NDEBUG TRUE WIN32 _MSC_VER SQLITE_ASCII SQLITE_DISABLE_LFS SQLITE_MUTEX_OMIT SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_UTF16 SQLITE_OMIT_VIRTUALTABLE SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF SQLITE_POOL_MEM - 0168 ; 0169; 0414; 0618; 0649 - full - x86 - prompt - AllRules.ruleset - false - - - bin\x86\Release\ - NO_TCL NDEBUG TRUE WIN32 _MSC_VER SQLITE_ASCII SQLITE_DISABLE_LFS SQLITE_MUTEX_OMIT SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_TRACE SQLITE_OMIT_UTF16 SQLITE_OMIT_VIRTUALTABLE SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF SQLITE_POOL_MEM - true - 0168 ; 0169; 0414; 0618; 0649 - pdbonly - x86 - prompt - AllRules.ruleset - - - - - 3.5 - - - - - - - - - Community.CsharpSqlite\alter_c.cs - - - Community.CsharpSqlite\analyze_c.cs - - - Community.CsharpSqlite\attach_c.cs - - - Community.CsharpSqlite\auth_c.cs - - - Community.CsharpSqlite\backup_c.cs - - - Community.CsharpSqlite\bitvec_c.cs - - - Community.CsharpSqlite\btmutex_c.cs - - - Community.CsharpSqlite\BtreeInt_h.cs - - - Community.CsharpSqlite\btree_c.cs - - - Community.CsharpSqlite\Btree_h.cs - - - Community.CsharpSqlite\build_c.cs - - - Community.CsharpSqlite\callback_c.cs - - - Community.CsharpSqlite\complete_c.cs - - - Community.CsharpSqlite\crypto.cs - - - Community.CsharpSqlite\ctime_c.cs - - - Community.CsharpSqlite\date_c.cs - - - Community.CsharpSqlite\Delegates.cs - - - Community.CsharpSqlite\delete_c.cs - - - Community.CsharpSqlite\expr_c.cs - - - Community.CsharpSqlite\fault_c.cs - - - Community.CsharpSqlite\fkey_c.cs - - - Community.CsharpSqlite\func_c.cs - - - Community.CsharpSqlite\global_c.cs - - - Community.CsharpSqlite\hash_c.cs - - - Community.CsharpSqlite\Hash_h.cs - - - Community.CsharpSqlite\hwtime_c.cs - - - Community.CsharpSqlite\insert_c.cs - - - Community.CsharpSqlite\journal_c.cs - - - Community.CsharpSqlite\keywordhash_h.cs - - - Community.CsharpSqlite\legacy_c.cs - - - Community.CsharpSqlite\loadext_c.cs - - - Community.CsharpSqlite\main_c.cs - - - Community.CsharpSqlite\malloc_c.cs - - - Community.CsharpSqlite\memjournal_c.cs - - - Community.CsharpSqlite\mem_Pool.cs - - - Community.CsharpSqlite\mutex_c.cs - - - Community.CsharpSqlite\mutex_h.cs - - - Community.CsharpSqlite\mutex_noop_c.cs - - - Community.CsharpSqlite\mutex_w32.cs - - - Community.CsharpSqlite\notify_c.cs - - - Community.CsharpSqlite\opcodes_c.cs - - - Community.CsharpSqlite\opcodes_h.cs - - - Community.CsharpSqlite\os_c.cs - - - Community.CsharpSqlite\os_common_h.cs - - - Community.CsharpSqlite\os_h.cs - - - Community.CsharpSqlite\os_win_c.cs - - - Community.CsharpSqlite\pager_c.cs - - - Community.CsharpSqlite\pager_h.cs - - - Community.CsharpSqlite\parse_c.cs - - - Community.CsharpSqlite\parse_h.cs - - - Community.CsharpSqlite\pcache1_c.cs - - - Community.CsharpSqlite\pcache_c.cs - - - Community.CsharpSqlite\pcache_h.cs - - - Community.CsharpSqlite\pragma_c.cs - - - Community.CsharpSqlite\prepare_c.cs - - - Community.CsharpSqlite\printf_c.cs - - - Community.CsharpSqlite\random_c.cs - - - Community.CsharpSqlite\resolve_c.cs - - - Community.CsharpSqlite\rowset_c.cs - - - Community.CsharpSqlite\select_c.cs - - - Community.CsharpSqlite\sqlite3_h.cs - - - Community.CsharpSqlite\sqliteInt_h.cs - - - Community.CsharpSqlite\sqliteLimit_h.cs - - - Community.CsharpSqlite\status_c.cs - - - Community.CsharpSqlite\table_c.cs - - - Community.CsharpSqlite\tokenize_c.cs - - - Community.CsharpSqlite\trigger_c.cs - - - Community.CsharpSqlite\update_c.cs - - - Community.CsharpSqlite\utf_c.cs - - - Community.CsharpSqlite\util_c.cs - - - Community.CsharpSqlite\vacuum_c.cs - - - Community.CsharpSqlite\vdbeapi_c.cs - - - Community.CsharpSqlite\vdbeaux_c.cs - - - Community.CsharpSqlite\vdbeblob_c.cs - - - Community.CsharpSqlite\VdbeInt_h.cs - - - Community.CsharpSqlite\vdbemem_c.cs - - - Community.CsharpSqlite\vdbetrace_c.cs - - - Community.CsharpSqlite\vdbe_c.cs - - - Community.CsharpSqlite\Vdbe_h.cs - - - Community.CsharpSqlite\vtab_c.cs - - - Community.CsharpSqlite\walker_c.cs - - - Community.CsharpSqlite\wal_c.cs - - - Community.CsharpSqlite\wal_h.cs - - - Community.CsharpSqlite\where_c.cs - - - Community.CsharpSqlite\_Custom.cs - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 2.0 %28x86%29 - true - - - False - .NET Framework 3.0 %28x86%29 - false - - - False - .NET Framework 3.5 - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Microsoft Visual Basic PowerPacks 10.0 - true - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F1653F20-D47D-4F29-8C55-3C835542AF5F} + Exe + Properties + Benchmark + Benchmark + Benchmark + + + 3.5 + + + false + v3.5 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + true + full + false + bin\Debug\ + NET_35 NO_TCL NDEBUG TRUE WIN32 _MSC_VER SQLITE_ASCII SQLITE_DISABLE_LFS SQLITE_MUTEX_OMIT SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_UTF16 SQLITE_OMIT_VIRTUALTABLE SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF SQLITE_POOL_MEM + prompt + 4 + 0168 ; 0169; 0414; 0618; 0649 + x86 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + NET_35 NO_TCL NDEBUG TRUE WIN32 _MSC_VER SQLITE_ASCII SQLITE_DISABLE_LFS SQLITE_HAS_CODEC SQLITE_MUTEX_OMIT SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_TRACE SQLITE_OMIT_UTF16 SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF SQLITE_POOL_MEM + prompt + 4 + AnyCPU + 0168 ; 0169; 0414; 0618; 0649 + AllRules.ruleset + + + true + bin\x86\Debug\ + NET_35 NO_TCL NDEBUG TRUE WIN32 _MSC_VER SQLITE_ASCII SQLITE_DISABLE_LFS SQLITE_MUTEX_OMIT SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_UTF16 SQLITE_OMIT_VIRTUALTABLE SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF SQLITE_POOL_MEM + 0168 ; 0169; 0414; 0618; 0649 + full + x86 + prompt + AllRules.ruleset + false + + + bin\x86\Release\ + NO_TCL NDEBUG TRUE WIN32 _MSC_VER SQLITE_ASCII SQLITE_DISABLE_LFS SQLITE_MUTEX_OMIT SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_TRACE SQLITE_OMIT_UTF16 SQLITE_OMIT_VIRTUALTABLE SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF SQLITE_POOL_MEM + true + 0168 ; 0169; 0414; 0618; 0649 + pdbonly + x86 + prompt + AllRules.ruleset + + + + + 3.5 + + + + + + + + + Community.CsharpSqlite\alter_c.cs + + + Community.CsharpSqlite\analyze_c.cs + + + Community.CsharpSqlite\attach_c.cs + + + Community.CsharpSqlite\auth_c.cs + + + Community.CsharpSqlite\backup_c.cs + + + Community.CsharpSqlite\bitvec_c.cs + + + Community.CsharpSqlite\btmutex_c.cs + + + Community.CsharpSqlite\BtreeInt_h.cs + + + Community.CsharpSqlite\btree_c.cs + + + Community.CsharpSqlite\Btree_h.cs + + + Community.CsharpSqlite\build_c.cs + + + Community.CsharpSqlite\callback_c.cs + + + Community.CsharpSqlite\complete_c.cs + + + Community.CsharpSqlite\crypto.cs + + + Community.CsharpSqlite\ctime_c.cs + + + Community.CsharpSqlite\date_c.cs + + + Community.CsharpSqlite\Delegates.cs + + + Community.CsharpSqlite\delete_c.cs + + + Community.CsharpSqlite\expr_c.cs + + + Community.CsharpSqlite\fault_c.cs + + + Community.CsharpSqlite\fkey_c.cs + + + Community.CsharpSqlite\func_c.cs + + + Community.CsharpSqlite\global_c.cs + + + Community.CsharpSqlite\hash_c.cs + + + Community.CsharpSqlite\Hash_h.cs + + + Community.CsharpSqlite\hwtime_c.cs + + + Community.CsharpSqlite\insert_c.cs + + + Community.CsharpSqlite\journal_c.cs + + + Community.CsharpSqlite\keywordhash_h.cs + + + Community.CsharpSqlite\legacy_c.cs + + + Community.CsharpSqlite\loadext_c.cs + + + Community.CsharpSqlite\main_c.cs + + + Community.CsharpSqlite\malloc_c.cs + + + Community.CsharpSqlite\memjournal_c.cs + + + Community.CsharpSqlite\mem_Pool.cs + + + Community.CsharpSqlite\mutex_c.cs + + + Community.CsharpSqlite\mutex_h.cs + + + Community.CsharpSqlite\mutex_noop_c.cs + + + Community.CsharpSqlite\mutex_w32.cs + + + Community.CsharpSqlite\notify_c.cs + + + Community.CsharpSqlite\opcodes_c.cs + + + Community.CsharpSqlite\opcodes_h.cs + + + Community.CsharpSqlite\os_c.cs + + + Community.CsharpSqlite\os_common_h.cs + + + Community.CsharpSqlite\os_h.cs + + + Community.CsharpSqlite\os_win_c.cs + + + Community.CsharpSqlite\pager_c.cs + + + Community.CsharpSqlite\pager_h.cs + + + Community.CsharpSqlite\parse_c.cs + + + Community.CsharpSqlite\parse_h.cs + + + Community.CsharpSqlite\pcache1_c.cs + + + Community.CsharpSqlite\pcache_c.cs + + + Community.CsharpSqlite\pcache_h.cs + + + Community.CsharpSqlite\pragma_c.cs + + + Community.CsharpSqlite\prepare_c.cs + + + Community.CsharpSqlite\printf_c.cs + + + Community.CsharpSqlite\random_c.cs + + + Community.CsharpSqlite\resolve_c.cs + + + Community.CsharpSqlite\rowset_c.cs + + + Community.CsharpSqlite\select_c.cs + + + Community.CsharpSqlite\sqlite3_h.cs + + + Community.CsharpSqlite\sqliteInt_h.cs + + + Community.CsharpSqlite\sqliteLimit_h.cs + + + Community.CsharpSqlite\status_c.cs + + + Community.CsharpSqlite\table_c.cs + + + Community.CsharpSqlite\tokenize_c.cs + + + Community.CsharpSqlite\trigger_c.cs + + + Community.CsharpSqlite\update_c.cs + + + Community.CsharpSqlite\utf_c.cs + + + Community.CsharpSqlite\util_c.cs + + + Community.CsharpSqlite\vacuum_c.cs + + + Community.CsharpSqlite\vdbeapi_c.cs + + + Community.CsharpSqlite\vdbeaux_c.cs + + + Community.CsharpSqlite\vdbeblob_c.cs + + + Community.CsharpSqlite\VdbeInt_h.cs + + + Community.CsharpSqlite\vdbemem_c.cs + + + Community.CsharpSqlite\vdbetrace_c.cs + + + Community.CsharpSqlite\vdbe_c.cs + + + Community.CsharpSqlite\Vdbe_h.cs + + + Community.CsharpSqlite\vtab_c.cs + + + Community.CsharpSqlite\walker_c.cs + + + Community.CsharpSqlite\wal_c.cs + + + Community.CsharpSqlite\wal_h.cs + + + Community.CsharpSqlite\where_c.cs + + + Community.CsharpSqlite\_Custom.cs + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 2.0 %28x86%29 + true + + + False + .NET Framework 3.0 %28x86%29 + false + + + False + .NET Framework 3.5 + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Microsoft Visual Basic PowerPacks 10.0 + true + + + + \ No newline at end of file diff --git a/Community.CsharpSqlite.Benchmark/Community.CsharpSqlite.Benchmark.sln b/Community.CsharpSqlite.Benchmark/Community.CsharpSqlite.Benchmark.sln index d066368..a90c631 100644 --- a/Community.CsharpSqlite.Benchmark/Community.CsharpSqlite.Benchmark.sln +++ b/Community.CsharpSqlite.Benchmark/Community.CsharpSqlite.Benchmark.sln @@ -1,26 +1,26 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.Benchmark", "Community.CsharpSqlite.Benchmark.csproj", "{F1653F20-D47D-4F29-8C55-3C835542AF5F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Debug|x86.ActiveCfg = Debug|x86 - {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Debug|x86.Build.0 = Debug|x86 - {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Release|Any CPU.Build.0 = Release|Any CPU - {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Release|x86.ActiveCfg = Release|x86 - {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.Benchmark", "Community.CsharpSqlite.Benchmark.csproj", "{F1653F20-D47D-4F29-8C55-3C835542AF5F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Debug|x86.ActiveCfg = Debug|x86 + {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Debug|x86.Build.0 = Debug|x86 + {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Release|Any CPU.Build.0 = Release|Any CPU + {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Release|x86.ActiveCfg = Release|x86 + {F1653F20-D47D-4F29-8C55-3C835542AF5F}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Community.CsharpSqlite.Benchmark/Properties/AssemblyInfo.cs b/Community.CsharpSqlite.Benchmark/Properties/AssemblyInfo.cs index a27e45f..83ca191 100644 --- a/Community.CsharpSqlite.Benchmark/Properties/AssemblyInfo.cs +++ b/Community.CsharpSqlite.Benchmark/Properties/AssemblyInfo.cs @@ -1,33 +1,33 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Community.CsharpSqlite.Properties")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Community.CsharpSqlite.Properties")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3e153385-e02c-4872-8067-c9e03fa20c18")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion( "3.7.7.1" )] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Community.CsharpSqlite.Properties")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Community.CsharpSqlite.Properties")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3e153385-e02c-4872-8067-c9e03fa20c18")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion( "3.7.7.1" )] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Community.CsharpSqlite.Benchmark/src/Benchmark.cs b/Community.CsharpSqlite.Benchmark/src/Benchmark.cs index d558e9b..38a533a 100644 --- a/Community.CsharpSqlite.Benchmark/src/Benchmark.cs +++ b/Community.CsharpSqlite.Benchmark/src/Benchmark.cs @@ -1,353 +1,353 @@ -// $Header$ - -using System; -using System.Data; -using System.Data.SQLite; -using System.Diagnostics; -using System.IO; -using Community.CsharpSqlite; - -/* -* Benchmark Test for both SQLite and C#-SQLite -*/ - -public class Benchmark -{ - private static int nRecords; - - private static string[] PRAGMA_Commands = { -"PRAGMA synchronous = OFF", -"PRAGMA temp_store = MEMORY", -"PRAGMA journal_mode = OFF" , -"PRAGMA locking_mode=EXCLUSIVE" -}; - - private static string[] CREATE_Commands = { -"CREATE TABLE Root (intIndex INTEGER PRIMARY KEY, strIndex TEXT)", -"CREATE INDEX RootStrIndex ON Root (strIndex)" -}; - - private static string INSERT_Command = "INSERT INTO Root VALUES (?,?)"; - private static string SELECT_Bind_i = "SELECT * FROM Root WHERE intIndex = ?"; - private static string SELECT_Bind_s = "SELECT * FROM Root WHERE strIndex = ?"; - - private static string SELECT_Command_i = "SELECT * FROM Root ORDER BY intIndex"; - private static string SELECT_Command_s = "SELECT * FROM Root ORDER BY strIndex"; - - private static string DELETE_Bind = "DELETE FROM Root WHERE intIndex = ?"; - - private static long[,] timer = new long[2, 4]; - - private static string databaseName; - - public static void Main() - { - for ( nRecords = 10000; nRecords <= 200000; nRecords *= 2 ) - { - databaseName = "Benchmark_cs-SQLite.sqlite"; - TestSQLite(); - // - databaseName = "Benchmark_cs-Sqlite3.sqlite"; - TestCsharpSqlite(); - // - PrintStats( nRecords ); - } - Console.WriteLine( "Enter to Continue: " ); - Console.ReadKey(); - } - - private static void TestCsharpSqlite() - { - SQLiteDatabase db; - SQLiteVdbe stmt; - SQLiteVdbe c1, c2; - - bool found; - int i; - - string databaseName = "Benchmark_cs-SQLite.sqlite"; - if ( File.Exists( databaseName ) ) File.Delete( databaseName ); - - db = new SQLiteDatabase( databaseName ); - for ( i = 0; i < PRAGMA_Commands.Length; i++ ) { db.ExecuteNonQuery( PRAGMA_Commands[i] ); } - - db.ExecuteNonQuery( "BEGIN EXCLUSIVE" ); - for ( i = 0; i < CREATE_Commands.Length; i++ ) { db.ExecuteNonQuery( CREATE_Commands[i] ); } - stmt = new SQLiteVdbe( db, INSERT_Command ); - long start = DateTime.Now.Ticks; - long key = 1999; - for ( i = 0; i < nRecords; i++ ) - { - key = ( 3141592621L * key + 2718281829L ) % 1000000007L; - stmt.Reset(); - stmt.BindLong( 1, key ); - stmt.BindText( 2, key.ToString() ); - stmt.ExecuteStep(); - } - stmt.Close(); - db.ExecuteNonQuery( "END" ); - timer[1, 0] = DateTime.Now.Ticks - start; - - db.ExecuteNonQuery( "BEGIN EXCLUSIVE" ); - start = DateTime.Now.Ticks; - c1 = new SQLiteVdbe( db, SELECT_Bind_i ); - c2 = new SQLiteVdbe( db, SELECT_Bind_s ); - key = 1999; - for ( i = 0; i < nRecords; i++ ) - { - key = ( 3141592621L * key + 2718281829L ) % 1000000007L; - c1.Reset(); - c1.BindLong( 1, key ); - c1.ExecuteStep(); - - c2.Reset(); - c2.BindText( 1, key.ToString() ); - c2.ExecuteStep(); - - long id = (long)c1.Result_Long( 0 ); - Debug.Assert( id == (long)c2.Result_Long( 0 ) ); - - } - c1.Close(); - c2.Close(); - db.ExecuteNonQuery( "END" ); - timer[1, 1] = DateTime.Now.Ticks - start; - - db.ExecuteNonQuery( "BEGIN EXCLUSIVE" ); - start = DateTime.Now.Ticks; - key = Int64.MinValue; - i = 0; - c1 = new SQLiteVdbe( db, SELECT_Command_i ); - while ( c1.ExecuteStep() != Sqlite3.SQLITE_DONE ) - { - long intKey = (long)c1.Result_Long( 0 ); - Debug.Assert( intKey >= key ); - key = intKey; - i += 1; - } - c1.Close(); - Debug.Assert( i == nRecords ); - - String strKey = ""; - i = 0; - c2 = new SQLiteVdbe( db, SELECT_Command_s ); - while ( c2.ExecuteStep() != Sqlite3.SQLITE_DONE ) - { - string recStrKey = (string)c2.Result_Text( 1 ); - Debug.Assert( recStrKey.CompareTo( strKey ) >= 0 ); - strKey = recStrKey; - i += 1; - } - c2.Close(); - Debug.Assert( i == nRecords ); - timer[1, 2] = DateTime.Now.Ticks - start; - db.ExecuteNonQuery( "END" ); - - db.ExecuteNonQuery( "BEGIN EXCLUSIVE" ); - start = DateTime.Now.Ticks; - key = 1999; - stmt = new SQLiteVdbe( db, DELETE_Bind ); - for ( i = 0; i < nRecords; i++ ) - { - key = ( 3141592621L * key + 2718281829L ) % 1000000007L; - stmt.Reset(); - stmt.BindLong( 1, key ); - stmt.ExecuteStep(); - } - stmt.Close(); - db.ExecuteNonQuery( "END" ); - timer[1, 3] = DateTime.Now.Ticks - start; - db.CloseDatabase(); -#if NET_35 - Sqlite3.Shutdown(); -#else -Sqlite3.sqlite3_shutdown(); -#endif - } - private static void TestSQLite() - { - int i; - string databaseName = "Benchmark_SQLite.sqlite"; - if ( File.Exists( databaseName ) ) File.Delete( databaseName ); - - SQLiteConnectionStringBuilder constring = new SQLiteConnectionStringBuilder(); - constring.PageSize = 1024; - constring.SyncMode = SynchronizationModes.Off; - constring.DataSource = databaseName; - - SQLiteConnection con = new SQLiteConnection( constring.ToString() ); - con.Open(); - SQLiteCommand com = con.CreateCommand(); - for ( i = 0; i < PRAGMA_Commands.Length; i++ ) - { - com.CommandText = PRAGMA_Commands[i]; - com.ExecuteNonQuery(); - } - for ( i = 0; i < CREATE_Commands.Length; i++ ) - { - com.CommandText = CREATE_Commands[i]; - com.ExecuteNonQuery(); - } - - com.CommandText = "BEGIN EXCLUSIVE"; - com.ExecuteNonQuery(); - - com.CommandText = "INSERT INTO Root VALUES (?,?)"; - SQLiteParameter p1 = com.CreateParameter(); - p1.DbType = DbType.Int64; - com.Parameters.Add( p1 ); - SQLiteParameter p2 = com.CreateParameter(); - p2.DbType = DbType.String; - com.Parameters.Add( p2 ); - - long start = DateTime.Now.Ticks; - long key = 1999; - for ( i = 0; i < nRecords; i++ ) - { - key = ( 3141592621L * key + 2718281829L ) % 1000000007L; - p1.Value = key; - p2.Value = key.ToString(); - com.ExecuteNonQuery(); - } - com.CommandText = "END"; - com.Parameters.Clear(); - com.ExecuteNonQuery(); - timer[0, 0] = DateTime.Now.Ticks - start; - - com.CommandText = "BEGIN EXCLUSIVE"; - com.ExecuteNonQuery(); - - using ( SQLiteCommand com2 = con.CreateCommand() ) - { - com.CommandText = SELECT_Bind_i; - com.Parameters.Clear(); - com.Parameters.Add( p1 ); - - com2.CommandText = SELECT_Bind_s; - com2.Parameters.Clear(); - com2.Parameters.Add( p2 ); - - start = DateTime.Now.Ticks; - key = 1999; - object[] resValues = new object[2]; - for ( i = 0; i < nRecords; i++ ) - { - key = ( 3141592621L * key + 2718281829L ) % 1000000007L; - p1.Value = key; - p2.Value = key.ToString(); - using ( SQLiteDataReader res = com.ExecuteReader() ) - { - res.Read(); - res.GetValues( resValues ); - } - long id = (long)resValues[0]; - using ( SQLiteDataReader res = com2.ExecuteReader() ) - { - res.Read(); - res.GetValues( resValues ); - } - Debug.Assert( id == ( (long)resValues[0] ) ); - } - } - - timer[0, 1] = DateTime.Now.Ticks - start; - com.CommandText = "END"; - com.Parameters.Clear(); - com.ExecuteNonQuery(); - - com.CommandText = "BEGIN EXCLUSIVE"; - com.ExecuteNonQuery(); - - start = DateTime.Now.Ticks; - com.CommandText = SELECT_Command_i; - com.Parameters.Clear(); - key = Int64.MinValue; - i = 0; - using ( SQLiteDataReader reader = com.ExecuteReader() ) - { - object[] resValues = new object[2]; - while ( reader.Read() ) - { - reader.GetValues( resValues ); - long intKey = (long)resValues[0]; - Debug.Assert( intKey >= key ); - key = intKey; - i += 1; - } - Debug.Assert( i == nRecords ); - } - com.CommandText = SELECT_Command_s; - using ( SQLiteDataReader reader = com.ExecuteReader() ) - { - i = 0; - String strKey = ""; - object[] resValues = new object[2]; - while ( reader.Read() ) - { - reader.GetValues( resValues ); - string recStrKey = (string)resValues[1]; - Debug.Assert( recStrKey.CompareTo( strKey ) >= 0 ); - strKey = recStrKey; - i += 1; - } - Debug.Assert( i == nRecords ); - } - timer[0, 2] = DateTime.Now.Ticks - start; - - com.CommandText = "END"; - com.Parameters.Clear(); - com.ExecuteNonQuery(); - - com.CommandText = "BEGIN EXCLUSIVE"; - com.ExecuteNonQuery(); - - com.CommandText = DELETE_Bind; - com.Parameters.Clear(); - com.Parameters.Add( p1 ); - - start = DateTime.Now.Ticks; - key = 1999; - for ( i = 0; i < nRecords; i++ ) - { - key = ( 3141592621L * key + 2718281829L ) % 1000000007L; - p1.Value = key; - com.ExecuteNonQuery(); - } - com.CommandText = "END"; - com.Parameters.Clear(); - com.ExecuteNonQuery(); - - timer[0, 3] = DateTime.Now.Ticks - start; - con.Close(); - } - - static void PrintStats( int nRecords ) - { - - Console.WriteLine( " # Records Inserting Searching Iterating Deleting" ); - Console.WriteLine( - String.Format( " SQLite{0,10:####,###}{1,10:#####.0s}{2,10:#####.0s}{3,10:#####.0s}{4,10:#####.0s}" - , nRecords - , ( timer[0, 0] ) * 10e-8 + .05 - , ( timer[0, 1] ) * 10e-8 + .05 - , ( timer[0, 2] ) * 10e-8 + .05 - , ( timer[0, 3] ) * 10e-8 + .05 - ) ); - Console.WriteLine( - String.Format( "C#-SQLite{0,10:####,###}{1,10:#####.0s}{2,10:#####.0s}{3,10:#####.0s}{4,10:#####.0s}" - , nRecords - , ( timer[1, 0] ) * 10e-8 + .05 - , ( timer[1, 1] ) * 10e-8 + .05 - , ( timer[1, 2] ) * 10e-8 + .05 - , ( timer[1, 3] ) * 10e-8 + .05 - ) ); - Console.WriteLine( - String.Format( "C#/SQLite{0,10:####,###}{1,10:#####.0x}{2,10:#####.0x}{3,10:#####.0x}{4,10:#####.0x}" - , nRecords - , ( (double)timer[1, 0] / timer[0, 0] ) - , ( (double)timer[1, 1] / timer[0, 1] ) - , ( (double)timer[1, 2] / timer[0, 2] ) - , ( (double)timer[1, 3] / timer[0, 3] ) - ) ); - } -} +// $Header$ + +using System; +using System.Data; +using System.Data.SQLite; +using System.Diagnostics; +using System.IO; +using Community.CsharpSqlite; + +/* +* Benchmark Test for both SQLite and C#-SQLite +*/ + +public class Benchmark +{ + private static int nRecords; + + private static string[] PRAGMA_Commands = { +"PRAGMA synchronous = OFF", +"PRAGMA temp_store = MEMORY", +"PRAGMA journal_mode = OFF" , +"PRAGMA locking_mode=EXCLUSIVE" +}; + + private static string[] CREATE_Commands = { +"CREATE TABLE Root (intIndex INTEGER PRIMARY KEY, strIndex TEXT)", +"CREATE INDEX RootStrIndex ON Root (strIndex)" +}; + + private static string INSERT_Command = "INSERT INTO Root VALUES (?,?)"; + private static string SELECT_Bind_i = "SELECT * FROM Root WHERE intIndex = ?"; + private static string SELECT_Bind_s = "SELECT * FROM Root WHERE strIndex = ?"; + + private static string SELECT_Command_i = "SELECT * FROM Root ORDER BY intIndex"; + private static string SELECT_Command_s = "SELECT * FROM Root ORDER BY strIndex"; + + private static string DELETE_Bind = "DELETE FROM Root WHERE intIndex = ?"; + + private static long[,] timer = new long[2, 4]; + + private static string databaseName; + + public static void Main() + { + for ( nRecords = 10000; nRecords <= 200000; nRecords *= 2 ) + { + databaseName = "Benchmark_cs-SQLite.sqlite"; + TestSQLite(); + // + databaseName = "Benchmark_cs-Sqlite3.sqlite"; + TestCsharpSqlite(); + // + PrintStats( nRecords ); + } + Console.WriteLine( "Enter to Continue: " ); + Console.ReadKey(); + } + + private static void TestCsharpSqlite() + { + SQLiteDatabase db; + SQLiteVdbe stmt; + SQLiteVdbe c1, c2; + + bool found; + int i; + + string databaseName = "Benchmark_cs-SQLite.sqlite"; + if ( File.Exists( databaseName ) ) File.Delete( databaseName ); + + db = new SQLiteDatabase( databaseName ); + for ( i = 0; i < PRAGMA_Commands.Length; i++ ) { db.ExecuteNonQuery( PRAGMA_Commands[i] ); } + + db.ExecuteNonQuery( "BEGIN EXCLUSIVE" ); + for ( i = 0; i < CREATE_Commands.Length; i++ ) { db.ExecuteNonQuery( CREATE_Commands[i] ); } + stmt = new SQLiteVdbe( db, INSERT_Command ); + long start = DateTime.Now.Ticks; + long key = 1999; + for ( i = 0; i < nRecords; i++ ) + { + key = ( 3141592621L * key + 2718281829L ) % 1000000007L; + stmt.Reset(); + stmt.BindLong( 1, key ); + stmt.BindText( 2, key.ToString() ); + stmt.ExecuteStep(); + } + stmt.Close(); + db.ExecuteNonQuery( "END" ); + timer[1, 0] = DateTime.Now.Ticks - start; + + db.ExecuteNonQuery( "BEGIN EXCLUSIVE" ); + start = DateTime.Now.Ticks; + c1 = new SQLiteVdbe( db, SELECT_Bind_i ); + c2 = new SQLiteVdbe( db, SELECT_Bind_s ); + key = 1999; + for ( i = 0; i < nRecords; i++ ) + { + key = ( 3141592621L * key + 2718281829L ) % 1000000007L; + c1.Reset(); + c1.BindLong( 1, key ); + c1.ExecuteStep(); + + c2.Reset(); + c2.BindText( 1, key.ToString() ); + c2.ExecuteStep(); + + long id = (long)c1.Result_Long( 0 ); + Debug.Assert( id == (long)c2.Result_Long( 0 ) ); + + } + c1.Close(); + c2.Close(); + db.ExecuteNonQuery( "END" ); + timer[1, 1] = DateTime.Now.Ticks - start; + + db.ExecuteNonQuery( "BEGIN EXCLUSIVE" ); + start = DateTime.Now.Ticks; + key = Int64.MinValue; + i = 0; + c1 = new SQLiteVdbe( db, SELECT_Command_i ); + while ( c1.ExecuteStep() != Sqlite3.SQLITE_DONE ) + { + long intKey = (long)c1.Result_Long( 0 ); + Debug.Assert( intKey >= key ); + key = intKey; + i += 1; + } + c1.Close(); + Debug.Assert( i == nRecords ); + + String strKey = ""; + i = 0; + c2 = new SQLiteVdbe( db, SELECT_Command_s ); + while ( c2.ExecuteStep() != Sqlite3.SQLITE_DONE ) + { + string recStrKey = (string)c2.Result_Text( 1 ); + Debug.Assert( recStrKey.CompareTo( strKey ) >= 0 ); + strKey = recStrKey; + i += 1; + } + c2.Close(); + Debug.Assert( i == nRecords ); + timer[1, 2] = DateTime.Now.Ticks - start; + db.ExecuteNonQuery( "END" ); + + db.ExecuteNonQuery( "BEGIN EXCLUSIVE" ); + start = DateTime.Now.Ticks; + key = 1999; + stmt = new SQLiteVdbe( db, DELETE_Bind ); + for ( i = 0; i < nRecords; i++ ) + { + key = ( 3141592621L * key + 2718281829L ) % 1000000007L; + stmt.Reset(); + stmt.BindLong( 1, key ); + stmt.ExecuteStep(); + } + stmt.Close(); + db.ExecuteNonQuery( "END" ); + timer[1, 3] = DateTime.Now.Ticks - start; + db.CloseDatabase(); +#if NET_35 + Sqlite3.Shutdown(); +#else +Sqlite3.sqlite3_shutdown(); +#endif + } + private static void TestSQLite() + { + int i; + string databaseName = "Benchmark_SQLite.sqlite"; + if ( File.Exists( databaseName ) ) File.Delete( databaseName ); + + SQLiteConnectionStringBuilder constring = new SQLiteConnectionStringBuilder(); + constring.PageSize = 1024; + constring.SyncMode = SynchronizationModes.Off; + constring.DataSource = databaseName; + + SQLiteConnection con = new SQLiteConnection( constring.ToString() ); + con.Open(); + SQLiteCommand com = con.CreateCommand(); + for ( i = 0; i < PRAGMA_Commands.Length; i++ ) + { + com.CommandText = PRAGMA_Commands[i]; + com.ExecuteNonQuery(); + } + for ( i = 0; i < CREATE_Commands.Length; i++ ) + { + com.CommandText = CREATE_Commands[i]; + com.ExecuteNonQuery(); + } + + com.CommandText = "BEGIN EXCLUSIVE"; + com.ExecuteNonQuery(); + + com.CommandText = "INSERT INTO Root VALUES (?,?)"; + SQLiteParameter p1 = com.CreateParameter(); + p1.DbType = DbType.Int64; + com.Parameters.Add( p1 ); + SQLiteParameter p2 = com.CreateParameter(); + p2.DbType = DbType.String; + com.Parameters.Add( p2 ); + + long start = DateTime.Now.Ticks; + long key = 1999; + for ( i = 0; i < nRecords; i++ ) + { + key = ( 3141592621L * key + 2718281829L ) % 1000000007L; + p1.Value = key; + p2.Value = key.ToString(); + com.ExecuteNonQuery(); + } + com.CommandText = "END"; + com.Parameters.Clear(); + com.ExecuteNonQuery(); + timer[0, 0] = DateTime.Now.Ticks - start; + + com.CommandText = "BEGIN EXCLUSIVE"; + com.ExecuteNonQuery(); + + using ( SQLiteCommand com2 = con.CreateCommand() ) + { + com.CommandText = SELECT_Bind_i; + com.Parameters.Clear(); + com.Parameters.Add( p1 ); + + com2.CommandText = SELECT_Bind_s; + com2.Parameters.Clear(); + com2.Parameters.Add( p2 ); + + start = DateTime.Now.Ticks; + key = 1999; + object[] resValues = new object[2]; + for ( i = 0; i < nRecords; i++ ) + { + key = ( 3141592621L * key + 2718281829L ) % 1000000007L; + p1.Value = key; + p2.Value = key.ToString(); + using ( SQLiteDataReader res = com.ExecuteReader() ) + { + res.Read(); + res.GetValues( resValues ); + } + long id = (long)resValues[0]; + using ( SQLiteDataReader res = com2.ExecuteReader() ) + { + res.Read(); + res.GetValues( resValues ); + } + Debug.Assert( id == ( (long)resValues[0] ) ); + } + } + + timer[0, 1] = DateTime.Now.Ticks - start; + com.CommandText = "END"; + com.Parameters.Clear(); + com.ExecuteNonQuery(); + + com.CommandText = "BEGIN EXCLUSIVE"; + com.ExecuteNonQuery(); + + start = DateTime.Now.Ticks; + com.CommandText = SELECT_Command_i; + com.Parameters.Clear(); + key = Int64.MinValue; + i = 0; + using ( SQLiteDataReader reader = com.ExecuteReader() ) + { + object[] resValues = new object[2]; + while ( reader.Read() ) + { + reader.GetValues( resValues ); + long intKey = (long)resValues[0]; + Debug.Assert( intKey >= key ); + key = intKey; + i += 1; + } + Debug.Assert( i == nRecords ); + } + com.CommandText = SELECT_Command_s; + using ( SQLiteDataReader reader = com.ExecuteReader() ) + { + i = 0; + String strKey = ""; + object[] resValues = new object[2]; + while ( reader.Read() ) + { + reader.GetValues( resValues ); + string recStrKey = (string)resValues[1]; + Debug.Assert( recStrKey.CompareTo( strKey ) >= 0 ); + strKey = recStrKey; + i += 1; + } + Debug.Assert( i == nRecords ); + } + timer[0, 2] = DateTime.Now.Ticks - start; + + com.CommandText = "END"; + com.Parameters.Clear(); + com.ExecuteNonQuery(); + + com.CommandText = "BEGIN EXCLUSIVE"; + com.ExecuteNonQuery(); + + com.CommandText = DELETE_Bind; + com.Parameters.Clear(); + com.Parameters.Add( p1 ); + + start = DateTime.Now.Ticks; + key = 1999; + for ( i = 0; i < nRecords; i++ ) + { + key = ( 3141592621L * key + 2718281829L ) % 1000000007L; + p1.Value = key; + com.ExecuteNonQuery(); + } + com.CommandText = "END"; + com.Parameters.Clear(); + com.ExecuteNonQuery(); + + timer[0, 3] = DateTime.Now.Ticks - start; + con.Close(); + } + + static void PrintStats( int nRecords ) + { + + Console.WriteLine( " # Records Inserting Searching Iterating Deleting" ); + Console.WriteLine( + String.Format( " SQLite{0,10:####,###}{1,10:#####.0s}{2,10:#####.0s}{3,10:#####.0s}{4,10:#####.0s}" + , nRecords + , ( timer[0, 0] ) * 10e-8 + .05 + , ( timer[0, 1] ) * 10e-8 + .05 + , ( timer[0, 2] ) * 10e-8 + .05 + , ( timer[0, 3] ) * 10e-8 + .05 + ) ); + Console.WriteLine( + String.Format( "C#-SQLite{0,10:####,###}{1,10:#####.0s}{2,10:#####.0s}{3,10:#####.0s}{4,10:#####.0s}" + , nRecords + , ( timer[1, 0] ) * 10e-8 + .05 + , ( timer[1, 1] ) * 10e-8 + .05 + , ( timer[1, 2] ) * 10e-8 + .05 + , ( timer[1, 3] ) * 10e-8 + .05 + ) ); + Console.WriteLine( + String.Format( "C#/SQLite{0,10:####,###}{1,10:#####.0x}{2,10:#####.0x}{3,10:#####.0x}{4,10:#####.0x}" + , nRecords + , ( (double)timer[1, 0] / timer[0, 0] ) + , ( (double)timer[1, 1] / timer[0, 1] ) + , ( (double)timer[1, 2] / timer[0, 2] ) + , ( (double)timer[1, 3] / timer[0, 3] ) + ) ); + } +} diff --git a/Community.CsharpSqlite.Benchmark/src/performance.sql b/Community.CsharpSqlite.Benchmark/src/performance.sql index f1d5ef2..1b153b3 100644 --- a/Community.CsharpSqlite.Benchmark/src/performance.sql +++ b/Community.CsharpSqlite.Benchmark/src/performance.sql @@ -1,134 +1,134 @@ --- --- The author disclaims copyright to this source code. In place of --- a legal notice, here is a blessing: --- --- May you do good and not evil. --- May you find forgiveness for yourself and forgive others. --- May you share freely, never taking more than you give. --- ------------------------------------------------------------------------------------------ --- This file contains code used to implement the performance scripts --- --- Repository path: $HeadURL: https://sqlitecs.googlecode.com/svn/trunk/test/performance.sql $ --- Last Revised : $Revision: 62 $ --- Last Changed By : $LastChangedBy: noah.hart $ --- Last Changed Date : $LastChangedDate: 2009-08-03 09:19:48 -0700 (Mon, 03 Aug 2009) $ ------------------------------------------------------------------------------------------ ---------------------------------------------------------------------- --- --- NOTES: --- ---------------------------------------------------------------------- - ------------------------------------------- --- LEVEL THE PLAYING FIELD WITH PRAGMAs ------------------------------------------- - -PRAGMA auto_vacuum = NONE; -PRAGMA cache_size = 20000; -PRAGMA count_changes = 1; -PRAGMA encoding = "UTF-8"; -PRAGMA fullfsync = 0; -PRAGMA journal_mode = NONE; -PRAGMA locking_mode = EXCLUSIVE; -PRAGMA page_size = 1024; -PRAGMA synchronous = OFF; -PRAGMA temp_store = MEMORY; ------------------------------------------- --- A LITTLE SETUP BEFORE WE BEGIN ------------------------------------------- - -ATTACH ':memory:' as tDB; -CREATE TABLE tDB.TIMER(TestNumber INTEGER, Description TEXT, StartTime REAL, EndTime REAL DEFAULT NULL, Rows INTEGER DEFAULT NULL); -INSERT INTO TIMER VALUES(0, 'performance.txt,v 1.3', 0, 1, 0); -CREATE TABLE tDB.TEST1 (I INTEGER, T TEXT); -CREATE TABLE N_1(i INTEGER, t TEXT); -INSERT INTO N_1 VALUES(1, 't1_'); -INSERT INTO N_1 VALUES(2, 't_22_'); -INSERT INTO N_1 VALUES(3, 'tx_3_3_3_'); -INSERT INTO N_1 VALUES(4, 'txt_4_4_4_4_'); -CREATE TABLE N_2(i INTEGER, t TEXT); -INSERT INTO N_2 SELECT N1.I+N2.I*7, N1.T||N2.T FROM N_1 N1 CROSS JOIN N_1 N2 CROSS JOIN N_1 N3; - --------------------------------------------------------- --- TEST 1 --- TRIVIAL INSERTS -- KEEP THE NUMBER AND TEXT SMALL --------------------------------------------------------- -BEGIN; -INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Trivial Inserts', (julianday('now') - 2440587.5)*86400 FROM TIMER; -INSERT INTO TEST1 SELECT 1,'T' FROM N_2 N1 CROSS JOIN N_2 N2 CROSS JOIN N_2 N3; -COMMIT; - - UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0, Rows = changes() - WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); - --------------------------------------------------------- --- TEST 2 --- TRIVIAL SELECTS --------------------------------------------------------- -INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Trivial Selects', (julianday('now') - 2440587.5)*86400 FROM TIMER; - UPDATE TIMER SET Rows = (SELECT COUNT(*) FROM TEST1 where rowid > 0) - WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); - UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0 - WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); - --------------------------------------------------------- --- TEST 3 --- TRIVIAL UPDATES -- THE NUMBERS AND ROW SIZE ARE SMALL --------------------------------------------------------- -BEGIN; -INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Trivial Updates', (julianday('now') - 2440587.5)*86400 FROM TIMER; -UPDATE TEST1 SET I=I; -COMMIT; - UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0, Rows = changes() - WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); - --------------------------------------------------------- --- TEST 4 --- TRIVIAL DELETES --------------------------------------------------------- -BEGIN; -INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Trivial Deletes', (julianday('now') - 2440587.5)*86400 FROM TIMER; -DELETE FROM TEST1 WHERE I >0; -COMMIT; - UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0, Rows = changes() - WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); - ------------------------------------------- --- A LITTLE CLEANUP BEFORE WE CONTINUE ------------------------------------------- - -DROP TABLE TEST1; -CREATE TABLE tDB.TEST1 (I INTEGER, T TEXT); -PRAGMA page_count; -VACUUM; -PRAGMA page_count; - --------------------------------------------------------- --- TEST 5 --- INSERTS WITH CALCULATIONS -- SHOULD BE SLOWER THAN 1 --------------------------------------------------------- -BEGIN; -INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Insert with calculations', (julianday('now') - 2440587.5)*86400 FROM TIMER; -INSERT INTO TEST1 SELECT N1.I*N2.I+N3.I, N1.T||N2.T||N3.T FROM N_2 N1 CROSS JOIN N_2 N2 CROSS JOIN N_2 N3; -COMMIT; - UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0, Rows = changes() - WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); - --------------------------------------------------------- --- TEST 6 --- UPDATES WITH CALCULATIONS -- SHOULD BE SLOWER THAN 2 --------------------------------------------------------- -BEGIN; -INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Updates with calculations and longer rows', (julianday('now') - 2440587.5)*86400 FROM TIMER; -UPDATE TEST1 SET I=I*1+2-3; -COMMIT; - UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0, Rows = changes() - WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); - ------------------------------------------------ --- REPORT THE RESULTS --------------------------------------------------------- - Select TestNumber, Description, ROUND(EndTime- StartTime,2), Rows, Round(Rows/(EndTime-StartTime)/1000)||'K Rows/Second' from TIMER; - - +-- +-- The author disclaims copyright to this source code. In place of +-- a legal notice, here is a blessing: +-- +-- May you do good and not evil. +-- May you find forgiveness for yourself and forgive others. +-- May you share freely, never taking more than you give. +-- +----------------------------------------------------------------------------------------- +-- This file contains code used to implement the performance scripts +-- +-- Repository path: $HeadURL: https://sqlitecs.googlecode.com/svn/trunk/test/performance.sql $ +-- Last Revised : $Revision: 62 $ +-- Last Changed By : $LastChangedBy: noah.hart $ +-- Last Changed Date : $LastChangedDate: 2009-08-03 09:19:48 -0700 (Mon, 03 Aug 2009) $ +----------------------------------------------------------------------------------------- +--------------------------------------------------------------------- +-- +-- NOTES: +-- +--------------------------------------------------------------------- + +------------------------------------------ +-- LEVEL THE PLAYING FIELD WITH PRAGMAs +------------------------------------------ + +PRAGMA auto_vacuum = NONE; +PRAGMA cache_size = 20000; +PRAGMA count_changes = 1; +PRAGMA encoding = "UTF-8"; +PRAGMA fullfsync = 0; +PRAGMA journal_mode = NONE; +PRAGMA locking_mode = EXCLUSIVE; +PRAGMA page_size = 1024; +PRAGMA synchronous = OFF; +PRAGMA temp_store = MEMORY; +------------------------------------------ +-- A LITTLE SETUP BEFORE WE BEGIN +------------------------------------------ + +ATTACH ':memory:' as tDB; +CREATE TABLE tDB.TIMER(TestNumber INTEGER, Description TEXT, StartTime REAL, EndTime REAL DEFAULT NULL, Rows INTEGER DEFAULT NULL); +INSERT INTO TIMER VALUES(0, 'performance.txt,v 1.3', 0, 1, 0); +CREATE TABLE tDB.TEST1 (I INTEGER, T TEXT); +CREATE TABLE N_1(i INTEGER, t TEXT); +INSERT INTO N_1 VALUES(1, 't1_'); +INSERT INTO N_1 VALUES(2, 't_22_'); +INSERT INTO N_1 VALUES(3, 'tx_3_3_3_'); +INSERT INTO N_1 VALUES(4, 'txt_4_4_4_4_'); +CREATE TABLE N_2(i INTEGER, t TEXT); +INSERT INTO N_2 SELECT N1.I+N2.I*7, N1.T||N2.T FROM N_1 N1 CROSS JOIN N_1 N2 CROSS JOIN N_1 N3; + +-------------------------------------------------------- +-- TEST 1 +-- TRIVIAL INSERTS -- KEEP THE NUMBER AND TEXT SMALL +-------------------------------------------------------- +BEGIN; +INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Trivial Inserts', (julianday('now') - 2440587.5)*86400 FROM TIMER; +INSERT INTO TEST1 SELECT 1,'T' FROM N_2 N1 CROSS JOIN N_2 N2 CROSS JOIN N_2 N3; +COMMIT; + + UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0, Rows = changes() + WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); + +-------------------------------------------------------- +-- TEST 2 +-- TRIVIAL SELECTS +-------------------------------------------------------- +INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Trivial Selects', (julianday('now') - 2440587.5)*86400 FROM TIMER; + UPDATE TIMER SET Rows = (SELECT COUNT(*) FROM TEST1 where rowid > 0) + WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); + UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0 + WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); + +-------------------------------------------------------- +-- TEST 3 +-- TRIVIAL UPDATES -- THE NUMBERS AND ROW SIZE ARE SMALL +-------------------------------------------------------- +BEGIN; +INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Trivial Updates', (julianday('now') - 2440587.5)*86400 FROM TIMER; +UPDATE TEST1 SET I=I; +COMMIT; + UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0, Rows = changes() + WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); + +-------------------------------------------------------- +-- TEST 4 +-- TRIVIAL DELETES +-------------------------------------------------------- +BEGIN; +INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Trivial Deletes', (julianday('now') - 2440587.5)*86400 FROM TIMER; +DELETE FROM TEST1 WHERE I >0; +COMMIT; + UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0, Rows = changes() + WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); + +------------------------------------------ +-- A LITTLE CLEANUP BEFORE WE CONTINUE +------------------------------------------ + +DROP TABLE TEST1; +CREATE TABLE tDB.TEST1 (I INTEGER, T TEXT); +PRAGMA page_count; +VACUUM; +PRAGMA page_count; + +-------------------------------------------------------- +-- TEST 5 +-- INSERTS WITH CALCULATIONS -- SHOULD BE SLOWER THAN 1 +-------------------------------------------------------- +BEGIN; +INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Insert with calculations', (julianday('now') - 2440587.5)*86400 FROM TIMER; +INSERT INTO TEST1 SELECT N1.I*N2.I+N3.I, N1.T||N2.T||N3.T FROM N_2 N1 CROSS JOIN N_2 N2 CROSS JOIN N_2 N3; +COMMIT; + UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0, Rows = changes() + WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); + +-------------------------------------------------------- +-- TEST 6 +-- UPDATES WITH CALCULATIONS -- SHOULD BE SLOWER THAN 2 +-------------------------------------------------------- +BEGIN; +INSERT INTO TIMER (TestNumber, Description, StartTime) SELECT 1+MAX(TESTNUMBER), 'Updates with calculations and longer rows', (julianday('now') - 2440587.5)*86400 FROM TIMER; +UPDATE TEST1 SET I=I*1+2-3; +COMMIT; + UPDATE TIMER SET EndTime = (julianday('now') - 2440587.5)*86400.0, Rows = changes() + WHERE TestNumber = (SELECT MAX(TESTNUMBER) FROM TIMER); + +----------------------------------------------- +-- REPORT THE RESULTS +-------------------------------------------------------- + Select TestNumber, Description, ROUND(EndTime- StartTime,2), Rows, Round(Rows/(EndTime-StartTime)/1000)||'K Rows/Second' from TIMER; + + diff --git a/Community.CsharpSqlite.SQLiteClient.SL/Community.CsharpSqlite.SQLiteClient.SL.csproj b/Community.CsharpSqlite.SQLiteClient.SL/Community.CsharpSqlite.SQLiteClient.SL.csproj index 1ecd3c0..30eca23 100644 --- a/Community.CsharpSqlite.SQLiteClient.SL/Community.CsharpSqlite.SQLiteClient.SL.csproj +++ b/Community.CsharpSqlite.SQLiteClient.SL/Community.CsharpSqlite.SQLiteClient.SL.csproj @@ -1,112 +1,112 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {238EAD8B-B811-4FA6-8581-4CA4B816066D} - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Community.CsharpSqlite.SQLiteClient.SL - Community.CsharpSqlite.SQLiteClient.SL - Silverlight - v4.0 - $(TargetFrameworkVersion) - false - true - true - - - - v3.5 - - - true - full - false - Bin\Debug - TRACE;DEBUG;SQLITE_SILVERLIGHT SQLITE_HAS_CODEC NET_2_0 - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SQLITE_SILVERLIGHT - true - true - prompt - 4 - - - - - - - - src\SqliteCommand.cs - Code - - - src\SqliteConnection.cs - Code - - - src\SqliteDataReader.cs - Code - - - src\SqliteError.cs - Code - - - src\SqliteExceptions.cs - Code - - - src\SqliteParameter.cs - Code - - - src\SqliteParameterCollection.cs - Code - - - src\SqliteTransaction.cs - Code - - - - - - {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779} - Community.CsharpSqlite.Silverlight - - - {D7194231-DBAD-422B-819E-911037934F45} - System.Data.Ersatz.Silverlight - - - - - - - - - - - + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {238EAD8B-B811-4FA6-8581-4CA4B816066D} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Community.CsharpSqlite.SQLiteClient.SL + Community.CsharpSqlite.SQLiteClient.SL + Silverlight + v4.0 + $(TargetFrameworkVersion) + false + true + true + + + + v3.5 + + + true + full + false + Bin\Debug + TRACE;DEBUG;SQLITE_SILVERLIGHT SQLITE_HAS_CODEC NET_2_0 + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SQLITE_SILVERLIGHT + true + true + prompt + 4 + + + + + + + + src\SqliteCommand.cs + Code + + + src\SqliteConnection.cs + Code + + + src\SqliteDataReader.cs + Code + + + src\SqliteError.cs + Code + + + src\SqliteExceptions.cs + Code + + + src\SqliteParameter.cs + Code + + + src\SqliteParameterCollection.cs + Code + + + src\SqliteTransaction.cs + Code + + + + + + {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779} + Community.CsharpSqlite.Silverlight + + + {D7194231-DBAD-422B-819E-911037934F45} + System.Data.Ersatz.Silverlight + + + + + + + + + + + \ No newline at end of file diff --git a/Community.CsharpSqlite.SQLiteClient.SL/Community.CsharpSqlite.SQLiteClient.SL.sln b/Community.CsharpSqlite.SQLiteClient.SL/Community.CsharpSqlite.SQLiteClient.SL.sln index 738561d..69a94f8 100644 --- a/Community.CsharpSqlite.SQLiteClient.SL/Community.CsharpSqlite.SQLiteClient.SL.sln +++ b/Community.CsharpSqlite.SQLiteClient.SL/Community.CsharpSqlite.SQLiteClient.SL.sln @@ -1,32 +1,32 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.SQLiteClient.SL", "Community.CsharpSqlite.SQLiteClient.SL.csproj", "{238EAD8B-B811-4FA6-8581-4CA4B816066D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.Silverlight", "..\Community.CsharpSqlite.Silverlight\Community.CsharpSqlite.Silverlight.csproj", "{A3AE849B-B668-4BC9-A75F-6E9B0A8F6779}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Ersatz.Silverlight", "..\System.Data.Ersatz\Silverlight\System.Data.Ersatz.Silverlight.csproj", "{D7194231-DBAD-422B-819E-911037934F45}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {238EAD8B-B811-4FA6-8581-4CA4B816066D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {238EAD8B-B811-4FA6-8581-4CA4B816066D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {238EAD8B-B811-4FA6-8581-4CA4B816066D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {238EAD8B-B811-4FA6-8581-4CA4B816066D}.Release|Any CPU.Build.0 = Release|Any CPU - {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779}.Release|Any CPU.Build.0 = Release|Any CPU - {D7194231-DBAD-422B-819E-911037934F45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D7194231-DBAD-422B-819E-911037934F45}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D7194231-DBAD-422B-819E-911037934F45}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D7194231-DBAD-422B-819E-911037934F45}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.SQLiteClient.SL", "Community.CsharpSqlite.SQLiteClient.SL.csproj", "{238EAD8B-B811-4FA6-8581-4CA4B816066D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.Silverlight", "..\Community.CsharpSqlite.Silverlight\Community.CsharpSqlite.Silverlight.csproj", "{A3AE849B-B668-4BC9-A75F-6E9B0A8F6779}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Ersatz.Silverlight", "..\System.Data.Ersatz\Silverlight\System.Data.Ersatz.Silverlight.csproj", "{D7194231-DBAD-422B-819E-911037934F45}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {238EAD8B-B811-4FA6-8581-4CA4B816066D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {238EAD8B-B811-4FA6-8581-4CA4B816066D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {238EAD8B-B811-4FA6-8581-4CA4B816066D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {238EAD8B-B811-4FA6-8581-4CA4B816066D}.Release|Any CPU.Build.0 = Release|Any CPU + {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779}.Release|Any CPU.Build.0 = Release|Any CPU + {D7194231-DBAD-422B-819E-911037934F45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D7194231-DBAD-422B-819E-911037934F45}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D7194231-DBAD-422B-819E-911037934F45}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D7194231-DBAD-422B-819E-911037934F45}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Community.CsharpSqlite.SQLiteClient.SL/Properties/AssemblyInfo.cs b/Community.CsharpSqlite.SQLiteClient.SL/Properties/AssemblyInfo.cs index b8d6d38..739e801 100644 --- a/Community.CsharpSqlite.SQLiteClient.SL/Properties/AssemblyInfo.cs +++ b/Community.CsharpSqlite.SQLiteClient.SL/Properties/AssemblyInfo.cs @@ -1,35 +1,35 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Community.CsharpSqlite.SQLiteClient.SL")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Community.CsharpSqlite.SQLiteClient.SL")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5cf66686-bc8e-4d47-98ce-8ea30fb91a30")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Community.CsharpSqlite.SQLiteClient.SL")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Community.CsharpSqlite.SQLiteClient.SL")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5cf66686-bc8e-4d47-98ce-8ea30fb91a30")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/App.xaml b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/App.xaml index de812cb..1344421 100644 --- a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/App.xaml +++ b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/App.xaml @@ -1,8 +1,8 @@ - - - - - + + + + + diff --git a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/App.xaml.cs b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/App.xaml.cs index fff6ab8..969df56 100644 --- a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/App.xaml.cs +++ b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/App.xaml.cs @@ -1,68 +1,68 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; - -namespace SQLiteClientTests -{ - public partial class App : Application - { - - public App() - { - this.Startup += this.Application_Startup; - this.Exit += this.Application_Exit; - this.UnhandledException += this.Application_UnhandledException; - - InitializeComponent(); - } - - private void Application_Startup(object sender, StartupEventArgs e) - { - this.RootVisual = new MainPage(); - } - - private void Application_Exit(object sender, EventArgs e) - { - - } - - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - // If the app is running outside of the debugger then report the exception using - // the browser's exception mechanism. On IE this will display it a yellow alert - // icon in the status bar and Firefox will display a script error. - if (!System.Diagnostics.Debugger.IsAttached) - { - - // NOTE: This will allow the application to continue running after an exception has been thrown - // but not handled. - // For production applications this error handling should be replaced with something that will - // report the error to the website and stop the application. - e.Handled = true; - Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); - } - } - - private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) - { - try - { - string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; - errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); - - System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); - } - catch (Exception) - { - } - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace SQLiteClientTests +{ + public partial class App : Application + { + + public App() + { + this.Startup += this.Application_Startup; + this.Exit += this.Application_Exit; + this.UnhandledException += this.Application_UnhandledException; + + InitializeComponent(); + } + + private void Application_Startup(object sender, StartupEventArgs e) + { + this.RootVisual = new MainPage(); + } + + private void Application_Exit(object sender, EventArgs e) + { + + } + + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + // If the app is running outside of the debugger then report the exception using + // the browser's exception mechanism. On IE this will display it a yellow alert + // icon in the status bar and Firefox will display a script error. + if (!System.Diagnostics.Debugger.IsAttached) + { + + // NOTE: This will allow the application to continue running after an exception has been thrown + // but not handled. + // For production applications this error handling should be replaced with something that will + // report the error to the website and stop the application. + e.Handled = true; + Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); }); + } + } + + private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e) + { + try + { + string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace; + errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n"); + + System.Windows.Browser.HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");"); + } + catch (Exception) + { + } + } + } +} diff --git a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/MainPage.xaml b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/MainPage.xaml index f0f94fc..faca1a4 100644 --- a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/MainPage.xaml +++ b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/MainPage.xaml @@ -1,12 +1,12 @@ - - - - - - + + + + + + diff --git a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/MainPage.xaml.cs b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/MainPage.xaml.cs index 5c4cb61..81a6249 100644 --- a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/MainPage.xaml.cs +++ b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/MainPage.xaml.cs @@ -1,23 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; - -namespace SQLiteClientTests -{ - public partial class MainPage : UserControl - { - public MainPage() - { - InitializeComponent(); - SQLiteClientTestDriver.Main(null); - } - } -} +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; + +namespace SQLiteClientTests +{ + public partial class MainPage : UserControl + { + public MainPage() + { + InitializeComponent(); + SQLiteClientTestDriver.Main(null); + } + } +} diff --git a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/Properties/AppManifest.xml b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/Properties/AppManifest.xml index a955232..6712a11 100644 --- a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/Properties/AppManifest.xml +++ b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/Properties/AppManifest.xml @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/Properties/AssemblyInfo.cs b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/Properties/AssemblyInfo.cs index c3cd1ce..7ee9e68 100644 --- a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/Properties/AssemblyInfo.cs +++ b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/Properties/AssemblyInfo.cs @@ -1,35 +1,35 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SQLiteClientTests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SQLiteClientTests")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2ad31cc4-7853-4cbb-b185-239b97d991d8")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SQLiteClientTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SQLiteClientTests")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2ad31cc4-7853-4cbb-b185-239b97d991d8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/SQLiteClientTests.csproj b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/SQLiteClientTests.csproj index 2ef1e6e..41fa76e 100644 --- a/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/SQLiteClientTests.csproj +++ b/Community.CsharpSqlite.SQLiteClient.SL/SQLiteClientTests/SQLiteClientTests.csproj @@ -1,125 +1,125 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {071198E0-F451-475D-83D2-302C74A3862D} - {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - SQLiteClientTests - SQLiteClientTests - Silverlight - v4.0 - $(TargetFrameworkVersion) - true - - - true - true - SQLiteClientTests.xap - Properties\AppManifest.xml - SQLiteClientTests.App - SQLiteClientTestsTestPage.html - true - true - false - Properties\OutOfBrowserSettings.xml - false - true - - - - - - v3.5 - - - true - full - false - Bin\Debug - TRACE;DEBUG;SQLITE_SILVERLIGHT - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SQLITE_SILVERLIGHT - true - true - prompt - 4 - - - - - - - - - - - - - TestDriver_src\SQLiteClientTestDriver.cs - - - App.xaml - - - MainPage.xaml - - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - - - - {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779} - Community.CsharpSqlite.Silverlight - - - {D7194231-DBAD-422B-819E-911037934F45} - System.Data.Ersatz - - - {238EAD8B-B811-4FA6-8581-4CA4B816066D} - Community.CsharpSqlite.SQLiteClient.SL - - - - - - - - - - - + + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {071198E0-F451-475D-83D2-302C74A3862D} + {A1591282-1198-4647-A2B1-27E5FF5F6F3B};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + SQLiteClientTests + SQLiteClientTests + Silverlight + v4.0 + $(TargetFrameworkVersion) + true + + + true + true + SQLiteClientTests.xap + Properties\AppManifest.xml + SQLiteClientTests.App + SQLiteClientTestsTestPage.html + true + true + false + Properties\OutOfBrowserSettings.xml + false + true + + + + + + v3.5 + + + true + full + false + Bin\Debug + TRACE;DEBUG;SQLITE_SILVERLIGHT + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SQLITE_SILVERLIGHT + true + true + prompt + 4 + + + + + + + + + + + + + TestDriver_src\SQLiteClientTestDriver.cs + + + App.xaml + + + MainPage.xaml + + + + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + + + + {A3AE849B-B668-4BC9-A75F-6E9B0A8F6779} + Community.CsharpSqlite.Silverlight + + + {D7194231-DBAD-422B-819E-911037934F45} + System.Data.Ersatz + + + {238EAD8B-B811-4FA6-8581-4CA4B816066D} + Community.CsharpSqlite.SQLiteClient.SL + + + + + + + + + + + \ No newline at end of file diff --git a/Community.CsharpSqlite.SQLiteClient.WM/Community.CsharpSqlite.SQLiteClient.WM.csproj b/Community.CsharpSqlite.SQLiteClient.WM/Community.CsharpSqlite.SQLiteClient.WM.csproj index 24492a1..7e49080 100644 --- a/Community.CsharpSqlite.SQLiteClient.WM/Community.CsharpSqlite.SQLiteClient.WM.csproj +++ b/Community.CsharpSqlite.SQLiteClient.WM/Community.CsharpSqlite.SQLiteClient.WM.csproj @@ -1,126 +1,126 @@ - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07} - Library - Properties - Community.CsharpSqlite.SQLiteClient.WM - Community.CsharpSqlite.SQLiteClient.WM - {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - PocketPC - 4118C335-430C-497f-BE48-11C3316B135E - 5.1 - Community.CsharpSqlite.SQLiteClient.WM - v3.5 - Windows Mobile 5.0 Pocket PC SDK - - - - - true - full - false - bin\Debug\ - TRACE;DEBUG;WINDOWS_MOBILE - true - true - prompt - 512 - 4 - Off - - - pdbonly - true - bin\Release\ - TRACE;$(PlatformFamilyName) - true - true - prompt - 512 - 4 - Off - - - - - - - - - - - - - src\SqliteCommand.cs - Component - - - src\SqliteCommandBuilder.cs - Component - - - src\SqliteConnection.cs - Component - - - src\SqliteDataAdapter.cs - Component - - - src\SqliteDataReader.cs - - - src\SqliteError.cs - - - src\SqliteExceptions.cs - - - src\SqliteParameter.cs - - - src\SqliteParameterCollection.cs - - - src\SqliteRowUpdatedEventArgs.cs - - - src\SqliteRowUpdatedEventHandler.cs - - - src\SqliteRowUpdatingEventArgs.cs - - - src\SqliteRowUpdatingEventHandler.cs - - - src\SqliteTransaction.cs - - - - - - {3A036D50-E70A-4581-8891-352CCD69617A} - Community.CsharpSqlite.WinMobile - - - - - - - - - - - + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07} + Library + Properties + Community.CsharpSqlite.SQLiteClient.WM + Community.CsharpSqlite.SQLiteClient.WM + {4D628B5B-2FBC-4AA6-8C16-197242AEB884};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + PocketPC + 4118C335-430C-497f-BE48-11C3316B135E + 5.1 + Community.CsharpSqlite.SQLiteClient.WM + v3.5 + Windows Mobile 5.0 Pocket PC SDK + + + + + true + full + false + bin\Debug\ + TRACE;DEBUG;WINDOWS_MOBILE + true + true + prompt + 512 + 4 + Off + + + pdbonly + true + bin\Release\ + TRACE;$(PlatformFamilyName) + true + true + prompt + 512 + 4 + Off + + + + + + + + + + + + + src\SqliteCommand.cs + Component + + + src\SqliteCommandBuilder.cs + Component + + + src\SqliteConnection.cs + Component + + + src\SqliteDataAdapter.cs + Component + + + src\SqliteDataReader.cs + + + src\SqliteError.cs + + + src\SqliteExceptions.cs + + + src\SqliteParameter.cs + + + src\SqliteParameterCollection.cs + + + src\SqliteRowUpdatedEventArgs.cs + + + src\SqliteRowUpdatedEventHandler.cs + + + src\SqliteRowUpdatingEventArgs.cs + + + src\SqliteRowUpdatingEventHandler.cs + + + src\SqliteTransaction.cs + + + + + + {3A036D50-E70A-4581-8891-352CCD69617A} + Community.CsharpSqlite.WinMobile + + + + + + + + + + + \ No newline at end of file diff --git a/Community.CsharpSqlite.SQLiteClient.WM/Community.CsharpSqlite.SQLiteClient.WM.sln b/Community.CsharpSqlite.SQLiteClient.WM/Community.CsharpSqlite.SQLiteClient.WM.sln index e3463ce..0cee0f6 100644 --- a/Community.CsharpSqlite.SQLiteClient.WM/Community.CsharpSqlite.SQLiteClient.WM.sln +++ b/Community.CsharpSqlite.SQLiteClient.WM/Community.CsharpSqlite.SQLiteClient.WM.sln @@ -1,26 +1,26 @@ - -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.SQLiteClient.WM", "Community.CsharpSqlite.SQLiteClient.WM.csproj", "{3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.WinMobile", "..\Community.CsharpSqlite.WinMobile\Community.CsharpSqlite.WinMobile.csproj", "{3A036D50-E70A-4581-8891-352CCD69617A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07}.Release|Any CPU.Build.0 = Release|Any CPU - {3A036D50-E70A-4581-8891-352CCD69617A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3A036D50-E70A-4581-8891-352CCD69617A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3A036D50-E70A-4581-8891-352CCD69617A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3A036D50-E70A-4581-8891-352CCD69617A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.SQLiteClient.WM", "Community.CsharpSqlite.SQLiteClient.WM.csproj", "{3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.WinMobile", "..\Community.CsharpSqlite.WinMobile\Community.CsharpSqlite.WinMobile.csproj", "{3A036D50-E70A-4581-8891-352CCD69617A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3628A9EF-CCDB-4474-A0CD-4D0CFC0FAC07}.Release|Any CPU.Build.0 = Release|Any CPU + {3A036D50-E70A-4581-8891-352CCD69617A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A036D50-E70A-4581-8891-352CCD69617A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A036D50-E70A-4581-8891-352CCD69617A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A036D50-E70A-4581-8891-352CCD69617A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Community.CsharpSqlite.SQLiteClient.WM/Properties/AssemblyInfo.cs b/Community.CsharpSqlite.SQLiteClient.WM/Properties/AssemblyInfo.cs index 033809c..3794827 100644 --- a/Community.CsharpSqlite.SQLiteClient.WM/Properties/AssemblyInfo.cs +++ b/Community.CsharpSqlite.SQLiteClient.WM/Properties/AssemblyInfo.cs @@ -1,35 +1,35 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Community.CsharpSqlite.SQLiteClient.WM")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Community.CsharpSqlite.SQLiteClient.WM")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("875f82cd-952d-44b3-a090-90aee33d30fe")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.*")] - +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Community.CsharpSqlite.SQLiteClient.WM")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Community.CsharpSqlite.SQLiteClient.WM")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("875f82cd-952d-44b3-a090-90aee33d30fe")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.*")] + diff --git a/Community.CsharpSqlite.SQLiteClient.WP/Community.CsharpSqlite.SQLiteClient.WP.csproj b/Community.CsharpSqlite.SQLiteClient.WP/Community.CsharpSqlite.SQLiteClient.WP.csproj index cb6f418..f4cc209 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/Community.CsharpSqlite.SQLiteClient.WP.csproj +++ b/Community.CsharpSqlite.SQLiteClient.WP/Community.CsharpSqlite.SQLiteClient.WP.csproj @@ -1,95 +1,95 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {22E602F9-ADB6-4B94-B980-40EB1E83BE8B} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Community.CsharpSqlite.SQLiteClient.WP - Community.CsharpSqlite.SQLiteClient.WP - v4.0 - $(TargetFrameworkVersion) - WindowsPhone - Silverlight - false - true - true - - - true - full - false - Bin\Debug - TRACE;DEBUG;SQLITE_SILVERLIGHT NET_40 TRUE WIN32 _MSC_VER SQLITE_DEBUG NDEBUG NO_TCL SQLITE_ASCII SQLITE_DISABLE_LFS SQLITE_HAS_CODEC SQLITE_MEM_POOL SQLITE_MUTEX_OMIT SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_UTF16 SQLITE_OMIT_VIRTUALTABLE SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SQLITE_SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - - - - - src\SqliteCommand.cs - - - src\SqliteConnection.cs - - - src\SqliteDataReader.cs - - - src\SqliteError.cs - - - src\SqliteExceptions.cs - - - src\SqliteParameter.cs - - - src\SqliteParameterCollection.cs - - - src\SqliteTransaction.cs - - - - - - - {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9} - Community.CsharpSqlite.WinPhone - - - {60396C62-02C2-45FE-98BD-4A16E076722B} - System.Data.Ersatz.WinPhone - - - - - - + + + + Debug + AnyCPU + 10.0.20506 + 2.0 + {22E602F9-ADB6-4B94-B980-40EB1E83BE8B} + {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Community.CsharpSqlite.SQLiteClient.WP + Community.CsharpSqlite.SQLiteClient.WP + v4.0 + $(TargetFrameworkVersion) + WindowsPhone + Silverlight + false + true + true + + + true + full + false + Bin\Debug + TRACE;DEBUG;SQLITE_SILVERLIGHT NET_40 TRUE WIN32 _MSC_VER SQLITE_DEBUG NDEBUG NO_TCL SQLITE_ASCII SQLITE_DISABLE_LFS SQLITE_HAS_CODEC SQLITE_MEM_POOL SQLITE_MUTEX_OMIT SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_UTF16 SQLITE_OMIT_VIRTUALTABLE SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF WINDOWS_PHONE + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SQLITE_SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + + + + + + src\SqliteCommand.cs + + + src\SqliteConnection.cs + + + src\SqliteDataReader.cs + + + src\SqliteError.cs + + + src\SqliteExceptions.cs + + + src\SqliteParameter.cs + + + src\SqliteParameterCollection.cs + + + src\SqliteTransaction.cs + + + + + + + {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9} + Community.CsharpSqlite.WinPhone + + + {60396C62-02C2-45FE-98BD-4A16E076722B} + System.Data.Ersatz.WinPhone + + + + + + \ No newline at end of file diff --git a/Community.CsharpSqlite.SQLiteClient.WP/Community.CsharpSqlite.SQLiteClient.WP.sln b/Community.CsharpSqlite.SQLiteClient.WP/Community.CsharpSqlite.SQLiteClient.WP.sln index 0274476..c825cae 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/Community.CsharpSqlite.SQLiteClient.WP.sln +++ b/Community.CsharpSqlite.SQLiteClient.WP/Community.CsharpSqlite.SQLiteClient.WP.sln @@ -1,40 +1,40 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.SQLiteClient.WP", "Community.CsharpSqlite.SQLiteClient.WP.csproj", "{22E602F9-ADB6-4B94-B980-40EB1E83BE8B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.WinPhone", "..\Community.CsharpSqlite.WinPhone\Community.CsharpSqlite.WinPhone.csproj", "{A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Ersatz.WinPhone", "..\System.Data.Ersatz\WinPhone\System.Data.Ersatz.WinPhone.csproj", "{60396C62-02C2-45FE-98BD-4A16E076722B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLiteClientTests.WinPhone", "SQLiteClientTests\SQLiteClientTests.WinPhone.csproj", "{C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {22E602F9-ADB6-4B94-B980-40EB1E83BE8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {22E602F9-ADB6-4B94-B980-40EB1E83BE8B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {22E602F9-ADB6-4B94-B980-40EB1E83BE8B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {22E602F9-ADB6-4B94-B980-40EB1E83BE8B}.Release|Any CPU.Build.0 = Release|Any CPU - {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9}.Release|Any CPU.Build.0 = Release|Any CPU - {60396C62-02C2-45FE-98BD-4A16E076722B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {60396C62-02C2-45FE-98BD-4A16E076722B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {60396C62-02C2-45FE-98BD-4A16E076722B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {60396C62-02C2-45FE-98BD-4A16E076722B}.Release|Any CPU.Build.0 = Release|Any CPU - {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU - {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Release|Any CPU.Build.0 = Release|Any CPU - {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Release|Any CPU.Deploy.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.SQLiteClient.WP", "Community.CsharpSqlite.SQLiteClient.WP.csproj", "{22E602F9-ADB6-4B94-B980-40EB1E83BE8B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.WinPhone", "..\Community.CsharpSqlite.WinPhone\Community.CsharpSqlite.WinPhone.csproj", "{A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Ersatz.WinPhone", "..\System.Data.Ersatz\WinPhone\System.Data.Ersatz.WinPhone.csproj", "{60396C62-02C2-45FE-98BD-4A16E076722B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQLiteClientTests.WinPhone", "SQLiteClientTests\SQLiteClientTests.WinPhone.csproj", "{C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {22E602F9-ADB6-4B94-B980-40EB1E83BE8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {22E602F9-ADB6-4B94-B980-40EB1E83BE8B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {22E602F9-ADB6-4B94-B980-40EB1E83BE8B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {22E602F9-ADB6-4B94-B980-40EB1E83BE8B}.Release|Any CPU.Build.0 = Release|Any CPU + {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9}.Release|Any CPU.Build.0 = Release|Any CPU + {60396C62-02C2-45FE-98BD-4A16E076722B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {60396C62-02C2-45FE-98BD-4A16E076722B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {60396C62-02C2-45FE-98BD-4A16E076722B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {60396C62-02C2-45FE-98BD-4A16E076722B}.Release|Any CPU.Build.0 = Release|Any CPU + {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Release|Any CPU.Build.0 = Release|Any CPU + {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E}.Release|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Community.CsharpSqlite.SQLiteClient.WP/Properties/AssemblyInfo.cs b/Community.CsharpSqlite.SQLiteClient.WP/Properties/AssemblyInfo.cs index f6e25ce..8cc6db8 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/Properties/AssemblyInfo.cs +++ b/Community.CsharpSqlite.SQLiteClient.WP/Properties/AssemblyInfo.cs @@ -1,35 +1,35 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Community.CsharpSqlite.SQLiteClient.WP")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Community.CsharpSqlite.SQLiteClient.WP")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("881c47fa-c32a-40df-8c40-6410189eeedd")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Community.CsharpSqlite.SQLiteClient.WP")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Community.CsharpSqlite.SQLiteClient.WP")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("881c47fa-c32a-40df-8c40-6410189eeedd")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/App.xaml b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/App.xaml index 83c77ea..3d21607 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/App.xaml +++ b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/App.xaml @@ -1,19 +1,19 @@ - - - - - - - - - - - + + + + + + + + + + + \ No newline at end of file diff --git a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/App.xaml.cs b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/App.xaml.cs index 8f7233c..a094e0b 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/App.xaml.cs +++ b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/App.xaml.cs @@ -1,135 +1,135 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Navigation; -using System.Windows.Shapes; -using Microsoft.Phone.Controls; -using Microsoft.Phone.Shell; - -namespace Test.WP -{ - public partial class App : Application - { - /// - /// Provides easy access to the root frame of the Phone Application. - /// - /// The root frame of the Phone Application. - public PhoneApplicationFrame RootFrame { get; private set; } - - /// - /// Constructor for the Application object. - /// - public App() - { - // Global handler for uncaught exceptions. - UnhandledException += Application_UnhandledException; - - // Show graphics profiling information while debugging. - if (System.Diagnostics.Debugger.IsAttached) - { - // Display the current frame rate counters. - Application.Current.Host.Settings.EnableFrameRateCounter = true; - - // Show the areas of the app that are being redrawn in each frame. - //Application.Current.Host.Settings.EnableRedrawRegions = true; - - // Enable non-production analysis visualization mode, - // which shows areas of a page that are being GPU accelerated with a colored overlay. - //Application.Current.Host.Settings.EnableCacheVisualization = true; - } - - // Standard Silverlight initialization - InitializeComponent(); - - // Phone-specific initialization - InitializePhoneApplication(); - } - - // Code to execute when the application is launching (eg, from Start) - // This code will not execute when the application is reactivated - private void Application_Launching(object sender, LaunchingEventArgs e) - { - } - - // Code to execute when the application is activated (brought to foreground) - // This code will not execute when the application is first launched - private void Application_Activated(object sender, ActivatedEventArgs e) - { - } - - // Code to execute when the application is deactivated (sent to background) - // This code will not execute when the application is closing - private void Application_Deactivated(object sender, DeactivatedEventArgs e) - { - } - - // Code to execute when the application is closing (eg, user hit Back) - // This code will not execute when the application is deactivated - private void Application_Closing(object sender, ClosingEventArgs e) - { - } - - // Code to execute if a navigation fails - private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) - { - if (System.Diagnostics.Debugger.IsAttached) - { - // A navigation has failed; break into the debugger - System.Diagnostics.Debugger.Break(); - } - } - - // Code to execute on Unhandled Exceptions - private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) - { - if (System.Diagnostics.Debugger.IsAttached) - { - // An unhandled exception has occurred; break into the debugger - System.Diagnostics.Debugger.Break(); - } - } - - #region Phone application initialization - - // Avoid double-initialization - private bool phoneApplicationInitialized = false; - - // Do not add any additional code to this method - private void InitializePhoneApplication() - { - if (phoneApplicationInitialized) - return; - - // Create the frame but don't set it as RootVisual yet; this allows the splash - // screen to remain active until the application is ready to render. - RootFrame = new PhoneApplicationFrame(); - RootFrame.Navigated += CompleteInitializePhoneApplication; - - // Handle navigation failures - RootFrame.NavigationFailed += RootFrame_NavigationFailed; - - // Ensure we don't initialize again - phoneApplicationInitialized = true; - } - - // Do not add any additional code to this method - private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) - { - // Set the root visual to allow the application to render - if (RootVisual != RootFrame) - RootVisual = RootFrame; - - // Remove this handler since it is no longer needed - RootFrame.Navigated -= CompleteInitializePhoneApplication; - } - - #endregion - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Navigation; +using System.Windows.Shapes; +using Microsoft.Phone.Controls; +using Microsoft.Phone.Shell; + +namespace Test.WP +{ + public partial class App : Application + { + /// + /// Provides easy access to the root frame of the Phone Application. + /// + /// The root frame of the Phone Application. + public PhoneApplicationFrame RootFrame { get; private set; } + + /// + /// Constructor for the Application object. + /// + public App() + { + // Global handler for uncaught exceptions. + UnhandledException += Application_UnhandledException; + + // Show graphics profiling information while debugging. + if (System.Diagnostics.Debugger.IsAttached) + { + // Display the current frame rate counters. + Application.Current.Host.Settings.EnableFrameRateCounter = true; + + // Show the areas of the app that are being redrawn in each frame. + //Application.Current.Host.Settings.EnableRedrawRegions = true; + + // Enable non-production analysis visualization mode, + // which shows areas of a page that are being GPU accelerated with a colored overlay. + //Application.Current.Host.Settings.EnableCacheVisualization = true; + } + + // Standard Silverlight initialization + InitializeComponent(); + + // Phone-specific initialization + InitializePhoneApplication(); + } + + // Code to execute when the application is launching (eg, from Start) + // This code will not execute when the application is reactivated + private void Application_Launching(object sender, LaunchingEventArgs e) + { + } + + // Code to execute when the application is activated (brought to foreground) + // This code will not execute when the application is first launched + private void Application_Activated(object sender, ActivatedEventArgs e) + { + } + + // Code to execute when the application is deactivated (sent to background) + // This code will not execute when the application is closing + private void Application_Deactivated(object sender, DeactivatedEventArgs e) + { + } + + // Code to execute when the application is closing (eg, user hit Back) + // This code will not execute when the application is deactivated + private void Application_Closing(object sender, ClosingEventArgs e) + { + } + + // Code to execute if a navigation fails + private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) + { + if (System.Diagnostics.Debugger.IsAttached) + { + // A navigation has failed; break into the debugger + System.Diagnostics.Debugger.Break(); + } + } + + // Code to execute on Unhandled Exceptions + private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e) + { + if (System.Diagnostics.Debugger.IsAttached) + { + // An unhandled exception has occurred; break into the debugger + System.Diagnostics.Debugger.Break(); + } + } + + #region Phone application initialization + + // Avoid double-initialization + private bool phoneApplicationInitialized = false; + + // Do not add any additional code to this method + private void InitializePhoneApplication() + { + if (phoneApplicationInitialized) + return; + + // Create the frame but don't set it as RootVisual yet; this allows the splash + // screen to remain active until the application is ready to render. + RootFrame = new PhoneApplicationFrame(); + RootFrame.Navigated += CompleteInitializePhoneApplication; + + // Handle navigation failures + RootFrame.NavigationFailed += RootFrame_NavigationFailed; + + // Ensure we don't initialize again + phoneApplicationInitialized = true; + } + + // Do not add any additional code to this method + private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) + { + // Set the root visual to allow the application to render + if (RootVisual != RootFrame) + RootVisual = RootFrame; + + // Remove this handler since it is no longer needed + RootFrame.Navigated -= CompleteInitializePhoneApplication; + } + + #endregion + } } \ No newline at end of file diff --git a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/MainPage.xaml b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/MainPage.xaml index 58916e8..6d628ac 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/MainPage.xaml +++ b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/MainPage.xaml @@ -1,46 +1,46 @@ - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/MainPage.xaml.cs b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/MainPage.xaml.cs index 94bea2b..941114f 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/MainPage.xaml.cs +++ b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/MainPage.xaml.cs @@ -1,56 +1,56 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Windows; -using System.Windows.Controls; -using System.Windows.Documents; -using System.Windows.Input; -using System.Windows.Media; -using System.Windows.Media.Animation; -using System.Windows.Shapes; -using Microsoft.Phone.Controls; -using System.Data; -using Community.CsharpSqlite.SQLiteClient; -using test; - -namespace Test.WP -{ - public partial class MainPage : PhoneApplicationPage - { - // Constructor - public MainPage() - { - InitializeComponent(); - this.Loaded += new RoutedEventHandler(MainPage_Loaded); - } - - public void WriteLine(String value) - { - this.listBox1.Items.Add(value);// + Environment.NewLine; - } - - protected void MainPage_Loaded(object sender, EventArgs e) - { - - //SQLiteClientTests.SQLiteClientTestDriver.Main(null); - IDbConnection cnn; - - try - { - System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication().DeleteFile("test.db3"); - } - catch { } - - - using (cnn = new SqliteConnection()) - { - TestCases tests = new TestCases(); - - cnn.ConnectionString = "data source=test.db3,password=0x01010101010101010101010101010101"; - cnn.Open(); - tests.Run(cnn, this); - } - } - } +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Animation; +using System.Windows.Shapes; +using Microsoft.Phone.Controls; +using System.Data; +using Community.CsharpSqlite.SQLiteClient; +using test; + +namespace Test.WP +{ + public partial class MainPage : PhoneApplicationPage + { + // Constructor + public MainPage() + { + InitializeComponent(); + this.Loaded += new RoutedEventHandler(MainPage_Loaded); + } + + public void WriteLine(String value) + { + this.listBox1.Items.Add(value);// + Environment.NewLine; + } + + protected void MainPage_Loaded(object sender, EventArgs e) + { + + //SQLiteClientTests.SQLiteClientTestDriver.Main(null); + IDbConnection cnn; + + try + { + System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication().DeleteFile("test.db3"); + } + catch { } + + + using (cnn = new SqliteConnection()) + { + TestCases tests = new TestCases(); + + cnn.ConnectionString = "data source=test.db3,password=0x01010101010101010101010101010101"; + cnn.Open(); + tests.Run(cnn, this); + } + } + } } \ No newline at end of file diff --git a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/AppManifest.xml b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/AppManifest.xml index a955232..6712a11 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/AppManifest.xml +++ b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/AppManifest.xml @@ -1,6 +1,6 @@ - - - - + + + + diff --git a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/AssemblyInfo.cs b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/AssemblyInfo.cs index 041e832..137b9fc 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/AssemblyInfo.cs +++ b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/AssemblyInfo.cs @@ -1,35 +1,35 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Test.WP")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Test.WP")] -[assembly: AssemblyCopyright("Copyright © 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("eae25b4d-6f80-4c3c-8dad-41fba9f64f70")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Test.WP")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Test.WP")] +[assembly: AssemblyCopyright("Copyright © 2010")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("eae25b4d-6f80-4c3c-8dad-41fba9f64f70")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/WMAppManifest.xml b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/WMAppManifest.xml index 6efb016..36bc8f8 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/WMAppManifest.xml +++ b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/Properties/WMAppManifest.xml @@ -1,32 +1,32 @@ - - - - - ApplicationIcon.png - - - - - - - - - - - - - - - - - - - - Background.png - 0 - Test.WP - - - - - + + + + + ApplicationIcon.png + + + + + + + + + + + + + + + + + + + + Background.png + 0 + Test.WP + + + + + diff --git a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/SQLiteClientTests.WinPhone.csproj b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/SQLiteClientTests.WinPhone.csproj index 827efea..f54a44b 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/SQLiteClientTests.WinPhone.csproj +++ b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/SQLiteClientTests.WinPhone.csproj @@ -1,121 +1,121 @@ - - - - Debug - AnyCPU - 10.0.20506 - 2.0 - {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E} - {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Test.WP - Test.WP - v4.0 - $(TargetFrameworkVersion) - WindowsPhone - Silverlight - true - - - true - true - Test.WP.xap - Properties\AppManifest.xml - Test.WP.App - true - true - - - true - full - false - Bin\Debug - TRACE;DEBUG;SQLITE_DEBUG SQLITE_SILVERLIGHT WINDOWS_PHONE - true - true - prompt - 4 - - - pdbonly - true - Bin\Release - TRACE;SQLITE_SILVERLIGHT;WINDOWS_PHONE - true - true - prompt - 4 - - - - - - - - - - - - - src\SQLiteClientTestDriver.cs - - - App.xaml - - - MainPage.xaml - - - - Code - - - - - Designer - MSBuild:Compile - - - Designer - MSBuild:Compile - - - - - - - - - PreserveNewest - - - PreserveNewest - - - - - - {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9} - Community.CsharpSqlite.WinPhone - - - {60396C62-02C2-45FE-98BD-4A16E076722B} - System.Data.Ersatz.WinPhone - - - {22E602F9-ADB6-4B94-B980-40EB1E83BE8B} - Community.CsharpSqlite.SQLiteClient.WP - - - - - - + + + + Debug + AnyCPU + 10.0.20506 + 2.0 + {C1A7EA2C-8FAE-46F3-BBE1-AFD6DDB81A3E} + {C089C8C0-30E0-4E22-80C0-CE093F111A43};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Test.WP + Test.WP + v4.0 + $(TargetFrameworkVersion) + WindowsPhone + Silverlight + true + + + true + true + Test.WP.xap + Properties\AppManifest.xml + Test.WP.App + true + true + + + true + full + false + Bin\Debug + TRACE;DEBUG;SQLITE_DEBUG SQLITE_SILVERLIGHT WINDOWS_PHONE + true + true + prompt + 4 + + + pdbonly + true + Bin\Release + TRACE;SQLITE_SILVERLIGHT;WINDOWS_PHONE + true + true + prompt + 4 + + + + + + + + + + + + + src\SQLiteClientTestDriver.cs + + + App.xaml + + + MainPage.xaml + + + + Code + + + + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + + + + + + + + + PreserveNewest + + + PreserveNewest + + + + + + {A1CF8CB2-DB66-4036-AB1F-9D205D5C93E9} + Community.CsharpSqlite.WinPhone + + + {60396C62-02C2-45FE-98BD-4A16E076722B} + System.Data.Ersatz.WinPhone + + + {22E602F9-ADB6-4B94-B980-40EB1E83BE8B} + Community.CsharpSqlite.SQLiteClient.WP + + + + + + \ No newline at end of file diff --git a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/TestCases.cs b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/TestCases.cs index 4f7780f..25325a4 100644 --- a/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/TestCases.cs +++ b/Community.CsharpSqlite.SQLiteClient.WP/SQLiteClientTests/TestCases.cs @@ -1,821 +1,821 @@ -using System; -using System.Data.Common; -using System.Data; -using Community.CsharpSqlite.SQLiteClient; - -namespace test -{ - - /// - /// Scalar user-defined function. In this example, the same class is declared twice with - /// different function names to demonstrate how to use alias names for user-defined functions. - /// - //[SQLiteFunction(Name = "Foo", Arguments = 2, FuncType = FunctionType.Scalar)] - //[SQLiteFunction(Name = "TestFunc", Arguments = 2, FuncType = FunctionType.Scalar)] - class TestFunc// : SQLiteFunction - { - public object Invoke(object[] args) - { - if (args[0].GetType() != typeof(int)) return args[0]; - - int Param1 = Convert.ToInt32(args[0]); // First parameter - int Param2 = Convert.ToInt32(args[1]); // Second parameter - - return Param1 + Param2; - } - } - - /// - /// Aggregate user-defined function. Arguments = -1 means any number of arguments is acceptable - /// - // [SQLiteFunction(Name = "MyCount", Arguments = -1, FuncType = FunctionType.Aggregate)] - class MyCount //: SQLiteFunction - { - public void Step(object[] args, int nStep, ref object contextData) - { - if (contextData == null) - { - contextData = 1; - } - else - contextData = (int)contextData + 1; - } - - public object Final(object contextData) - { - return contextData; - } - } - - /// - /// User-defined collating sequence. - /// - //[SQLiteFunction(Name = "MYSEQUENCE", FuncType = FunctionType.Collation)] - class MySequence // : SQLiteFunction - { - public int Compare(string param1, string param2) - { - // Make sure the string "Field3" is sorted out of order - if (param1 == "Field3") return 1; - if (param2 == "Field3") return -1; - return String.Compare(param1, param2); - } - } - - internal class TestCases - { - internal Test.WP.MainPage frm; - - internal void Run(IDbConnection cnn, Test.WP.MainPage frm2) - { - - frm = frm2; - // frm.Show(); - - frm.WriteLine("\r\nBeginning Test on " + cnn.GetType().ToString()); - try { CreateTable(cnn); frm.WriteLine("SUCCESS - CreateTable"); } - catch (Exception) { frm.WriteLine("FAIL - CreateTable"); } - - try { DataTypeTest(cnn); frm.WriteLine("SUCCESS - DataType Test"); } - catch (Exception) { frm.WriteLine("FAIL - DataType Test"); } - - //not enabled yet - //try { FullTextTest(cnn); frm.WriteLine("SUCCESS - Full Text Search"); } - //catch (Exception) { frm.WriteLine("FAIL - Full Text Search"); } - - //Not possible without datatable to reade the schema - //try { KeyInfoTest(cnn); frm.WriteLine("SUCCESS - KeyInfo Fetch"); } - //catch (Exception) { frm.WriteLine("FAIL - KeyInfo Fetch"); } - - try { InsertTable(cnn); frm.WriteLine("SUCCESS - InsertTable"); } - catch (Exception) { frm.WriteLine("FAIL - InsertTable"); } - - try { VerifyInsert(cnn); frm.WriteLine("SUCCESS - VerifyInsert"); } - catch (Exception) { frm.WriteLine("FAIL - VerifyInsert"); } - - try { CoersionTest(cnn); frm.WriteLine("FAIL - CoersionTest"); } - catch (Exception) { frm.WriteLine("SUCCESS - CoersionTest"); } - - try { ParameterizedInsert(cnn); frm.WriteLine("SUCCESS - ParameterizedInsert"); } - catch (Exception) { frm.WriteLine("FAIL - ParameterizedInsert"); } - - try { BinaryInsert(cnn); frm.WriteLine("SUCCESS - BinaryInsert"); } - catch (Exception) { frm.WriteLine("FAIL - BinaryInsert"); } - - try { VerifyBinaryData(cnn); frm.WriteLine("SUCCESS - VerifyBinaryData"); } - catch (Exception) { frm.WriteLine("FAIL - VerifyBinaryData"); } - - try { LockTest(cnn); frm.WriteLine("SUCCESS - LockTest"); } - catch (Exception) { frm.WriteLine("FAIL - LockTest"); } - - try { ParameterizedInsertMissingParams(cnn); frm.WriteLine("FAIL - ParameterizedInsertMissingParams"); } - catch (Exception) { frm.WriteLine("SUCCESS - ParameterizedInsertMissingParams"); } - - //try { InsertMany(cnn, false); frm.WriteLine("SUCCESS - InsertMany"); } - //catch (Exception) { frm.WriteLine("FAIL - InsertMany"); } - - //try { InsertMany(cnn, true); frm.WriteLine("SUCCESS - InsertManyWithIdentityFetch"); } - //catch (Exception) { frm.WriteLine("FAIL - InsertManyWithIdentityFetch"); } - - try { FastInsertMany(cnn); frm.WriteLine("SUCCESS - FastInsertMany"); } - catch (Exception) { frm.WriteLine("FAIL - FastInsertMany"); } - - //try { IterationTest(cnn); frm.WriteLine("SUCCESS - Iteration Test"); } - //catch (Exception) { frm.WriteLine("FAIL - Iteration Test"); } - - //try { UserFunction(cnn); frm.WriteLine("SUCCESS - UserFunction"); } - //catch (Exception) { frm.WriteLine("FAIL - UserFunction"); } - - //try { UserAggregate(cnn); frm.WriteLine("SUCCESS - UserAggregate"); } - //catch (Exception) { frm.WriteLine("FAIL - UserAggregate"); } - - //try { UserCollation(cnn); frm.WriteLine("SUCCESS - UserCollation"); } - //catch (Exception) { frm.WriteLine("FAIL - UserCollation"); } - - try { DropTable(cnn); frm.WriteLine("SUCCESS - DropTable"); } - catch (Exception) { frm.WriteLine("FAIL - DropTable"); } - - frm.WriteLine("\r\nTests Finished."); - } - - internal static void KeyInfoTest(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - // First test against integer primary key (optimized) keyinfo fetch - cmd.CommandText = "Create table keyinfotest (id integer primary key, myuniquevalue integer unique not null, myvalue varchar(50))"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "Select * from keyinfotest"; - using (IDataReader reader = cmd.ExecuteReader(CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly)) - { - if (reader.FieldCount != 3) throw new ArgumentOutOfRangeException("Wrong number of columns returned"); - } - - cmd.CommandText = "SELECT MyValue FROM keyinfotest"; - using (IDataReader reader = cmd.ExecuteReader(CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly)) - { - if (reader.FieldCount != 2) throw new ArgumentOutOfRangeException("Wrong number of columns returned"); - } - - cmd.CommandText = "DROP TABLE keyinfotest"; - cmd.ExecuteNonQuery(); - - // Now test against non-integer primary key (unoptimized) subquery keyinfo fetch - cmd.CommandText = "Create table keyinfotest (id char primary key, myuniquevalue integer unique not null, myvalue varchar(50))"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "SELECT MyValue FROM keyinfotest"; - using (IDataReader reader = cmd.ExecuteReader(CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly)) - { - if (reader.FieldCount != 2) throw new ArgumentOutOfRangeException("Wrong number of columns returned"); - } - - cmd.CommandText = "Select * from keyinfotest"; - using (IDataReader reader = cmd.ExecuteReader(CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly)) - { - if (reader.FieldCount != 3) throw new ArgumentOutOfRangeException("Wrong number of columns returned"); - } - - //// Make sure commandbuilder can generate an update command with the correct parameter count - //using (DbDataAdapter adp = new SQLiteDataAdapter()) - //using (DbCommandBuilder builder = new SQLiteCommandBuilder()) - //{ - // adp.SelectCommand = cmd; - // builder.DataAdapter = adp; - // builder.ConflictOption = ConflictOption.OverwriteChanges; - - // using (IDbCommand updatecmd = builder.GetUpdateCommand()) - // { - // if (updatecmd.Parameters.Count != 4) - // throw new ArgumentOutOfRangeException("Wrong number of parameters in update command!"); - // } - //} - } - } - - internal static void DataTypeTest(IDbConnection cnn) - { - DateTime now = DateTime.Now; - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "create table datatypetest(id integer primary key, myvalue, datetimevalue datetime, decimalvalue decimal)"; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "insert into datatypetest(myvalue, datetimevalue, decimalvalue) values(?,?,?)"; - IDbDataParameter p1 = cmd.CreateParameter(); - IDbDataParameter p2 = cmd.CreateParameter(); - IDbDataParameter p3 = cmd.CreateParameter(); - - cmd.Parameters.Add(p1); - cmd.Parameters.Add(p2); - cmd.Parameters.Add(p3); - - p1.Value = 1; - p2.Value = DateTime.MinValue; - p3.Value = (Decimal)1.05; - cmd.ExecuteNonQuery(); - - //p1.ResetDbType(); - //p2.ResetDbType(); - //p3.ResetDbType(); - - p1.Value = "One"; - p2.Value = "2001-01-01"; - p3.Value = (float)1.123; - cmd.ExecuteNonQuery(); - - //p1.ResetDbType(); - //p2.ResetDbType(); - //p3.ResetDbType(); - - p1.Value = 1.01; - DateTime nw = now; - p2.Value = nw; - p3.Value = (Double )9.91; - cmd.ExecuteNonQuery(); - - cmd.CommandText = "select myvalue, datetimevalue, decimalvalue from datatypetest"; - using (IDataReader reader = cmd.ExecuteReader()) - { - for (int n = 0; n < 3; n++) - { - reader.Read(); - if (reader.GetValue(1).GetType() != reader.GetDateTime(1).GetType()) throw new ArgumentOutOfRangeException(); - if (reader.GetValue(2).GetType() != reader.GetDouble(2).GetType()) throw new ArgumentOutOfRangeException(); - - switch (n) - { - case 0: - if (reader.GetValue(0).GetType() != typeof(long)) throw new ArgumentOutOfRangeException(); - - if (reader.GetValue(0).Equals((long)1) == false) throw new ArgumentOutOfRangeException(); - if (reader.GetValue(1).Equals(DateTime.MinValue) == false) throw new ArgumentOutOfRangeException(); - if (reader.GetDecimal(2).Equals((Decimal)1.05) == false) throw new ArgumentOutOfRangeException(); - - if (reader.GetInt64(0) != (long)1) throw new ArgumentOutOfRangeException(); - if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new ArgumentOutOfRangeException(); - if (reader.GetValue(2).Equals(reader.GetDouble(2)) == false) throw new ArgumentOutOfRangeException(); - break; - case 1: - if (reader.GetValue(0).GetType() != typeof(string)) throw new ArgumentOutOfRangeException(); - if (reader.GetValue(0).Equals("One") == false) throw new ArgumentOutOfRangeException(); - if (reader.GetValue(1).Equals(new DateTime(2001, 1, 1)) == false) throw new ArgumentOutOfRangeException(); - if (reader.GetFloat(2).Equals((float)1.123) == false) throw new ArgumentOutOfRangeException(); - - if (reader.GetString(0) != "One") throw new ArgumentOutOfRangeException(); - if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new ArgumentOutOfRangeException(); - if (reader.GetValue(2).Equals(reader.GetDouble(2)) == false) throw new ArgumentOutOfRangeException(); - break; - case 2: - if (reader.GetValue(0).GetType() != typeof(double)) throw new ArgumentOutOfRangeException(); - if (reader.GetValue(0).Equals(1.01) == false) throw new ArgumentOutOfRangeException(); - //Something weird comparing datetime values... - if (((DateTime)reader.GetValue(1)).ToString("s").Equals(nw.ToString("s")) == false) throw new ArgumentOutOfRangeException(); - if (reader.GetDouble(2).Equals((Double)9.91) == false) throw new ArgumentOutOfRangeException(); - - if (reader.GetDouble(0) != 1.01) throw new ArgumentOutOfRangeException(); - if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new ArgumentOutOfRangeException(); - if (reader.GetValue(2).Equals(reader.GetDouble(2)) == false) throw new ArgumentOutOfRangeException(); - break; - } - } - } - } - } - - internal static void FullTextTest(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "CREATE VIRTUAL TABLE FullText USING FTS3(name, ingredients);"; - cmd.ExecuteNonQuery(); - - string[] names = { "broccoli stew", "pumpkin stew", "broccoli pie", "pumpkin pie" }; - string[] ingredients = { "broccoli peppers cheese tomatoes", "pumpkin onions garlic celery", "broccoli cheese onions flour", "pumpkin sugar flour butter" }; - int n; - - cmd.CommandText = "insert into FullText (name, ingredients) values (@name, @ingredient);"; - IDbDataParameter name = cmd.CreateParameter(); - IDbDataParameter ingredient = cmd.CreateParameter(); - - name.ParameterName = "@name"; - ingredient.ParameterName = "@ingredient"; - - cmd.Parameters.Add(name); - cmd.Parameters.Add(ingredient); - - for (n = 0; n < names.Length; n++) - { - name.Value = names[n]; - ingredient.Value = ingredients[n]; - - cmd.ExecuteNonQuery(); - } - - cmd.CommandText = "select rowid, name, ingredients from FullText where name match 'pie';"; - - int[] rowids = { 3, 4 }; - n = 0; - - using (IDataReader reader = cmd.ExecuteReader()) - { - while (reader.Read()) - { - if (reader.GetInt64(0) != rowids[n++]) - throw new ArgumentException("Unexpected rowid returned"); - - if (n > rowids.Length) throw new ArgumentException("Too many rows returned"); - } - } - } - } - - internal void CreateTable(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "CREATE TABLE TestCase (ID integer primary key autoincrement, Field1 Integer, Field2 Float, Field3 VARCHAR(50), Field4 CHAR(10), Field5 DateTime, Field6 Image)"; - //cmd.CommandText = "CREATE TABLE TestCase (ID bigint primary key identity, Field1 Integer, Field2 Float, Field3 VARCHAR(50), Field4 CHAR(10), Field5 DateTime, Field6 Image)"; - cmd.ExecuteNonQuery(); - } - } - - internal void DropTable(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "DROP TABLE TestCase"; - cmd.ExecuteNonQuery(); - } - } - - internal void InsertTable(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "INSERT INTO TestCase(Field1, Field2, Field3, Field4, Field5) VALUES(1, 3.14159, 'Field3', 'Field4', '2005-01-01 13:49:00')"; - cmd.ExecuteNonQuery(); - } - } - - internal void VerifyInsert(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "SELECT Field1, Field2, Field3, Field4, Field5 FROM TestCase"; - cmd.Prepare(); - using (IDataReader rd = cmd.ExecuteReader()) - { - if (rd.Read()) - { - long Field1 = rd.GetInt64(0); - double Field2 = rd.GetDouble(1); - string Field3 = rd.GetString(2); - string Field4 = rd.GetString(3).TrimEnd(); - DateTime Field5 = rd.GetDateTime(4); - - if (Field1 != 1) throw new ArgumentOutOfRangeException("Non-Match on Field1"); - if (Field2 != 3.14159) throw new ArgumentOutOfRangeException("Non-Match on Field2"); - if (Field3 != "Field3") throw new ArgumentOutOfRangeException("Non-Match on Field3"); - if (Field4 != "Field4") throw new ArgumentOutOfRangeException("Non-Match on Field4"); - if (Field5.CompareTo(DateTime.Parse("2005-01-01 13:49:00")) != 0) throw new ArgumentOutOfRangeException("Non-Match on Field5"); - } - else throw new ArgumentOutOfRangeException("No data in table"); - } - } - } - - internal void CoersionTest(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "SELECT Field1, Field2, Field3, Field4, Field5, 'A', 1, 1 + 1, 3.14159 FROM TestCase"; - using (IDataReader rd = cmd.ExecuteReader()) - { - if (rd.Read()) - { - object Field1 = rd.GetInt32(0); - object Field2 = rd.GetDouble(1); - object Field3 = rd.GetString(2); - object Field4 = rd.GetString(3).TrimEnd(); - object Field5 = rd.GetDateTime(4); - - // The next statement should cause an exception - Field1 = rd.GetString(0); - Field2 = rd.GetString(1); - Field3 = rd.GetString(2); - Field4 = rd.GetString(3); - Field5 = rd.GetString(4); - - Field1 = rd.GetInt32(0); - Field2 = rd.GetInt32(1); - Field3 = rd.GetInt32(2); - Field4 = rd.GetInt32(3); - Field5 = rd.GetInt32(4); - - Field1 = rd.GetDecimal(0); - Field2 = rd.GetDecimal(1); - Field3 = rd.GetDecimal(2); - Field4 = rd.GetDecimal(3); - Field5 = rd.GetDecimal(4); - } - else throw new ArgumentOutOfRangeException("No data in table"); - } - } - } - - internal void ParameterizedInsert(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "INSERT INTO TestCase(Field1, Field2, Field3, Field4, Field5) VALUES(?,?,?,?,?)"; - IDbDataParameter Field1 = cmd.CreateParameter(); - IDbDataParameter Field2 = cmd.CreateParameter(); - IDbDataParameter Field3 = cmd.CreateParameter(); - IDbDataParameter Field4 = cmd.CreateParameter(); - IDbDataParameter Field5 = cmd.CreateParameter(); - - Field1.Value = 2; - Field2.Value = 3.14159; - Field3.Value = "Param Field3"; - Field4.Value = "Field4 Par"; - Field5.Value = DateTime.Now; - - cmd.Parameters.Add(Field1); - cmd.Parameters.Add(Field2); - cmd.Parameters.Add(Field3); - cmd.Parameters.Add(Field4); - cmd.Parameters.Add(Field5); - - cmd.ExecuteNonQuery(); - } - } - - internal void BinaryInsert(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "INSERT INTO TestCase(Field6) VALUES(?)"; - IDbDataParameter Field6 = cmd.CreateParameter(); - - byte[] b = new byte[4000]; - b[0] = 1; - b[100] = 2; - b[1000] = 3; - b[2000] = 4; - b[3000] = 5; - - Field6.Value = b; - - cmd.Parameters.Add(Field6); - - cmd.ExecuteNonQuery(); - } - } - - internal void VerifyBinaryData(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "SELECT Field6 FROM TestCase WHERE Field6 IS NOT NULL"; - byte[] b = new byte[4000]; - - using (IDataReader rd = cmd.ExecuteReader()) - { - if (rd.Read() == false) throw new ArgumentOutOfRangeException(); - - rd.GetBytes(0, 0, b, 0, 4000); - - if (b[0] != 1) throw new ArgumentException(); - if (b[100] != 2) throw new ArgumentException(); - if (b[1000] != 3) throw new ArgumentException(); - if (b[2000] != 4) throw new ArgumentException(); - if (b[3000] != 5) throw new ArgumentException(); - } - } - } - - internal static void LockTest(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "SELECT Field6 FROM TestCase WHERE Field6 IS NOT NULL"; - byte[] b = new byte[4000]; - - using (IDataReader rd = cmd.ExecuteReader()) - { - if (rd.Read() == false) throw new ArgumentOutOfRangeException(); - - rd.GetBytes(0, 0, b, 0, 4000); - - if (b[0] != 1) throw new ArgumentException(); - if (b[100] != 2) throw new ArgumentException(); - if (b[1000] != 3) throw new ArgumentException(); - if (b[2000] != 4) throw new ArgumentException(); - if (b[3000] != 5) throw new ArgumentException(); - - using (IDbConnection clone = (IDbConnection)((ICloneable)cnn).Clone()) - { - using (IDbCommand newcmd = clone.CreateCommand()) - { - newcmd.CommandText = "DELETE FROM TestCase WHERE Field6 IS NULL"; - newcmd.CommandTimeout = 2; - int cmdStart = Environment.TickCount; - int cmdEnd; - - try - { - newcmd.ExecuteNonQuery(); // should fail because there's a reader on the database - throw new ArgumentException(); // If we got here, the test failed - } - catch - { - cmdEnd = Environment.TickCount; - //TODO: commandtimeout and retry on lock. - //if (cmdEnd - cmdStart < 2000 || cmdEnd - cmdStart > 3000) - //throw new ArgumentException(); // Didn't wait the right amount of time - } - } - } - } - } - } - - internal void ParameterizedInsertMissingParams(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "INSERT INTO TestCase(Field1, Field2, Field3, Field4, Field5) VALUES(?,?,?,?,?)"; - IDbDataParameter Field1 = cmd.CreateParameter(); - IDbDataParameter Field2 = cmd.CreateParameter(); - IDbDataParameter Field3 = cmd.CreateParameter(); - IDbDataParameter Field4 = cmd.CreateParameter(); - IDbDataParameter Field5 = cmd.CreateParameter(); - - Field1.DbType = System.Data.DbType.Int32; - - Field1.Value = 2; - Field2.Value = 3.14159; - Field3.Value = "Field3 Param"; - Field4.Value = "Field4 Par"; - Field5.Value = DateTime.Now; - - cmd.Parameters.Add(Field1); - cmd.Parameters.Add(Field2); - cmd.Parameters.Add(Field3); - cmd.Parameters.Add(Field4); - - // Assertion here, not enough parameters - cmd.ExecuteNonQuery(); - } - } - - // Utilizes the SQLiteCommandBuilder, which in turn utilizes SQLiteDataReader's GetSchemaTable() functionality - //internal void InsertMany(IDbConnection cnn, bool bWithIdentity) - //{ - // int nmax = 1000; - - // using (IDbTransaction dbTrans = cnn.BeginTransaction()) - // { - // using (DbDataAdapter adp = new SQLiteDataAdapter()) - // { - // using (IDbCommand cmd = cnn.CreateCommand()) - // { - // cmd.Transaction = dbTrans; - // cmd.CommandText = "SELECT * FROM TestCase WHERE 1=2"; - // adp.SelectCommand = cmd; - - // using (DbCommandBuilder bld = new SQLiteCommandBuilder()) - // { - // bld.DataAdapter = adp; - // using (adp.InsertCommand = (SQLiteCommand)((ICloneable)bld.GetInsertCommand()).Clone()) - // { - // bld.DataAdapter = null; - // if (bWithIdentity) - // { - // adp.InsertCommand.CommandText += ";SELECT last_insert_rowid() AS [ID]"; - // adp.InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord; - // } - - // using (DataTable tbl = new DataTable()) - // { - // adp.Fill(tbl); - // for (int n = 0; n < nmax; n++) - // { - // DataRow row = tbl.NewRow(); - // row[1] = n + nmax; - // tbl.Rows.Add(row); - // } - - // frm.Write(String.Format(" InsertMany{0} ({1} rows) Begins ... ", (bWithIdentity == true) ? "WithIdentityFetch" : " ", nmax)); - // int dtStart = Environment.TickCount; - // adp.Update(tbl); - // int dtEnd = Environment.TickCount; - // dtEnd -= dtStart; - // frm.Write(String.Format("Ends in {0} ms ... ", (dtEnd))); - - // dtStart = Environment.TickCount; - // dbTrans.Commit(); - // dtEnd = Environment.TickCount; - // dtEnd -= dtStart; - // frm.WriteLine(String.Format("Commits in {0} ms", (dtEnd))); - // } - // } - // } - // } - // } - // } - //} - - internal void FastInsertMany(IDbConnection cnn) - { - using (IDbTransaction dbTrans = cnn.BeginTransaction()) - { - int dtStart; - int dtEnd; - - using (IDbCommand cmd = cnn.CreateCommand()) - { - cmd.CommandText = "INSERT INTO TestCase(Field1) VALUES(?)"; - IDbDataParameter Field1 = cmd.CreateParameter(); - - cmd.Parameters.Add(Field1); - - frm.WriteLine("Fast insert using parameters and prepared "); - frm.WriteLine("statement-> (10,000 rows) Begins ... "); - dtStart = Environment.TickCount; - for (int n = 0; n < 10000; n++) - { - Field1.Value = n + 100000; - cmd.ExecuteNonQuery(); - } - - dtEnd = Environment.TickCount; - dtEnd -= dtStart; - frm.WriteLine(" -> Ends in "+dtEnd+" ms ... "); - } - - dtStart = Environment.TickCount; - dbTrans.Rollback(); - dtEnd = Environment.TickCount; - dtEnd -= dtStart; - frm.WriteLine("Rolled back in " + dtEnd + " ms"); - } - } - - // Causes the user-defined function to be called - internal void UserFunction(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - int nTimes; - int dtStart; - - nTimes = 0; - cmd.CommandText = "SELECT Foo('ee','foo')"; - dtStart = Environment.TickCount; - while (Environment.TickCount - dtStart < 1000) - { - cmd.ExecuteNonQuery(); - nTimes++; - } - frm.WriteLine(String.Format(" User (text) command executed {0} times in 1 second.", nTimes)); - - nTimes = 0; - cmd.CommandText = "SELECT Foo(10,11)"; - dtStart = Environment.TickCount; - while (Environment.TickCount - dtStart < 1000) - { - cmd.ExecuteNonQuery(); - nTimes++; - } - frm.WriteLine(String.Format(" UserFunction command executed {0} times in 1 second.", nTimes)); - - nTimes = 0; - cmd.CommandText = "SELECT ABS(1)"; - dtStart = Environment.TickCount; - while (Environment.TickCount - dtStart < 1000) - { - cmd.ExecuteNonQuery(); - nTimes++; - } - frm.WriteLine(String.Format(" Intrinsic command executed {0} times in 1 second.", nTimes)); - - nTimes = 0; - cmd.CommandText = "SELECT lower('FOO')"; - dtStart = Environment.TickCount; - while (Environment.TickCount - dtStart < 1000) - { - cmd.ExecuteNonQuery(); - nTimes++; - } - frm.WriteLine(String.Format(" Intrin (txt) command executed {0} times in 1 second.", nTimes)); - - nTimes = 0; - cmd.CommandText = "SELECT 1"; - dtStart = Environment.TickCount; - while (Environment.TickCount - dtStart < 1000) - { - cmd.ExecuteNonQuery(); - nTimes++; - } - frm.WriteLine(String.Format(" Raw Value command executed {0} times in 1 second.", nTimes)); - } - } - - internal void IterationTest(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - int dtStart; - int dtEnd; - int nCount; - long n; - - cmd.CommandText = "SELECT Foo(ID, ID) FROM TestCase"; - cmd.Prepare(); - dtStart = Environment.TickCount; - nCount = 0; - using (IDataReader rd = cmd.ExecuteReader()) - { - while (rd.Read()) - { - n = rd.GetInt64(0); - nCount++; - } - dtEnd = Environment.TickCount; - } - frm.WriteLine(String.Format(" User Function iteration of {0} records in {1} ms", nCount, (dtEnd - dtStart))); - - cmd.CommandText = "SELECT ID FROM TestCase"; - cmd.Prepare(); - dtStart = Environment.TickCount; - nCount = 0; - using (IDataReader rd = cmd.ExecuteReader()) - { - while (rd.Read()) - { - n = rd.GetInt64(0); - nCount++; - } - dtEnd = Environment.TickCount; - } - frm.WriteLine(String.Format(" Raw iteration of {0} records in {1} ms", nCount, (dtEnd - dtStart))); - - cmd.CommandText = "SELECT ABS(ID) FROM TestCase"; - cmd.Prepare(); - dtStart = Environment.TickCount; - nCount = 0; - using (IDataReader rd = cmd.ExecuteReader()) - { - while (rd.Read()) - { - n = rd.GetInt64(0); - nCount++; - } - dtEnd = Environment.TickCount; - } - frm.WriteLine(String.Format(" Intrinsic Function iteration of {0} records in {1} ms", nCount, (dtEnd - dtStart))); - - } - } - - // Causes the user-defined aggregate to be iterated through - internal void UserAggregate(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - int dtStart; - int n = 0; - int nCount; - - cmd.CommandText = "SELECT MyCount(*) FROM TestCase"; - - nCount = 0; - dtStart = Environment.TickCount; - while (Environment.TickCount - dtStart < 1000) - { - n = Convert.ToInt32(cmd.ExecuteScalar()); - nCount++; - } - if (n != 2003) throw new ArgumentOutOfRangeException("Unexpected count"); - frm.WriteLine(String.Format(" UserAggregate executed {0} times in 1 second.", nCount)); - } - } - - // Causes the user-defined collation sequence to be iterated through - internal void UserCollation(IDbConnection cnn) - { - using (IDbCommand cmd = cnn.CreateCommand()) - { - // Using a default collating sequence in descending order, "Param Field3" will appear at the top - // and "Field3" will be next, followed by a NULL. Our user-defined collating sequence will - // deliberately place them out of order so Field3 is first. - cmd.CommandText = "SELECT Field3 FROM TestCase ORDER BY Field3 COLLATE MYSEQUENCE DESC"; - string s = (string)cmd.ExecuteScalar(); - if (s != "Field3") throw new ArgumentOutOfRangeException("MySequence didn't sort properly"); - } - } - } -} +using System; +using System.Data.Common; +using System.Data; +using Community.CsharpSqlite.SQLiteClient; + +namespace test +{ + + /// + /// Scalar user-defined function. In this example, the same class is declared twice with + /// different function names to demonstrate how to use alias names for user-defined functions. + /// + //[SQLiteFunction(Name = "Foo", Arguments = 2, FuncType = FunctionType.Scalar)] + //[SQLiteFunction(Name = "TestFunc", Arguments = 2, FuncType = FunctionType.Scalar)] + class TestFunc// : SQLiteFunction + { + public object Invoke(object[] args) + { + if (args[0].GetType() != typeof(int)) return args[0]; + + int Param1 = Convert.ToInt32(args[0]); // First parameter + int Param2 = Convert.ToInt32(args[1]); // Second parameter + + return Param1 + Param2; + } + } + + /// + /// Aggregate user-defined function. Arguments = -1 means any number of arguments is acceptable + /// + // [SQLiteFunction(Name = "MyCount", Arguments = -1, FuncType = FunctionType.Aggregate)] + class MyCount //: SQLiteFunction + { + public void Step(object[] args, int nStep, ref object contextData) + { + if (contextData == null) + { + contextData = 1; + } + else + contextData = (int)contextData + 1; + } + + public object Final(object contextData) + { + return contextData; + } + } + + /// + /// User-defined collating sequence. + /// + //[SQLiteFunction(Name = "MYSEQUENCE", FuncType = FunctionType.Collation)] + class MySequence // : SQLiteFunction + { + public int Compare(string param1, string param2) + { + // Make sure the string "Field3" is sorted out of order + if (param1 == "Field3") return 1; + if (param2 == "Field3") return -1; + return String.Compare(param1, param2); + } + } + + internal class TestCases + { + internal Test.WP.MainPage frm; + + internal void Run(IDbConnection cnn, Test.WP.MainPage frm2) + { + + frm = frm2; + // frm.Show(); + + frm.WriteLine("\r\nBeginning Test on " + cnn.GetType().ToString()); + try { CreateTable(cnn); frm.WriteLine("SUCCESS - CreateTable"); } + catch (Exception) { frm.WriteLine("FAIL - CreateTable"); } + + try { DataTypeTest(cnn); frm.WriteLine("SUCCESS - DataType Test"); } + catch (Exception) { frm.WriteLine("FAIL - DataType Test"); } + + //not enabled yet + //try { FullTextTest(cnn); frm.WriteLine("SUCCESS - Full Text Search"); } + //catch (Exception) { frm.WriteLine("FAIL - Full Text Search"); } + + //Not possible without datatable to reade the schema + //try { KeyInfoTest(cnn); frm.WriteLine("SUCCESS - KeyInfo Fetch"); } + //catch (Exception) { frm.WriteLine("FAIL - KeyInfo Fetch"); } + + try { InsertTable(cnn); frm.WriteLine("SUCCESS - InsertTable"); } + catch (Exception) { frm.WriteLine("FAIL - InsertTable"); } + + try { VerifyInsert(cnn); frm.WriteLine("SUCCESS - VerifyInsert"); } + catch (Exception) { frm.WriteLine("FAIL - VerifyInsert"); } + + try { CoersionTest(cnn); frm.WriteLine("FAIL - CoersionTest"); } + catch (Exception) { frm.WriteLine("SUCCESS - CoersionTest"); } + + try { ParameterizedInsert(cnn); frm.WriteLine("SUCCESS - ParameterizedInsert"); } + catch (Exception) { frm.WriteLine("FAIL - ParameterizedInsert"); } + + try { BinaryInsert(cnn); frm.WriteLine("SUCCESS - BinaryInsert"); } + catch (Exception) { frm.WriteLine("FAIL - BinaryInsert"); } + + try { VerifyBinaryData(cnn); frm.WriteLine("SUCCESS - VerifyBinaryData"); } + catch (Exception) { frm.WriteLine("FAIL - VerifyBinaryData"); } + + try { LockTest(cnn); frm.WriteLine("SUCCESS - LockTest"); } + catch (Exception) { frm.WriteLine("FAIL - LockTest"); } + + try { ParameterizedInsertMissingParams(cnn); frm.WriteLine("FAIL - ParameterizedInsertMissingParams"); } + catch (Exception) { frm.WriteLine("SUCCESS - ParameterizedInsertMissingParams"); } + + //try { InsertMany(cnn, false); frm.WriteLine("SUCCESS - InsertMany"); } + //catch (Exception) { frm.WriteLine("FAIL - InsertMany"); } + + //try { InsertMany(cnn, true); frm.WriteLine("SUCCESS - InsertManyWithIdentityFetch"); } + //catch (Exception) { frm.WriteLine("FAIL - InsertManyWithIdentityFetch"); } + + try { FastInsertMany(cnn); frm.WriteLine("SUCCESS - FastInsertMany"); } + catch (Exception) { frm.WriteLine("FAIL - FastInsertMany"); } + + //try { IterationTest(cnn); frm.WriteLine("SUCCESS - Iteration Test"); } + //catch (Exception) { frm.WriteLine("FAIL - Iteration Test"); } + + //try { UserFunction(cnn); frm.WriteLine("SUCCESS - UserFunction"); } + //catch (Exception) { frm.WriteLine("FAIL - UserFunction"); } + + //try { UserAggregate(cnn); frm.WriteLine("SUCCESS - UserAggregate"); } + //catch (Exception) { frm.WriteLine("FAIL - UserAggregate"); } + + //try { UserCollation(cnn); frm.WriteLine("SUCCESS - UserCollation"); } + //catch (Exception) { frm.WriteLine("FAIL - UserCollation"); } + + try { DropTable(cnn); frm.WriteLine("SUCCESS - DropTable"); } + catch (Exception) { frm.WriteLine("FAIL - DropTable"); } + + frm.WriteLine("\r\nTests Finished."); + } + + internal static void KeyInfoTest(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + // First test against integer primary key (optimized) keyinfo fetch + cmd.CommandText = "Create table keyinfotest (id integer primary key, myuniquevalue integer unique not null, myvalue varchar(50))"; + cmd.ExecuteNonQuery(); + + cmd.CommandText = "Select * from keyinfotest"; + using (IDataReader reader = cmd.ExecuteReader(CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly)) + { + if (reader.FieldCount != 3) throw new ArgumentOutOfRangeException("Wrong number of columns returned"); + } + + cmd.CommandText = "SELECT MyValue FROM keyinfotest"; + using (IDataReader reader = cmd.ExecuteReader(CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly)) + { + if (reader.FieldCount != 2) throw new ArgumentOutOfRangeException("Wrong number of columns returned"); + } + + cmd.CommandText = "DROP TABLE keyinfotest"; + cmd.ExecuteNonQuery(); + + // Now test against non-integer primary key (unoptimized) subquery keyinfo fetch + cmd.CommandText = "Create table keyinfotest (id char primary key, myuniquevalue integer unique not null, myvalue varchar(50))"; + cmd.ExecuteNonQuery(); + + cmd.CommandText = "SELECT MyValue FROM keyinfotest"; + using (IDataReader reader = cmd.ExecuteReader(CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly)) + { + if (reader.FieldCount != 2) throw new ArgumentOutOfRangeException("Wrong number of columns returned"); + } + + cmd.CommandText = "Select * from keyinfotest"; + using (IDataReader reader = cmd.ExecuteReader(CommandBehavior.KeyInfo | CommandBehavior.SchemaOnly)) + { + if (reader.FieldCount != 3) throw new ArgumentOutOfRangeException("Wrong number of columns returned"); + } + + //// Make sure commandbuilder can generate an update command with the correct parameter count + //using (DbDataAdapter adp = new SQLiteDataAdapter()) + //using (DbCommandBuilder builder = new SQLiteCommandBuilder()) + //{ + // adp.SelectCommand = cmd; + // builder.DataAdapter = adp; + // builder.ConflictOption = ConflictOption.OverwriteChanges; + + // using (IDbCommand updatecmd = builder.GetUpdateCommand()) + // { + // if (updatecmd.Parameters.Count != 4) + // throw new ArgumentOutOfRangeException("Wrong number of parameters in update command!"); + // } + //} + } + } + + internal static void DataTypeTest(IDbConnection cnn) + { + DateTime now = DateTime.Now; + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "create table datatypetest(id integer primary key, myvalue, datetimevalue datetime, decimalvalue decimal)"; + cmd.ExecuteNonQuery(); + + cmd.CommandText = "insert into datatypetest(myvalue, datetimevalue, decimalvalue) values(?,?,?)"; + IDbDataParameter p1 = cmd.CreateParameter(); + IDbDataParameter p2 = cmd.CreateParameter(); + IDbDataParameter p3 = cmd.CreateParameter(); + + cmd.Parameters.Add(p1); + cmd.Parameters.Add(p2); + cmd.Parameters.Add(p3); + + p1.Value = 1; + p2.Value = DateTime.MinValue; + p3.Value = (Decimal)1.05; + cmd.ExecuteNonQuery(); + + //p1.ResetDbType(); + //p2.ResetDbType(); + //p3.ResetDbType(); + + p1.Value = "One"; + p2.Value = "2001-01-01"; + p3.Value = (float)1.123; + cmd.ExecuteNonQuery(); + + //p1.ResetDbType(); + //p2.ResetDbType(); + //p3.ResetDbType(); + + p1.Value = 1.01; + DateTime nw = now; + p2.Value = nw; + p3.Value = (Double )9.91; + cmd.ExecuteNonQuery(); + + cmd.CommandText = "select myvalue, datetimevalue, decimalvalue from datatypetest"; + using (IDataReader reader = cmd.ExecuteReader()) + { + for (int n = 0; n < 3; n++) + { + reader.Read(); + if (reader.GetValue(1).GetType() != reader.GetDateTime(1).GetType()) throw new ArgumentOutOfRangeException(); + if (reader.GetValue(2).GetType() != reader.GetDouble(2).GetType()) throw new ArgumentOutOfRangeException(); + + switch (n) + { + case 0: + if (reader.GetValue(0).GetType() != typeof(long)) throw new ArgumentOutOfRangeException(); + + if (reader.GetValue(0).Equals((long)1) == false) throw new ArgumentOutOfRangeException(); + if (reader.GetValue(1).Equals(DateTime.MinValue) == false) throw new ArgumentOutOfRangeException(); + if (reader.GetDecimal(2).Equals((Decimal)1.05) == false) throw new ArgumentOutOfRangeException(); + + if (reader.GetInt64(0) != (long)1) throw new ArgumentOutOfRangeException(); + if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new ArgumentOutOfRangeException(); + if (reader.GetValue(2).Equals(reader.GetDouble(2)) == false) throw new ArgumentOutOfRangeException(); + break; + case 1: + if (reader.GetValue(0).GetType() != typeof(string)) throw new ArgumentOutOfRangeException(); + if (reader.GetValue(0).Equals("One") == false) throw new ArgumentOutOfRangeException(); + if (reader.GetValue(1).Equals(new DateTime(2001, 1, 1)) == false) throw new ArgumentOutOfRangeException(); + if (reader.GetFloat(2).Equals((float)1.123) == false) throw new ArgumentOutOfRangeException(); + + if (reader.GetString(0) != "One") throw new ArgumentOutOfRangeException(); + if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new ArgumentOutOfRangeException(); + if (reader.GetValue(2).Equals(reader.GetDouble(2)) == false) throw new ArgumentOutOfRangeException(); + break; + case 2: + if (reader.GetValue(0).GetType() != typeof(double)) throw new ArgumentOutOfRangeException(); + if (reader.GetValue(0).Equals(1.01) == false) throw new ArgumentOutOfRangeException(); + //Something weird comparing datetime values... + if (((DateTime)reader.GetValue(1)).ToString("s").Equals(nw.ToString("s")) == false) throw new ArgumentOutOfRangeException(); + if (reader.GetDouble(2).Equals((Double)9.91) == false) throw new ArgumentOutOfRangeException(); + + if (reader.GetDouble(0) != 1.01) throw new ArgumentOutOfRangeException(); + if (reader.GetValue(1).Equals(reader.GetDateTime(1)) == false) throw new ArgumentOutOfRangeException(); + if (reader.GetValue(2).Equals(reader.GetDouble(2)) == false) throw new ArgumentOutOfRangeException(); + break; + } + } + } + } + } + + internal static void FullTextTest(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "CREATE VIRTUAL TABLE FullText USING FTS3(name, ingredients);"; + cmd.ExecuteNonQuery(); + + string[] names = { "broccoli stew", "pumpkin stew", "broccoli pie", "pumpkin pie" }; + string[] ingredients = { "broccoli peppers cheese tomatoes", "pumpkin onions garlic celery", "broccoli cheese onions flour", "pumpkin sugar flour butter" }; + int n; + + cmd.CommandText = "insert into FullText (name, ingredients) values (@name, @ingredient);"; + IDbDataParameter name = cmd.CreateParameter(); + IDbDataParameter ingredient = cmd.CreateParameter(); + + name.ParameterName = "@name"; + ingredient.ParameterName = "@ingredient"; + + cmd.Parameters.Add(name); + cmd.Parameters.Add(ingredient); + + for (n = 0; n < names.Length; n++) + { + name.Value = names[n]; + ingredient.Value = ingredients[n]; + + cmd.ExecuteNonQuery(); + } + + cmd.CommandText = "select rowid, name, ingredients from FullText where name match 'pie';"; + + int[] rowids = { 3, 4 }; + n = 0; + + using (IDataReader reader = cmd.ExecuteReader()) + { + while (reader.Read()) + { + if (reader.GetInt64(0) != rowids[n++]) + throw new ArgumentException("Unexpected rowid returned"); + + if (n > rowids.Length) throw new ArgumentException("Too many rows returned"); + } + } + } + } + + internal void CreateTable(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "CREATE TABLE TestCase (ID integer primary key autoincrement, Field1 Integer, Field2 Float, Field3 VARCHAR(50), Field4 CHAR(10), Field5 DateTime, Field6 Image)"; + //cmd.CommandText = "CREATE TABLE TestCase (ID bigint primary key identity, Field1 Integer, Field2 Float, Field3 VARCHAR(50), Field4 CHAR(10), Field5 DateTime, Field6 Image)"; + cmd.ExecuteNonQuery(); + } + } + + internal void DropTable(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "DROP TABLE TestCase"; + cmd.ExecuteNonQuery(); + } + } + + internal void InsertTable(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "INSERT INTO TestCase(Field1, Field2, Field3, Field4, Field5) VALUES(1, 3.14159, 'Field3', 'Field4', '2005-01-01 13:49:00')"; + cmd.ExecuteNonQuery(); + } + } + + internal void VerifyInsert(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "SELECT Field1, Field2, Field3, Field4, Field5 FROM TestCase"; + cmd.Prepare(); + using (IDataReader rd = cmd.ExecuteReader()) + { + if (rd.Read()) + { + long Field1 = rd.GetInt64(0); + double Field2 = rd.GetDouble(1); + string Field3 = rd.GetString(2); + string Field4 = rd.GetString(3).TrimEnd(); + DateTime Field5 = rd.GetDateTime(4); + + if (Field1 != 1) throw new ArgumentOutOfRangeException("Non-Match on Field1"); + if (Field2 != 3.14159) throw new ArgumentOutOfRangeException("Non-Match on Field2"); + if (Field3 != "Field3") throw new ArgumentOutOfRangeException("Non-Match on Field3"); + if (Field4 != "Field4") throw new ArgumentOutOfRangeException("Non-Match on Field4"); + if (Field5.CompareTo(DateTime.Parse("2005-01-01 13:49:00")) != 0) throw new ArgumentOutOfRangeException("Non-Match on Field5"); + } + else throw new ArgumentOutOfRangeException("No data in table"); + } + } + } + + internal void CoersionTest(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "SELECT Field1, Field2, Field3, Field4, Field5, 'A', 1, 1 + 1, 3.14159 FROM TestCase"; + using (IDataReader rd = cmd.ExecuteReader()) + { + if (rd.Read()) + { + object Field1 = rd.GetInt32(0); + object Field2 = rd.GetDouble(1); + object Field3 = rd.GetString(2); + object Field4 = rd.GetString(3).TrimEnd(); + object Field5 = rd.GetDateTime(4); + + // The next statement should cause an exception + Field1 = rd.GetString(0); + Field2 = rd.GetString(1); + Field3 = rd.GetString(2); + Field4 = rd.GetString(3); + Field5 = rd.GetString(4); + + Field1 = rd.GetInt32(0); + Field2 = rd.GetInt32(1); + Field3 = rd.GetInt32(2); + Field4 = rd.GetInt32(3); + Field5 = rd.GetInt32(4); + + Field1 = rd.GetDecimal(0); + Field2 = rd.GetDecimal(1); + Field3 = rd.GetDecimal(2); + Field4 = rd.GetDecimal(3); + Field5 = rd.GetDecimal(4); + } + else throw new ArgumentOutOfRangeException("No data in table"); + } + } + } + + internal void ParameterizedInsert(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "INSERT INTO TestCase(Field1, Field2, Field3, Field4, Field5) VALUES(?,?,?,?,?)"; + IDbDataParameter Field1 = cmd.CreateParameter(); + IDbDataParameter Field2 = cmd.CreateParameter(); + IDbDataParameter Field3 = cmd.CreateParameter(); + IDbDataParameter Field4 = cmd.CreateParameter(); + IDbDataParameter Field5 = cmd.CreateParameter(); + + Field1.Value = 2; + Field2.Value = 3.14159; + Field3.Value = "Param Field3"; + Field4.Value = "Field4 Par"; + Field5.Value = DateTime.Now; + + cmd.Parameters.Add(Field1); + cmd.Parameters.Add(Field2); + cmd.Parameters.Add(Field3); + cmd.Parameters.Add(Field4); + cmd.Parameters.Add(Field5); + + cmd.ExecuteNonQuery(); + } + } + + internal void BinaryInsert(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "INSERT INTO TestCase(Field6) VALUES(?)"; + IDbDataParameter Field6 = cmd.CreateParameter(); + + byte[] b = new byte[4000]; + b[0] = 1; + b[100] = 2; + b[1000] = 3; + b[2000] = 4; + b[3000] = 5; + + Field6.Value = b; + + cmd.Parameters.Add(Field6); + + cmd.ExecuteNonQuery(); + } + } + + internal void VerifyBinaryData(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "SELECT Field6 FROM TestCase WHERE Field6 IS NOT NULL"; + byte[] b = new byte[4000]; + + using (IDataReader rd = cmd.ExecuteReader()) + { + if (rd.Read() == false) throw new ArgumentOutOfRangeException(); + + rd.GetBytes(0, 0, b, 0, 4000); + + if (b[0] != 1) throw new ArgumentException(); + if (b[100] != 2) throw new ArgumentException(); + if (b[1000] != 3) throw new ArgumentException(); + if (b[2000] != 4) throw new ArgumentException(); + if (b[3000] != 5) throw new ArgumentException(); + } + } + } + + internal static void LockTest(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "SELECT Field6 FROM TestCase WHERE Field6 IS NOT NULL"; + byte[] b = new byte[4000]; + + using (IDataReader rd = cmd.ExecuteReader()) + { + if (rd.Read() == false) throw new ArgumentOutOfRangeException(); + + rd.GetBytes(0, 0, b, 0, 4000); + + if (b[0] != 1) throw new ArgumentException(); + if (b[100] != 2) throw new ArgumentException(); + if (b[1000] != 3) throw new ArgumentException(); + if (b[2000] != 4) throw new ArgumentException(); + if (b[3000] != 5) throw new ArgumentException(); + + using (IDbConnection clone = (IDbConnection)((ICloneable)cnn).Clone()) + { + using (IDbCommand newcmd = clone.CreateCommand()) + { + newcmd.CommandText = "DELETE FROM TestCase WHERE Field6 IS NULL"; + newcmd.CommandTimeout = 2; + int cmdStart = Environment.TickCount; + int cmdEnd; + + try + { + newcmd.ExecuteNonQuery(); // should fail because there's a reader on the database + throw new ArgumentException(); // If we got here, the test failed + } + catch + { + cmdEnd = Environment.TickCount; + //TODO: commandtimeout and retry on lock. + //if (cmdEnd - cmdStart < 2000 || cmdEnd - cmdStart > 3000) + //throw new ArgumentException(); // Didn't wait the right amount of time + } + } + } + } + } + } + + internal void ParameterizedInsertMissingParams(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "INSERT INTO TestCase(Field1, Field2, Field3, Field4, Field5) VALUES(?,?,?,?,?)"; + IDbDataParameter Field1 = cmd.CreateParameter(); + IDbDataParameter Field2 = cmd.CreateParameter(); + IDbDataParameter Field3 = cmd.CreateParameter(); + IDbDataParameter Field4 = cmd.CreateParameter(); + IDbDataParameter Field5 = cmd.CreateParameter(); + + Field1.DbType = System.Data.DbType.Int32; + + Field1.Value = 2; + Field2.Value = 3.14159; + Field3.Value = "Field3 Param"; + Field4.Value = "Field4 Par"; + Field5.Value = DateTime.Now; + + cmd.Parameters.Add(Field1); + cmd.Parameters.Add(Field2); + cmd.Parameters.Add(Field3); + cmd.Parameters.Add(Field4); + + // Assertion here, not enough parameters + cmd.ExecuteNonQuery(); + } + } + + // Utilizes the SQLiteCommandBuilder, which in turn utilizes SQLiteDataReader's GetSchemaTable() functionality + //internal void InsertMany(IDbConnection cnn, bool bWithIdentity) + //{ + // int nmax = 1000; + + // using (IDbTransaction dbTrans = cnn.BeginTransaction()) + // { + // using (DbDataAdapter adp = new SQLiteDataAdapter()) + // { + // using (IDbCommand cmd = cnn.CreateCommand()) + // { + // cmd.Transaction = dbTrans; + // cmd.CommandText = "SELECT * FROM TestCase WHERE 1=2"; + // adp.SelectCommand = cmd; + + // using (DbCommandBuilder bld = new SQLiteCommandBuilder()) + // { + // bld.DataAdapter = adp; + // using (adp.InsertCommand = (SQLiteCommand)((ICloneable)bld.GetInsertCommand()).Clone()) + // { + // bld.DataAdapter = null; + // if (bWithIdentity) + // { + // adp.InsertCommand.CommandText += ";SELECT last_insert_rowid() AS [ID]"; + // adp.InsertCommand.UpdatedRowSource = UpdateRowSource.FirstReturnedRecord; + // } + + // using (DataTable tbl = new DataTable()) + // { + // adp.Fill(tbl); + // for (int n = 0; n < nmax; n++) + // { + // DataRow row = tbl.NewRow(); + // row[1] = n + nmax; + // tbl.Rows.Add(row); + // } + + // frm.Write(String.Format(" InsertMany{0} ({1} rows) Begins ... ", (bWithIdentity == true) ? "WithIdentityFetch" : " ", nmax)); + // int dtStart = Environment.TickCount; + // adp.Update(tbl); + // int dtEnd = Environment.TickCount; + // dtEnd -= dtStart; + // frm.Write(String.Format("Ends in {0} ms ... ", (dtEnd))); + + // dtStart = Environment.TickCount; + // dbTrans.Commit(); + // dtEnd = Environment.TickCount; + // dtEnd -= dtStart; + // frm.WriteLine(String.Format("Commits in {0} ms", (dtEnd))); + // } + // } + // } + // } + // } + // } + //} + + internal void FastInsertMany(IDbConnection cnn) + { + using (IDbTransaction dbTrans = cnn.BeginTransaction()) + { + int dtStart; + int dtEnd; + + using (IDbCommand cmd = cnn.CreateCommand()) + { + cmd.CommandText = "INSERT INTO TestCase(Field1) VALUES(?)"; + IDbDataParameter Field1 = cmd.CreateParameter(); + + cmd.Parameters.Add(Field1); + + frm.WriteLine("Fast insert using parameters and prepared "); + frm.WriteLine("statement-> (10,000 rows) Begins ... "); + dtStart = Environment.TickCount; + for (int n = 0; n < 10000; n++) + { + Field1.Value = n + 100000; + cmd.ExecuteNonQuery(); + } + + dtEnd = Environment.TickCount; + dtEnd -= dtStart; + frm.WriteLine(" -> Ends in "+dtEnd+" ms ... "); + } + + dtStart = Environment.TickCount; + dbTrans.Rollback(); + dtEnd = Environment.TickCount; + dtEnd -= dtStart; + frm.WriteLine("Rolled back in " + dtEnd + " ms"); + } + } + + // Causes the user-defined function to be called + internal void UserFunction(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + int nTimes; + int dtStart; + + nTimes = 0; + cmd.CommandText = "SELECT Foo('ee','foo')"; + dtStart = Environment.TickCount; + while (Environment.TickCount - dtStart < 1000) + { + cmd.ExecuteNonQuery(); + nTimes++; + } + frm.WriteLine(String.Format(" User (text) command executed {0} times in 1 second.", nTimes)); + + nTimes = 0; + cmd.CommandText = "SELECT Foo(10,11)"; + dtStart = Environment.TickCount; + while (Environment.TickCount - dtStart < 1000) + { + cmd.ExecuteNonQuery(); + nTimes++; + } + frm.WriteLine(String.Format(" UserFunction command executed {0} times in 1 second.", nTimes)); + + nTimes = 0; + cmd.CommandText = "SELECT ABS(1)"; + dtStart = Environment.TickCount; + while (Environment.TickCount - dtStart < 1000) + { + cmd.ExecuteNonQuery(); + nTimes++; + } + frm.WriteLine(String.Format(" Intrinsic command executed {0} times in 1 second.", nTimes)); + + nTimes = 0; + cmd.CommandText = "SELECT lower('FOO')"; + dtStart = Environment.TickCount; + while (Environment.TickCount - dtStart < 1000) + { + cmd.ExecuteNonQuery(); + nTimes++; + } + frm.WriteLine(String.Format(" Intrin (txt) command executed {0} times in 1 second.", nTimes)); + + nTimes = 0; + cmd.CommandText = "SELECT 1"; + dtStart = Environment.TickCount; + while (Environment.TickCount - dtStart < 1000) + { + cmd.ExecuteNonQuery(); + nTimes++; + } + frm.WriteLine(String.Format(" Raw Value command executed {0} times in 1 second.", nTimes)); + } + } + + internal void IterationTest(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + int dtStart; + int dtEnd; + int nCount; + long n; + + cmd.CommandText = "SELECT Foo(ID, ID) FROM TestCase"; + cmd.Prepare(); + dtStart = Environment.TickCount; + nCount = 0; + using (IDataReader rd = cmd.ExecuteReader()) + { + while (rd.Read()) + { + n = rd.GetInt64(0); + nCount++; + } + dtEnd = Environment.TickCount; + } + frm.WriteLine(String.Format(" User Function iteration of {0} records in {1} ms", nCount, (dtEnd - dtStart))); + + cmd.CommandText = "SELECT ID FROM TestCase"; + cmd.Prepare(); + dtStart = Environment.TickCount; + nCount = 0; + using (IDataReader rd = cmd.ExecuteReader()) + { + while (rd.Read()) + { + n = rd.GetInt64(0); + nCount++; + } + dtEnd = Environment.TickCount; + } + frm.WriteLine(String.Format(" Raw iteration of {0} records in {1} ms", nCount, (dtEnd - dtStart))); + + cmd.CommandText = "SELECT ABS(ID) FROM TestCase"; + cmd.Prepare(); + dtStart = Environment.TickCount; + nCount = 0; + using (IDataReader rd = cmd.ExecuteReader()) + { + while (rd.Read()) + { + n = rd.GetInt64(0); + nCount++; + } + dtEnd = Environment.TickCount; + } + frm.WriteLine(String.Format(" Intrinsic Function iteration of {0} records in {1} ms", nCount, (dtEnd - dtStart))); + + } + } + + // Causes the user-defined aggregate to be iterated through + internal void UserAggregate(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + int dtStart; + int n = 0; + int nCount; + + cmd.CommandText = "SELECT MyCount(*) FROM TestCase"; + + nCount = 0; + dtStart = Environment.TickCount; + while (Environment.TickCount - dtStart < 1000) + { + n = Convert.ToInt32(cmd.ExecuteScalar()); + nCount++; + } + if (n != 2003) throw new ArgumentOutOfRangeException("Unexpected count"); + frm.WriteLine(String.Format(" UserAggregate executed {0} times in 1 second.", nCount)); + } + } + + // Causes the user-defined collation sequence to be iterated through + internal void UserCollation(IDbConnection cnn) + { + using (IDbCommand cmd = cnn.CreateCommand()) + { + // Using a default collating sequence in descending order, "Param Field3" will appear at the top + // and "Field3" will be next, followed by a NULL. Our user-defined collating sequence will + // deliberately place them out of order so Field3 is first. + cmd.CommandText = "SELECT Field3 FROM TestCase ORDER BY Field3 COLLATE MYSEQUENCE DESC"; + string s = (string)cmd.ExecuteScalar(); + if (s != "Field3") throw new ArgumentOutOfRangeException("MySequence didn't sort properly"); + } + } + } +} diff --git a/Community.CsharpSqlite.SQLiteClient.WinRT/Community.CsharpSqlite.SQLiteClient.WinRT.csproj b/Community.CsharpSqlite.SQLiteClient.WinRT/Community.CsharpSqlite.SQLiteClient.WinRT.csproj index 2d39362..2490666 100644 --- a/Community.CsharpSqlite.SQLiteClient.WinRT/Community.CsharpSqlite.SQLiteClient.WinRT.csproj +++ b/Community.CsharpSqlite.SQLiteClient.WinRT/Community.CsharpSqlite.SQLiteClient.WinRT.csproj @@ -1,166 +1,166 @@ - - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603} - Library - Properties - Community.CsharpSqlite.SQLiteClient.WinRT - Community.CsharpSqlite.SQLiteClient.WinRT - en-US - 512 - {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - true - full - false - bin\Debug\ - TRACE;DEBUG;NETFX_CORE;SQLITE_WINRT - prompt - 4 - 0168;0169;0414;0618;0649 - - - pdbonly - true - bin\Release\ - TRACE;NETFX_CORE;SQLITE_WINRT - prompt - 4 - 0168;0169;0414;0618;0649 - - - true - bin\ARM\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - ARM - false - prompt - ExpressRules.ruleset - true - - - bin\ARM\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - ARM - false - prompt - ExpressRules.ruleset - true - - - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x64 - false - prompt - ExpressRules.ruleset - true - - - bin\x64\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x64 - false - prompt - ExpressRules.ruleset - true - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE - ;2008 - full - x86 - false - prompt - ExpressRules.ruleset - true - - - bin\x86\Release\ - TRACE;NETFX_CORE - true - ;2008 - pdbonly - x86 - false - prompt - ExpressRules.ruleset - true - - - - - {5fe98adc-4a6f-4a74-8a6b-7f33ea020058} - Community.CsharpSqlite.WinRT - - - {6191a053-0255-4509-b7c0-11c6c3d4e66b} - System.Data.Ersatz.WinRT - - - - - src\SqliteCommand.cs - Code - - - src\SqliteConnection.cs - Code - - - src\SqliteDataReader.cs - Code - - - src\SqliteError.cs - Code - - - src\SqliteExceptions.cs - Code - - - src\SqliteParameter.cs - Code - - - src\SqliteParameterCollection.cs - Code - - - src\SqliteTransaction.cs - Code - - - - - 11.0 - - - + + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603} + Library + Properties + Community.CsharpSqlite.SQLiteClient.WinRT + Community.CsharpSqlite.SQLiteClient.WinRT + en-US + 512 + {BC8A1FFA-BEE3-4634-8014-F334798102B3};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + + + true + full + false + bin\Debug\ + TRACE;DEBUG;NETFX_CORE;SQLITE_WINRT + prompt + 4 + 0168;0169;0414;0618;0649 + + + pdbonly + true + bin\Release\ + TRACE;NETFX_CORE;SQLITE_WINRT + prompt + 4 + 0168;0169;0414;0618;0649 + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + ARM + false + prompt + ExpressRules.ruleset + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + ARM + false + prompt + ExpressRules.ruleset + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x64 + false + prompt + ExpressRules.ruleset + true + + + bin\x64\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x64 + false + prompt + ExpressRules.ruleset + true + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE + ;2008 + full + x86 + false + prompt + ExpressRules.ruleset + true + + + bin\x86\Release\ + TRACE;NETFX_CORE + true + ;2008 + pdbonly + x86 + false + prompt + ExpressRules.ruleset + true + + + + + {5fe98adc-4a6f-4a74-8a6b-7f33ea020058} + Community.CsharpSqlite.WinRT + + + {6191a053-0255-4509-b7c0-11c6c3d4e66b} + System.Data.Ersatz.WinRT + + + + + src\SqliteCommand.cs + Code + + + src\SqliteConnection.cs + Code + + + src\SqliteDataReader.cs + Code + + + src\SqliteError.cs + Code + + + src\SqliteExceptions.cs + Code + + + src\SqliteParameter.cs + Code + + + src\SqliteParameterCollection.cs + Code + + + src\SqliteTransaction.cs + Code + + + + + 11.0 + + + \ No newline at end of file diff --git a/Community.CsharpSqlite.SQLiteClient.WinRT/Community.CsharpSqlite.SQLiteClient.WinRT.sln b/Community.CsharpSqlite.SQLiteClient.WinRT/Community.CsharpSqlite.SQLiteClient.WinRT.sln index 017f563..c263e33 100644 --- a/Community.CsharpSqlite.SQLiteClient.WinRT/Community.CsharpSqlite.SQLiteClient.WinRT.sln +++ b/Community.CsharpSqlite.SQLiteClient.WinRT/Community.CsharpSqlite.SQLiteClient.WinRT.sln @@ -1,74 +1,74 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 11 Express for Windows 8 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.SQLiteClient.WinRT", "Community.CsharpSqlite.SQLiteClient.WinRT.csproj", "{7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.WinRT", "..\Community.CsharpSqlite.WinRT\Community.CsharpSqlite.WinRT.csproj", "{5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Ersatz.WinRT", "..\System.Data.Ersatz\WinRT\System.Data.Ersatz.WinRT.csproj", "{6191A053-0255-4509-B7C0-11C6C3D4E66B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|ARM = Debug|ARM - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|ARM = Release|ARM - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|ARM.ActiveCfg = Debug|ARM - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|ARM.Build.0 = Debug|ARM - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|x64.ActiveCfg = Debug|x64 - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|x64.Build.0 = Debug|x64 - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|x86.ActiveCfg = Debug|x86 - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|x86.Build.0 = Debug|x86 - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|ARM.ActiveCfg = Release|ARM - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|ARM.Build.0 = Release|ARM - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|Any CPU.Build.0 = Release|Any CPU - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|x64.ActiveCfg = Release|x64 - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|x64.Build.0 = Release|x64 - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|x86.ActiveCfg = Release|x86 - {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|x86.Build.0 = Release|x86 - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|ARM.ActiveCfg = Debug|ARM - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|ARM.Build.0 = Debug|ARM - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|x64.ActiveCfg = Debug|x64 - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|x64.Build.0 = Debug|x64 - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|x86.ActiveCfg = Debug|x86 - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|x86.Build.0 = Debug|x86 - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|ARM.ActiveCfg = Release|ARM - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|ARM.Build.0 = Release|ARM - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|Any CPU.Build.0 = Release|Any CPU - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|x64.ActiveCfg = Release|x64 - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|x64.Build.0 = Release|x64 - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|x86.ActiveCfg = Release|x86 - {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|x86.Build.0 = Release|x86 - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|ARM.ActiveCfg = Debug|ARM - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|ARM.Build.0 = Debug|ARM - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|x64.ActiveCfg = Debug|x64 - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|x64.Build.0 = Debug|x64 - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|x86.ActiveCfg = Debug|x86 - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|x86.Build.0 = Debug|x86 - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|ARM.ActiveCfg = Release|ARM - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|ARM.Build.0 = Release|ARM - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|Any CPU.Build.0 = Release|Any CPU - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|x64.ActiveCfg = Release|x64 - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|x64.Build.0 = Release|x64 - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|x86.ActiveCfg = Release|x86 - {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 11 Express for Windows 8 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.SQLiteClient.WinRT", "Community.CsharpSqlite.SQLiteClient.WinRT.csproj", "{7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Community.CsharpSqlite.WinRT", "..\Community.CsharpSqlite.WinRT\Community.CsharpSqlite.WinRT.csproj", "{5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Data.Ersatz.WinRT", "..\System.Data.Ersatz\WinRT\System.Data.Ersatz.WinRT.csproj", "{6191A053-0255-4509-B7C0-11C6C3D4E66B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|ARM = Debug|ARM + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|ARM = Release|ARM + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|ARM.ActiveCfg = Debug|ARM + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|ARM.Build.0 = Debug|ARM + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|x64.ActiveCfg = Debug|x64 + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|x64.Build.0 = Debug|x64 + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|x86.ActiveCfg = Debug|x86 + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Debug|x86.Build.0 = Debug|x86 + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|ARM.ActiveCfg = Release|ARM + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|ARM.Build.0 = Release|ARM + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|Any CPU.Build.0 = Release|Any CPU + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|x64.ActiveCfg = Release|x64 + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|x64.Build.0 = Release|x64 + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|x86.ActiveCfg = Release|x86 + {5FE98ADC-4A6F-4A74-8A6B-7F33EA020058}.Release|x86.Build.0 = Release|x86 + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|ARM.ActiveCfg = Debug|ARM + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|ARM.Build.0 = Debug|ARM + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|x64.ActiveCfg = Debug|x64 + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|x64.Build.0 = Debug|x64 + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|x86.ActiveCfg = Debug|x86 + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Debug|x86.Build.0 = Debug|x86 + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|ARM.ActiveCfg = Release|ARM + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|ARM.Build.0 = Release|ARM + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|Any CPU.Build.0 = Release|Any CPU + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|x64.ActiveCfg = Release|x64 + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|x64.Build.0 = Release|x64 + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|x86.ActiveCfg = Release|x86 + {6191A053-0255-4509-B7C0-11C6C3D4E66B}.Release|x86.Build.0 = Release|x86 + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|ARM.ActiveCfg = Debug|ARM + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|ARM.Build.0 = Debug|ARM + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|x64.ActiveCfg = Debug|x64 + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|x64.Build.0 = Debug|x64 + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|x86.ActiveCfg = Debug|x86 + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Debug|x86.Build.0 = Debug|x86 + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|ARM.ActiveCfg = Release|ARM + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|ARM.Build.0 = Release|ARM + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|Any CPU.Build.0 = Release|Any CPU + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|x64.ActiveCfg = Release|x64 + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|x64.Build.0 = Release|x64 + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|x86.ActiveCfg = Release|x86 + {7FD8D34E-59D8-4BE4-B2FF-2A9F053A6603}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/App.xaml b/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/App.xaml index df3935f..39201c0 100644 --- a/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/App.xaml +++ b/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/App.xaml @@ -1,20 +1,20 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/App.xaml.cs b/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/App.xaml.cs index dd82384..c983988 100644 --- a/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/App.xaml.cs +++ b/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/App.xaml.cs @@ -1,83 +1,83 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Windows.ApplicationModel; -using Windows.ApplicationModel.Activation; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; - -// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 - -namespace MetroSQLiteClientTest2 -{ - /// - /// Provides application-specific behavior to supplement the default Application class. - /// - sealed partial class App : Application - { - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - this.InitializeComponent(); - this.Suspending += OnSuspending; - } - - /// - /// Invoked when the application is launched normally by the end user. Other entry points - /// will be used when the application is launched to open a specific file, to display - /// search results, and so forth. - /// - /// Details about the launch request and process. - protected override void OnLaunched(LaunchActivatedEventArgs args) - { - // Do not repeat app initialization when already running, just ensure that - // the window is active - if (args.PreviousExecutionState == ApplicationExecutionState.Running) - { - Window.Current.Activate(); - return; - } - - if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) - { - //TODO: Load state from previously suspended application - } - - // Create a Frame to act navigation context and navigate to the first page - var rootFrame = new Frame(); - if (!rootFrame.Navigate(typeof(MainPage))) - { - throw new Exception("Failed to create initial page"); - } - - // Place the frame in the current Window and ensure that it is active - Window.Current.Content = rootFrame; - Window.Current.Activate(); - } - - /// - /// Invoked when application execution is being suspended. Application state is saved - /// without knowing whether the application will be terminated or resumed with the contents - /// of memory still intact. - /// - /// The source of the suspend request. - /// Details about the suspend request. - private void OnSuspending(object sender, SuspendingEventArgs e) - { - var deferral = e.SuspendingOperation.GetDeferral(); - //TODO: Save application state and stop any background activity - deferral.Complete(); - } - } -} +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using Windows.ApplicationModel; +using Windows.ApplicationModel.Activation; +using Windows.Foundation; +using Windows.Foundation.Collections; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Controls.Primitives; +using Windows.UI.Xaml.Data; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Media; +using Windows.UI.Xaml.Navigation; + +// The Blank Application template is documented at http://go.microsoft.com/fwlink/?LinkId=234227 + +namespace MetroSQLiteClientTest2 +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + sealed partial class App : Application + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + this.Suspending += OnSuspending; + } + + /// + /// Invoked when the application is launched normally by the end user. Other entry points + /// will be used when the application is launched to open a specific file, to display + /// search results, and so forth. + /// + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs args) + { + // Do not repeat app initialization when already running, just ensure that + // the window is active + if (args.PreviousExecutionState == ApplicationExecutionState.Running) + { + Window.Current.Activate(); + return; + } + + if (args.PreviousExecutionState == ApplicationExecutionState.Terminated) + { + //TODO: Load state from previously suspended application + } + + // Create a Frame to act navigation context and navigate to the first page + var rootFrame = new Frame(); + if (!rootFrame.Navigate(typeof(MainPage))) + { + throw new Exception("Failed to create initial page"); + } + + // Place the frame in the current Window and ensure that it is active + Window.Current.Content = rootFrame; + Window.Current.Activate(); + } + + /// + /// Invoked when application execution is being suspended. Application state is saved + /// without knowing whether the application will be terminated or resumed with the contents + /// of memory still intact. + /// + /// The source of the suspend request. + /// Details about the suspend request. + private void OnSuspending(object sender, SuspendingEventArgs e) + { + var deferral = e.SuspendingOperation.GetDeferral(); + //TODO: Save application state and stop any background activity + deferral.Complete(); + } + } +} diff --git a/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/Common/StandardStyles.xaml b/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/Common/StandardStyles.xaml index 1937eb7..81fb398 100644 --- a/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/Common/StandardStyles.xaml +++ b/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/Common/StandardStyles.xaml @@ -1,1007 +1,1007 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Mouse - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Mouse + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/MainPage.xaml b/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/MainPage.xaml index 9db6ff8..84d234f 100644 --- a/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/MainPage.xaml +++ b/Community.CsharpSqlite.SQLiteClient.WinRT/MetroSQLiteClientTest2/MainPage.xaml @@ -1,34 +1,34 @@ - - - - - - - - - - - - - - - - - -