Re: [sqlite] Option to control implicit casting

2019-04-11 Thread James K. Lowden
On Thu, 11 Apr 2019 11:35:04 +1000 John McMahon wrote: > > SELECT x * y & ~1 AS even_numbered_area FROM squares; > > Suggestion: "Don't Do That", use database purely as a storage medium. You yourself don't really believe that! A disk is a storage medium. A file is an undifferntiated stream

Re: [sqlite] Option to control implicit casting

2019-04-10 Thread John McMahon
On 11/04/2019 00:28, Joshua Thomas Wise wrote: This is not enough. Because of implicit casting, an integer (a precise value) could be passed through a series of operations that outputs an integer, satisfying the check constraint, but it still could’ve been converted to a floating point

Re: [sqlite] Option to control implicit casting

2019-04-10 Thread Warren Young
On Apr 8, 2019, at 9:08 PM, Joshua Thomas Wise wrote: > > there should be a compile-time option to disable all implicit casting done > within the SQL virtual machine. That’d be nice, especially when using SQLite with a strongly- and statically-typed programming language and a

Re: [sqlite] Option to control implicit casting

2019-04-10 Thread Keith Medcalf
On Wednesday, 10 April, 2019 09:06. Joshua Thomas Wise wrote: >When you need a feature-packed embedded SQL database, there aren’t >many other options to reach for. I’m not suggesting that SQLite3 has >a responsibility to satisfy every need just because it has beat out >most other competition,

Re: [sqlite] Option to control implicit casting

2019-04-10 Thread Joshua Thomas Wise
When you need a feature-packed embedded SQL database, there aren’t many other options to reach for. I’m not suggesting that SQLite3 has a responsibility to satisfy every need just because it has beat out most other competition, but I’m in a situation where either I write every elementary

Re: [sqlite] Option to control implicit casting

2019-04-10 Thread Keith Medcalf
On Wednesday, 10 April, 2019 08:28, Joshua Thomas Wise wrote: >This is not enough. Because of implicit casting, an integer (a >precise value) could be passed through a series of operations that >outputs an integer, satisfying the check constraint, but it still >could’ve been converted to a

Re: [sqlite] Option to control implicit casting

2019-04-10 Thread Joshua Thomas Wise
This is not enough. Because of implicit casting, an integer (a precise value) could be passed through a series of operations that outputs an integer, satisfying the check constraint, but it still could’ve been converted to a floating point (imprecise value) at some intermediate step due to

Re: [sqlite] Option to control implicit casting

2019-04-09 Thread James K. Lowden
On Mon, 8 Apr 2019 23:08:18 -0400 Joshua Thomas Wise wrote: > I propose there should be a compile-time option to disable all > implicit casting done within the SQL virtual machine. You can use SQLite in a "strict" way: write a CHECK constraint for every numerical column. Just don't do that

Re: [sqlite] Option to control implicit casting

2019-04-09 Thread R Smith
On 2019/04/09 5:08 AM, Joshua Thomas Wise wrote: SQLite3 uses manifest typing, which is great and provides a ton of flexibility. However, due to implicit casting rules, many operations can accidentally result in a different value than what was desired. If programmers don’t guard against every

Re: [sqlite] Option to control implicit casting

2019-04-09 Thread Dominique Devienne
On Tue, Apr 9, 2019 at 5:08 AM Joshua Thomas Wise < joshuathomasw...@gmail.com> wrote: > SQLite3 uses manifest typing, which is great and provides a ton of > flexibility. However, due to implicit casting rules, many operations can > accidentally result in a different value than what was desired.