System.Data.SQLite
Check-in [e96f0d17a5]
Not logged in

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

Overview
Comment:Recognize the TIMESTAMP column data type as a DateTime object. Fix for ticket [bb4b04d457].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e96f0d17a5725def23cf084255e9c240a5a16366
User & Date: mistachkin 2011-11-30 00:34:12
References
2013-01-01
19:32 Closed ticket [bb4b04d457]: Using DateTimeFormat=Ticks with TIMESTAMP column causes exception plus 3 other changes artifact: e3631f103c user: mistachkin
2011-11-30
00:36 Fixed ticket [bb4b04d457]. artifact: d7cdd753c4 user: mistachkin
Context
2011-12-05
02:27
To avoid test naming conflicts with the unit test suite for Eagle itself, the unit test names in basic.eagle should not start with 'basic-'. check-in: bd63eac638 user: mistachkin tags: trunk
2011-11-30
00:34
Recognize the TIMESTAMP column data type as a DateTime object. Fix for ticket [bb4b04d457]. check-in: e96f0d17a5 user: mistachkin tags: trunk
2011-11-29
07:20
Revise how statement parameter binding handles blittable types. Also, allow binding to unsigned integer and long values that do not fit into their associated signed types. check-in: 1ab2413f5d user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

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

839
840
841
842
843
844
845

846
847
848
849
850
851
852
              new SQLiteTypeNames("DECIMAL", DbType.Decimal),
              new SQLiteTypeNames("MONEY", DbType.Decimal),
              new SQLiteTypeNames("CURRENCY", DbType.Decimal),
              new SQLiteTypeNames("TIME", DbType.DateTime),
              new SQLiteTypeNames("DATE", DbType.DateTime),
              new SQLiteTypeNames("DATETIME", DbType.DateTime),
              new SQLiteTypeNames("SMALLDATE", DbType.DateTime),

              new SQLiteTypeNames("BLOB", DbType.Binary),
              new SQLiteTypeNames("BINARY", DbType.Binary),
              new SQLiteTypeNames("VARBINARY", DbType.Binary),
              new SQLiteTypeNames("IMAGE", DbType.Binary),
              new SQLiteTypeNames("GENERAL", DbType.Binary),
              new SQLiteTypeNames("OLEOBJECT", DbType.Binary),
              new SQLiteTypeNames("GUID", DbType.Guid),







>







839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
              new SQLiteTypeNames("DECIMAL", DbType.Decimal),
              new SQLiteTypeNames("MONEY", DbType.Decimal),
              new SQLiteTypeNames("CURRENCY", DbType.Decimal),
              new SQLiteTypeNames("TIME", DbType.DateTime),
              new SQLiteTypeNames("DATE", DbType.DateTime),
              new SQLiteTypeNames("DATETIME", DbType.DateTime),
              new SQLiteTypeNames("SMALLDATE", DbType.DateTime),
              new SQLiteTypeNames("TIMESTAMP", DbType.DateTime),
              new SQLiteTypeNames("BLOB", DbType.Binary),
              new SQLiteTypeNames("BINARY", DbType.Binary),
              new SQLiteTypeNames("VARBINARY", DbType.Binary),
              new SQLiteTypeNames("IMAGE", DbType.Binary),
              new SQLiteTypeNames("GENERAL", DbType.Binary),
              new SQLiteTypeNames("OLEOBJECT", DbType.Binary),
              new SQLiteTypeNames("GUID", DbType.Guid),

Added Tests/tkt-bb4b04d457.eagle.































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
###############################################################################
#
# tkt-bb4b04d457.eagle --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################

package require Eagle
package require EagleLibrary
package require EagleTest

runTestPrologue

###############################################################################

package require System.Data.SQLite.Test
runSQLiteTestPrologue

###############################################################################

runTest {test tkt-bb4b04d457-1.1 {} -setup {
  setupDb [set fileName tkt-bb4b04d457-1.1.db] "" Ticks Utc
} -body {
  set dateTime [object invoke -alias DateTime Parse 2011-11-29T12:34:56Z]
  set dateTime [$dateTime -alias ToUniversalTime]

  sql execute $db "CREATE TABLE t1(x TIMESTAMP NOT NULL);"

  sql execute $db "INSERT INTO t1 (x) VALUES(?);" \
      [list param1 Int64 [$dateTime Ticks]]

  sql execute -execute reader -format list -datetimeformat \
      [getDateTimeFormat] $db "SELECT x FROM t1 ORDER BY rowid;"
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain dateTime db fileName
} -constraints \
{eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
{{2011-11-29 12:34:56Z}}}

###############################################################################

runSQLiteTestEpilogue
runTestEpilogue