Mercurial > p > roundup > code
comparison roundup/backends/back_sqlite.py @ 5067:e424987d294a
Add support for an integer type to join the existing number type.
Commit patch supplied for issue2550886. This can be used for
properties used for ordering, counts etc. where a decimal point
isn't needed. Developed by Anthony (antmail). Doc updates written by
John Rouillard.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 05 Jun 2016 00:17:26 -0400 |
| parents | 3adff0fb0207 |
| children | e74c3611b138 |
comparison
equal
deleted
inserted
replaced
| 5066:d2256fcfd81f | 5067:e424987d294a |
|---|---|
| 49 hyperdb.Link : 'INTEGER', | 49 hyperdb.Link : 'INTEGER', |
| 50 hyperdb.Interval : 'VARCHAR(255)', | 50 hyperdb.Interval : 'VARCHAR(255)', |
| 51 hyperdb.Password : 'VARCHAR(255)', | 51 hyperdb.Password : 'VARCHAR(255)', |
| 52 hyperdb.Boolean : 'BOOLEAN', | 52 hyperdb.Boolean : 'BOOLEAN', |
| 53 hyperdb.Number : 'REAL', | 53 hyperdb.Number : 'REAL', |
| 54 hyperdb.Integer : 'INTEGER', | |
| 54 } | 55 } |
| 55 hyperdb_to_sql_value = { | 56 hyperdb_to_sql_value = { |
| 56 hyperdb.String : str, | 57 hyperdb.String : str, |
| 57 hyperdb.Date : lambda x: x.serialise(), | 58 hyperdb.Date : lambda x: x.serialise(), |
| 58 hyperdb.Link : int, | 59 hyperdb.Link : int, |
| 59 hyperdb.Interval : str, | 60 hyperdb.Interval : str, |
| 60 hyperdb.Password : str, | 61 hyperdb.Password : str, |
| 61 hyperdb.Boolean : int, | 62 hyperdb.Boolean : int, |
| 63 hyperdb.Integer : int, | |
| 62 hyperdb.Number : lambda x: x, | 64 hyperdb.Number : lambda x: x, |
| 63 hyperdb.Multilink : lambda x: x, # used in journal marshalling | 65 hyperdb.Multilink : lambda x: x, # used in journal marshalling |
| 64 } | 66 } |
| 65 sql_to_hyperdb_value = { | 67 sql_to_hyperdb_value = { |
| 66 hyperdb.String : lambda x: isinstance(x, unicode) and x.encode('utf8') or str(x), | 68 hyperdb.String : lambda x: isinstance(x, unicode) and x.encode('utf8') or str(x), |
| 67 hyperdb.Date : lambda x: date.Date(str(x)), | 69 hyperdb.Date : lambda x: date.Date(str(x)), |
| 68 hyperdb.Link : str, # XXX numeric ids | 70 hyperdb.Link : str, # XXX numeric ids |
| 69 hyperdb.Interval : date.Interval, | 71 hyperdb.Interval : date.Interval, |
| 70 hyperdb.Password : lambda x: password.Password(encrypted=x), | 72 hyperdb.Password : lambda x: password.Password(encrypted=x), |
| 71 hyperdb.Boolean : int, | 73 hyperdb.Boolean : int, |
| 74 hyperdb.Integer : int, | |
| 72 hyperdb.Number : rdbms_common._num_cvt, | 75 hyperdb.Number : rdbms_common._num_cvt, |
| 73 hyperdb.Multilink : lambda x: x, # used in journal marshalling | 76 hyperdb.Multilink : lambda x: x, # used in journal marshalling |
| 74 } | 77 } |
| 75 | 78 |
| 76 def sqlite_busy_handler(self, data, table, count): | 79 def sqlite_busy_handler(self, data, table, count): |
