Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

difference in select syntax

Quote Reply
difference in select syntax

I was making diffs of the links Code of 2.12 & 2.20,
and found some difference in the select code.

in Links-SQL 2.12, I have something like
my $sth2 = $db->select( { URL => $url }, ['ID','Title'] );Shocked

and in Links-SQL 2.20 I have this:
my $sth2 = $db->select('ID', 'Title', { URL => $url });Shocked

my question:
what is the difference & should I update all my customized code?
Quote Reply
Re: [ridesworld] difference in select syntax In reply to
The two examples are identical; the:

$db->select('ID', 'Title', { URL => $url });

is more consistent with the way you think of an actual query:

SELECT ID, Title WHERE URL = '...'

As well, it's more consistent with our other products. That said, the first ->select({ where => $value }, [. columns ..]) syntax is still supported, and there aren't any plans to remove it.

Jason Rhinelander
Gossamer Threads