Re: stopping numification

[prev] [thread] [next] [Date index for 2005/05/24]

From: Gordon Haverland
Subject: Re: stopping numification
Date: 16:55 on 24 May 2005
On Tuesday 24 May 2005 09:46, Simon Wistow wrote:
> I have a column, version, defined as varchar(255) but, when I
> do a
>
> 	MyThing->find_or_create({ name => $name, version =>
> "$version"});
>
> where $version is "1.0" then the value in the database is '1'.
>
> If I do
>
> __PACKAGE__->add_trigger( before_set_version =>
> 	sub { my ($self, $value, $vals) = @_; ... } );
>
>
> then both $value and $vals->{version} are '1.0';
>
> If I manually frig the DB to set the version to '1.0' then it's
> all fine.
>
> Is this a bug in Class::DBI::SQLite?

Have you read about how SQLite works?  I would say this is a 
feature from their point of view.  There are no checks on what 
kinds of data are stored in what kinds of columns, except for the 
primary key autoincrement, which must be integer.  With any other 
column, you can store whatever you want.  So, what differentiates 
a string of '1' from an integer of '1' from a float of '1.0'?

My $0.02 (CDN).
Gord

(message missing)

stopping numification
Simon Wistow 15:46 on 24 May 2005

Re: stopping numification
Matt S Trout 16:01 on 24 May 2005

Re: stopping numification
Simon Wistow 16:31 on 24 May 2005

Re: stopping numification
Christopher Laco 17:13 on 24 May 2005

Re: stopping numification
Simon Wistow 10:47 on 25 May 2005

Re: stopping numification
William Ross 11:46 on 25 May 2005

Re: stopping numification
Simon Wistow 11:59 on 25 May 2005

Re: stopping numification
Dan Sully 14:09 on 25 May 2005

Re: stopping numification
Gordon Haverland 16:55 on 24 May 2005

Re: stopping numification
Simon Wistow 17:06 on 24 May 2005

Re: stopping numification
Gordon Haverland 22:43 on 24 May 2005

Re: stopping numification
Tony Bowden 11:57 on 25 May 2005

Generated at 20:11 on 05 Jun 2005 by mariachi v0.52