System.Data.SQLite

Check-in [10fae679b2]
Login

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

Overview
Comment:Issue warnings on the trace listners if a column type or type name cannot be mapped properly. See ticket [4bbf851fa5].
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 10fae679b23bcf783046285b3733e58c9bad5994
User & Date: mistachkin 2012-02-14 22:12:13.887
References
2012-02-29
14:54 Closed ticket [4bbf851fa5]: DBConcurrencyException plus 1 other change artifact: 774e22236e user: mistachkin
2012-02-19
12:35 Ticket [4bbf851fa5]: 1 change artifact: d4963672c0 user: mistachkin
12:35 Ticket [4bbf851fa5]: 1 change artifact: f4db9f273a user: mistachkin
2012-02-14
22:21 Ticket [4bbf851fa5]: 1 change artifact: ee5ef28fdb user: mistachkin
Context
2012-02-15
07:51
Version and doc updates in preparation for release 1.0.80.0. check-in: 50276145d8 user: mistachkin tags: trunk
2012-02-14
22:12
Issue warnings on the trace listners if a column type or type name cannot be mapped properly. See ticket [4bbf851fa5]. check-in: 10fae679b2 user: mistachkin tags: trunk
2012-02-13
23:39
Test whitespace style adjustments. check-in: c49c15f654 user: mistachkin tags: trunk
Changes
Unified Diff Show Whitespace Changes Patch
Changes to System.Data.SQLite/SQLiteConvert.cs.
1
2
3
4
5
6
7
8
9
10





11
12
13
14
15
16
17
/********************************************************
 * ADO.NET 2.0 Data Provider for SQLite Version 3.X
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

namespace System.Data.SQLite
{
  using System;





  using System.Runtime.InteropServices;
  using System.Collections.Generic;
  using System.Globalization;
  using System.Text;

  /// <summary>
  /// This base class provides datatype conversion services for the SQLite provider.










>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/********************************************************
 * ADO.NET 2.0 Data Provider for SQLite Version 3.X
 * Written by Robert Simpson (robert@blackcastlesoft.com)
 * 
 * Released to the public domain, use at your own risk!
 ********************************************************/

namespace System.Data.SQLite
{
  using System;

#if DEBUG
  using System.Diagnostics;
#endif

  using System.Runtime.InteropServices;
  using System.Collections.Generic;
  using System.Globalization;
  using System.Text;

  /// <summary>
  /// This base class provides datatype conversion services for the SQLite provider.
690
691
692
693
694
695
696
697








698
699
700
701
702
703
704
    {
      for (int n = 0; n < _dbtypeNames.Length; n++)
      {
        if (_dbtypeNames[n].dataType == typ)
          return _dbtypeNames[n].typeName;
      }

      return String.Empty;








    }

    private static SQLiteTypeNames[] _dbtypeNames = {
      new SQLiteTypeNames("INTEGER", DbType.Int64),
      new SQLiteTypeNames("TINYINT", DbType.Byte),
      new SQLiteTypeNames("INT", DbType.Int32),
      new SQLiteTypeNames("VARCHAR", DbType.AnsiString),







|
>
>
>
>
>
>
>
>







695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
    {
      for (int n = 0; n < _dbtypeNames.Length; n++)
      {
        if (_dbtypeNames[n].dataType == typ)
          return _dbtypeNames[n].typeName;
      }

      string defaultTypeName = String.Empty;

#if DEBUG
      Trace.WriteLine(String.Format(
          "WARNING: Type mapping failed, returning default name \"{0}\" for type {1}.",
          defaultTypeName, typ));
#endif

      return defaultTypeName;
    }

    private static SQLiteTypeNames[] _dbtypeNames = {
      new SQLiteTypeNames("INTEGER", DbType.Int64),
      new SQLiteTypeNames("TINYINT", DbType.Byte),
      new SQLiteTypeNames("INT", DbType.Int32),
      new SQLiteTypeNames("VARCHAR", DbType.AnsiString),
876
877
878
879
880
881
882
883








884
885
886
887
888
889
890
        if ((index > 0) &&
            _typeNames.TryGetValue(Name.Substring(0, index), out value))
        {
          return value.dataType;
        }
      }

      return DbType.Object;








    }
    #endregion

    private static object _syncRoot = new object();
    private static Dictionary<string, SQLiteTypeNames> _typeNames = null;
  }








|
>
>
>
>
>
>
>
>







889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
        if ((index > 0) &&
            _typeNames.TryGetValue(Name.Substring(0, index), out value))
        {
          return value.dataType;
        }
      }

      DbType defaultDbType = DbType.Object;

#if DEBUG
      Trace.WriteLine(String.Format(
          "WARNING: Type mapping failed, returning default type {0} for name \"{1}\".",
          defaultDbType, Name));
#endif

      return defaultDbType;
    }
    #endregion

    private static object _syncRoot = new object();
    private static Dictionary<string, SQLiteTypeNames> _typeNames = null;
  }