When doing this on Windows (sqlite3.version is 2.6.0, sqlite3.sqlite_version is 3.23.1):
import sqlite3, datetime
db = sqlite3.connect(':memory:', detect_types=sqlite3.PARSE_DECLTYPES)
c = db.cursor()
c.execute('CREATE TABLE mytable (id integer, date timestamp)')
c.execute('INSERT INTO mytable VALUES (1, ?)', (datetime.datetime(2018,1,1,12,11,29),))
c.execute('CREATE INDEX id1 ON mytable(JULIANDAY(date))')
it works (the fact of having an INDEX on JULIANDAY(date)
and not on date
is useful because of this question+answer).
When doing the same on Linux (sqlite3.version is 2.6.0, sqlite3.sqlite_version is 3.8.2), I get:
sqlite3.OperationalError: near "(": syntax error
Is creating an INDEX on JULIANDAY(date)
in this version?