On Mon Mar 15 11:42:04 2010, mark.zealey@pipex.net wrote:
Show quoted text> What if i want to unset the default value? Code should read:
>
> my $self = shift;
> if( @_ ) {
> $self->{'default_value'} = shift;
> }
> return $self->{'default_value'};
Patch applied to this particular setter only, see below for rationale.
Show quoted text> Also, something you should probably think about is there is a difference
> between having a default value set to NULL, and not having a default
> value set at all. I guess to do this you'd want to keep the current
> symantics, but also have a clean_default_value subroutine which would
> 'delete $self->{default_value}' - if it exists and is undef then the
> default value wants to be null.
The general semantics for passing sql-keywords is \$string, so in your
case a default of NULL would be \'NULL'. Of course this may or may not
work on all producers, so you may need to do some fixing for your
particular brand of poison.
The reason there isn't a highly visible effort to fix all this is
because this version of SQLT is in maintenance mode, with whatever
scarce resources there are devoted to making the Moose rewrite of
sqlt[1] a reality.
Feel free to reopen bug if you have further patches that fix your
problems *today*
Cheers
[1] git://github.com/arcanez/SQL-Translator.git