Message320855
SQLite converters are documented to be sensitive to the case of type names, but they're not.
In [50]: import sqlite3
...:
...: sqlite3.converters.clear()
...: sqlite3.register_converter('T', lambda x: 'UPPER')
...: sqlite3.register_converter('t', lambda x: 'lower')
...:
...: con = sqlite3.connect(':memory:', detect_types=sqlite3.PARSE_DECLTYPES)
...: cur = con.cursor()
...: cur.execute('create table test(upper T, lower t)')
...: cur.execute('insert into test values (?, ?)', ('X', 'x'))
...: cur.execute('select * from test')
...: cur.fetchone()
...:
Out[50]: ('lower', 'lower')
In [51]: sqlite3.converters
Out[51]: {'T': <function __main__.<lambda>>}
Original commit in pysqlite that makes converters case insensitive: https://github.com/ghaering/pysqlite/commit/1e8bd36be93b7d7425910642b72e4152c77b0dfd |
|
Date |
User |
Action |
Args |
2018-07-02 08:23:53 | sir-sigurd | set | recipients:
+ sir-sigurd, docs@python |
2018-07-02 08:23:53 | sir-sigurd | set | messageid: <1530519833.89.0.56676864532.issue34018@psf.upfronthosting.co.za> |
2018-07-02 08:23:53 | sir-sigurd | link | issue34018 messages |
2018-07-02 08:23:53 | sir-sigurd | create | |
|