Commits

Mikhail Korobov  committed a71ca3b Merge

Merge pull request #1 from srj55/master

Added fast_time_series support for sqlite

  • Participants
  • Parent commits fa48b9b, 00ceb4c

Comments (0)

Files changed (1)

File qsstats/utils.py

             'weeks': "date_trunc('week', %s)" % date_field,
             'months': "date_trunc('month', %s)" % date_field,
             'years': "date_trunc('year', %s)" % date_field,
-        }
+        },
+        'sqlite': {
+            'minutes': "strftime('%%Y-%%m-%%d %%H:%%M', `" + date_field + "`)",
+            'hours': "strftime('%%Y-%%m-%%d %%H:00', `" + date_field + "`)",
+            'days': "strftime('%%Y-%%m-%%d', `" + date_field + "`)",
+            'weeks':  "strftime('%%Y-%%W', `" + date_field + "`)",
+            'months': "strftime('%%Y-%%m-01', `" + date_field + "`)",          
+            'years': "strftime('%%Y-01-01', `" + date_field + "`)",                     
+        },
+        
     }
 
     try: