System.Data.SQLite
Check-in [09564699fe]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Updates for 67 release
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: 09564699fe430b960172783aac2e86436451f0d7
User & Date: rmsimpson 2010-08-11 16:14:33
Context
2010-08-11
16:15
Code merge SQLite 3.7.0.1 check-in: 70c0651802 user: rmsimpson tags: sourceforge
16:14
Updates for 67 release check-in: 09564699fe user: rmsimpson tags: sourceforge
16:13
Prep for 67 check-in: e842408df1 user: rmsimpson tags: sourceforge
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/AssemblyInfo.cs.

    45     45   //      Major Version
    46     46   //      Minor Version 
    47     47   //      Build Number
    48     48   //      Revision
    49     49   //
    50     50   // You can specify all the values or you can default the Revision and Build Numbers 
    51     51   // by using the '*' as shown below:
    52         -[assembly: AssemblyVersion("1.0.66.0")]
           52  +[assembly: AssemblyVersion("1.0.67.0")]
    53     53   #if !PLATFORM_COMPACTFRAMEWORK
    54         -[assembly: AssemblyFileVersion("1.0.66.0")]
           54  +[assembly: AssemblyFileVersion("1.0.67.0")]
    55     55   #endif

Changes to System.Data.SQLite/SQLiteConnection.cs.

   139    139     /// </item>
   140    140     /// <item>
   141    141     /// <description>Default IsolationLevel</description>
   142    142     /// <description>The default transaciton isolation level</description>
   143    143     /// <description>N</description>
   144    144     /// <description>Serializable</description>
   145    145     /// </item>
          146  +  /// <item>
          147  +  /// <description>Foreign Keys</description>
          148  +  /// <description><b>True</b> - Enables foreign key enforcement<br/><b>False</b> - Disables foreign key enforcement</description>
          149  +  /// <description>N</description>
          150  +  /// <description>False</description>
          151  +  /// </item>
   146    152     /// </list>
   147    153     /// </remarks>
   148    154     public sealed partial class SQLiteConnection : DbConnection, ICloneable
   149    155     {
   150    156       private const string _dataDirectory = "|DataDirectory|";
   151    157       private const string _masterdb = "sqlite_master";
   152    158       private const string _tempmasterdb = "sqlite_temp_master";
................................................................................
   590    596       /// </item>
   591    597       /// <item>
   592    598       /// <description>Default IsolationLevel</description>
   593    599       /// <description>The default transaciton isolation level</description>
   594    600       /// <description>N</description>
   595    601       /// <description>Serializable</description>
   596    602       /// </item>
          603  +    /// <item>
          604  +    /// <description>Foreign Keys</description>
          605  +    /// <description><b>True</b> - Enables foreign key enforcement<br/><b>False</b> - Disables foreign key enforcement</description>
          606  +    /// <description>N</description>
          607  +    /// <description>False</description>
          608  +    /// </item>
   597    609       /// </list>
   598    610       /// </remarks>
   599    611   #if !PLATFORM_COMPACTFRAMEWORK
   600    612       [RefreshProperties(RefreshProperties.All), DefaultValue("")]
   601    613       [Editor("SQLite.Designer.SQLiteConnectionStringEditor, SQLite.Designer, Version=1.0.37.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139", "System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
   602    614   #endif
   603    615       public override string ConnectionString
................................................................................
   866    878               if (Convert.ToInt32(defValue, CultureInfo.InvariantCulture) != 2000)
   867    879               {
   868    880                 cmd.CommandText = String.Format(CultureInfo.InvariantCulture, "PRAGMA cache_size={0}", defValue);
   869    881                 cmd.ExecuteNonQuery();
   870    882               }
   871    883   
   872    884               defValue = FindKey(opts, "Journal Mode", "Delete");
   873         -            if (String.Compare(defValue, "Default", StringComparison.OrdinalIgnoreCase) != 0)
          885  +            if (String.Compare(defValue, "Delete", StringComparison.OrdinalIgnoreCase) != 0)
   874    886               {
   875    887                 cmd.CommandText = String.Format(CultureInfo.InvariantCulture, "PRAGMA journal_mode={0}", defValue);
   876    888                 cmd.ExecuteNonQuery();
   877    889               }
          890  +
          891  +            defValue = FindKey(opts, "Foreign Keys", Boolean.FalseString);
          892  +            cmd.CommandText = String.Format(CultureInfo.InvariantCulture, "PRAGMA foreign_keys={0}", SQLiteConvert.ToBoolean(defValue) == true ? "ON" : "OFF");
          893  +            cmd.ExecuteNonQuery();
   878    894             }
   879    895   
   880    896             if (_commitHandler != null)
   881    897               _sql.SetCommitHook(_commitCallback);
   882    898   
   883    899             if (_updateHandler != null)
   884    900               _sql.SetUpdateHook(_updateCallback);
................................................................................
  1151   1167             return Schema_ReservedWords();
  1152   1168         }
  1153   1169         throw new NotSupportedException();
  1154   1170       }
  1155   1171   
  1156   1172       private static DataTable Schema_ReservedWords()
  1157   1173       {
  1158         -      DataTable tbl = new DataTable("MetaDataCollections");
         1174  +      DataTable tbl = new DataTable("ReservedWords");
  1159   1175   
  1160   1176         tbl.Locale = CultureInfo.InvariantCulture;
  1161   1177         tbl.Columns.Add("ReservedWord", typeof(string));
  1162   1178         tbl.Columns.Add("MaximumVersion", typeof(string));
  1163   1179         tbl.Columns.Add("MinimumVersion", typeof(string));
  1164   1180   
  1165   1181         tbl.BeginLoadData();

Changes to System.Data.SQLite/SQLiteConnectionStringBuilder.cs.

   453    453             return (IsolationLevel)value;
   454    454         }
   455    455         set
   456    456         {
   457    457           this["default isolationlevel"] = value;
   458    458         }
   459    459       }
          460  +
          461  +    /// <summary>
          462  +    /// If enabled, use foreign key constraints
          463  +    /// </summary>
          464  +    [DisplayName("Foreign Keys")]
          465  +    [Browsable(true)]
          466  +    [DefaultValue(false)]
          467  +    public bool ForeignKeys
          468  +    {
          469  +        get
          470  +        {
          471  +            object value;
          472  +            TryGetValue("foreign keys", out value);
          473  +            return SQLiteConvert.ToBoolean(value);
          474  +        }
          475  +        set
          476  +        {
          477  +            this["foreign keys"] = value;
          478  +        }
          479  +    }
   460    480   
   461    481       /// <summary>
   462    482       /// Helper function for retrieving values from the connectionstring
   463    483       /// </summary>
   464    484       /// <param name="keyword">The keyword to retrieve settings for</param>
   465    485       /// <param name="value">The resulting parameter value</param>
   466    486       /// <returns>Returns true if the value was found and returned</returns>

Changes to System.Data.SQLite/SQLiteConvert.cs.

   778    778       /// and the journal re-used as often as needed.  If it is deleted, it will be recreated the next time it is needed.
   779    779       /// </summary>
   780    780       Persist = 1,
   781    781       /// <summary>
   782    782       /// This option disables the rollback journal entirely.  Interrupted transactions or a program crash can cause database
   783    783       /// corruption in this mode!
   784    784       /// </summary>
   785         -    Off = 2
          785  +    Off = 2,
          786  +    /// <summary>
          787  +    /// This option commits transactions by truncating the rollback journal to zero-length instead of deleting it. On many systems,
          788  +    /// truncating a file is much faster than deleting the file since the containing directory does not need to be changed.
          789  +    /// </summary>
          790  +    Truncate = 3,
   786    791     }
   787    792   
   788    793     /// <summary>
   789    794     /// Struct used internally to determine the datatype of a column in a resultset
   790    795     /// </summary>
   791    796     internal class SQLiteType
   792    797     {

Changes to System.Data.SQLite/UnsafeNativeMethods.cs.

    19     19   #if !SQLITE_STANDARD
    20     20   
    21     21   #if !USE_INTEROP_DLL
    22     22   
    23     23   #if !PLATFORM_COMPACTFRAMEWORK
    24     24       private const string SQLITE_DLL = "System.Data.SQLite.DLL";
    25     25   #else
    26         -    internal const string SQLITE_DLL = "SQLite.Interop.066.DLL";
           26  +    internal const string SQLITE_DLL = "SQLite.Interop.067.DLL";
    27     27   #endif // PLATFORM_COMPACTFRAMEWORK
    28     28   
    29     29   #else
    30     30       private const string SQLITE_DLL = "SQLite.Interop.DLL";
    31     31   #endif // USE_INTEROP_DLL
    32     32   
    33     33   #else