SQL::Abstract : adding support for two potentially MySQL-specific functions

11 messages Options
Embed this post
Permalink
Spiros Denaxas

SQL::Abstract : adding support for two potentially MySQL-specific functions

Reply Threaded More More options
Print post
Permalink
Hello,

I recently contacted Matt regarding SQL::Abstract and how to add support for two features which I *think* are MySQL specific:

1) REPLACE (more info: http://dev.mysql.com/doc/refman/6.0/en/replace.html)
2) UPDATE statements on multiple tables (more info: http://dev.mysql.com/doc/refman/6.0/en/update.html)

Please correct me if I am wrong in thinking that these are MySQL specific - I have not really looking into other RDBMS's.

He instructed me to bounce this off this list, so here I am. I am more than willing to do the work for these but I'm not sure what the correct way to proceed is. The options
I could think of were:

a) send patch for SQL::Abstract
b) create new module which uses SQL::Abstract as a base class
c) create a new module alltogether

I certainly dont prefer c. and a. seems like a bad idea. Any ideas are more than welcome.

thanks,
Spiros

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Rob Kinyon

Re: SQL::Abstract : adding support for two potentially MySQL-specific functions

Reply Threaded More More options
Print post
Permalink
On Sun, Mar 8, 2009 at 07:08, Spiros Denaxas <[hidden email]> wrote:

> Hello,
>
> I recently contacted Matt regarding SQL::Abstract and how to add support for
> two features which I *think* are MySQL specific:
>
> 1) REPLACE (more info: http://dev.mysql.com/doc/refman/6.0/en/replace.html)
> 2) UPDATE statements on multiple tables (more info:
> http://dev.mysql.com/doc/refman/6.0/en/update.html)
>
> Please correct me if I am wrong in thinking that these are MySQL specific -
> I have not really looking into other RDBMS's.

They are certainly non-standard extensions. I'm not sure if they are
limited only to MySQL. In addition, you will want to have multi-table
DELETE supported.

> He instructed me to bounce this off this list, so here I am. I am more than
> willing to do the work for these but I'm not sure what the correct way to
> proceed is. The options
> I could think of were:
>
> a) send patch for SQL::Abstract
> b) create new module which uses SQL::Abstract as a base class
> c) create a new module alltogether

The rewrite of SQL::Abstract will support the concept of SQL dialects,
so that would fit in very nicely - if it was done. I'm not one of the
current maintainers, but I think that if you were to provide a patch
off of http://dev.catalyst.perl.org/repos/bast/SQL-Abstract/1.x/trunk,
it would be taken seriously.

Rob

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Jose Luis Martinez

Re: SQL::Abstract : adding support for two potentially MySQL-specific functions

Reply Threaded More More options
Print post
Permalink
Rob Kinyon escribió:

> On Sun, Mar 8, 2009 at 07:08, Spiros Denaxas <[hidden email]> wrote:
>> Hello,
>>
>> I recently contacted Matt regarding SQL::Abstract and how to add support for
>> two features which I *think* are MySQL specific:
>>
>> 1) REPLACE (more info: http://dev.mysql.com/doc/refman/6.0/en/replace.html)
>> 2) UPDATE statements on multiple tables (more info:
>> http://dev.mysql.com/doc/refman/6.0/en/update.html)
>>
>> Please correct me if I am wrong in thinking that these are MySQL specific -
>> I have not really looking into other RDBMS's.
>
> They are certainly non-standard extensions. I'm not sure if they are
> limited only to MySQL. In addition, you will want to have multi-table
> DELETE supported.
>
And INSERT ... ON DUPLICATE KEY UPDATE ...? (available in MySQL
http://dev.mysql.com/doc/refman/5.0/en/insert.html)

Maybe it's already supported?


Regards,

Jose Luis Martinez
[hidden email]


_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
BUCHMULLER Norbert

Re: SQL::Abstract : adding support for two potentially MySQL-specific functions

Reply Threaded More More options
Print post
Permalink
In reply to this post by Rob Kinyon
On Sun, 8 Mar 2009 13:49:36 -0500 Rob Kinyon wrote:

> The rewrite of SQL::Abstract will support the concept of SQL dialects,
> so that would fit in very nicely - if it was done. I'm not one of the
> current maintainers, but I think that if you were to provide a patch
> off of http://dev.catalyst.perl.org/repos/bast/SQL-Abstract/1.x/trunk,
> it would be taken seriously.

Hi,

patches are welcome, but please base your patch on the '1.50_RC' branch
(the trunk is currently a dead end AFAIK):

http://dev.catalyst.perl.org/repos/bast/SQL-Abstract/1.x/branches/1.50_RC

norbi

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Spiros Denaxas-2

Re: SQL::Abstract : adding support for two potentially MySQL-specific functions

Reply Threaded More More options
Print post
Permalink
On Wed, Mar 11, 2009 at 11:01 PM, BUCHMULLER Norbert <[hidden email]> wrote:
> On Sun, 8 Mar 2009 13:49:36 -0500 Rob Kinyon wrote:
>
>
> Hi,
>
> patches are welcome, but please base your patch on the '1.50_RC' branch
> (the trunk is currently a dead end AFAIK):

Thank you all for the replies. I plan to submit a patch during the
w/end, initially with the 'REPLACE' implementation
and if that goes well, I can move on with the rest of the items on the list.

Thanks,
Spiros

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Spiros Denaxas-2

Re: SQL::Abstract : adding support for two potentially MySQL-specific functions

Reply Threaded More More options
Print post
Permalink
>> On Sun, 8 Mar 2009 13:49:36 -0500 Rob Kinyon wrote:
>>
>>
>> Hi,
>>
>> patches are welcome, but please base your patch on the '1.50_RC' branch
>> (the trunk is currently a dead end AFAIK):
>

Hello,

As promised, find attached the first patch, adding support for the
"REPLACE" function. The summary of the changes:

- added the "replace" sub in the main module
- added POD documentation for "REPLACE"
- added additional test cases in the SQL generation test file

I attach the patch files for both Abstract.pm and 01generate.t,
feedback is more than welcome.

Spiros



_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...

Abstract.pm.patch (3K) Download Attachment
01generate.t.patch (5K) Download Attachment
Spiros Denaxas

Re: SQL::Abstract : adding support for two potentially MySQL-specific functions

Reply Threaded More More options
Print post
Permalink
No interest in this? :-(

Spiros Denaxas

On Sat, Mar 14, 2009 at 2:22 PM, Spiros Denaxas<[hidden email]> wrote:

>>> On Sun, 8 Mar 2009 13:49:36 -0500 Rob Kinyon wrote:
>>>
>>>
>>> Hi,
>>>
>>> patches are welcome, but please base your patch on the '1.50_RC' branch
>>> (the trunk is currently a dead end AFAIK):
>>
>
> Hello,
>
> As promised, find attached the first patch, adding support for the
> "REPLACE" function. The summary of the changes:
>
> - added the "replace" sub in the main module
> - added POD documentation for "REPLACE"
> - added additional test cases in the SQL generation test file
>
> I attach the patch files for both Abstract.pm and 01generate.t,
> feedback is more than welcome.
>
> Spiros
>

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Rob Kinyon

Re: SQL::Abstract : adding support for two potentially MySQL-specific functions

Reply Threaded More More options
Print post
Permalink
Two weeks ago - prepare of YAPC
this past week - do YAPC
next week - recover form YAPC

yeah . . .

On Thu, Jun 25, 2009 at 14:13, Spiros Denaxas<[hidden email]> wrote:

> No interest in this? :-(
>
> Spiros Denaxas
>
> On Sat, Mar 14, 2009 at 2:22 PM, Spiros Denaxas<[hidden email]> wrote:
>>>> On Sun, 8 Mar 2009 13:49:36 -0500 Rob Kinyon wrote:
>>>>
>>>>
>>>> Hi,
>>>>
>>>> patches are welcome, but please base your patch on the '1.50_RC' branch
>>>> (the trunk is currently a dead end AFAIK):
>>>
>>
>> Hello,
>>
>> As promised, find attached the first patch, adding support for the
>> "REPLACE" function. The summary of the changes:
>>
>> - added the "replace" sub in the main module
>> - added POD documentation for "REPLACE"
>> - added additional test cases in the SQL generation test file
>>
>> I attach the patch files for both Abstract.pm and 01generate.t,
>> feedback is more than welcome.
>>
>> Spiros
>>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive: http://www.grokbase.com/group/dbix-class@...
>



--
Thanks,
Rob Kinyon

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Spiros Denaxas

Re: SQL::Abstract : adding support for two potentially MySQL-specific functions

Reply Threaded More More options
Print post
Permalink
Now two months later ? :-)

Spiros

On Thu, Jun 25, 2009 at 7:21 PM, Rob Kinyon <[hidden email]> wrote:

> Two weeks ago - prepare of YAPC
> this past week - do YAPC
> next week - recover form YAPC
>
> yeah . . .
>
> On Thu, Jun 25, 2009 at 14:13, Spiros Denaxas<[hidden email]> wrote:
>> No interest in this? :-(
>>
>> Spiros Denaxas
>>
>> On Sat, Mar 14, 2009 at 2:22 PM, Spiros Denaxas<[hidden email]> wrote:
>>>>> On Sun, 8 Mar 2009 13:49:36 -0500 Rob Kinyon wrote:
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> patches are welcome, but please base your patch on the '1.50_RC' branch
>>>>> (the trunk is currently a dead end AFAIK):
>>>>
>>>
>>> Hello,
>>>
>>> As promised, find attached the first patch, adding support for the
>>> "REPLACE" function. The summary of the changes:
>>>
>>> - added the "replace" sub in the main module
>>> - added POD documentation for "REPLACE"
>>> - added additional test cases in the SQL generation test file
>>>
>>> I attach the patch files for both Abstract.pm and 01generate.t,
>>> feedback is more than welcome.
>>>
>>> Spiros
>>>
>>
>> _______________________________________________
>> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
>> IRC: irc.perl.org#dbix-class
>> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
>> Searchable Archive: http://www.grokbase.com/group/dbix-class@...
>>
>
>
>
> --
> Thanks,
> Rob Kinyon
>

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Peter Rabbitson-2

Re: SQL::Abstract : adding support for two potentially MySQL-specific functions

Reply Threaded More More options
Print post
Permalink
In reply to this post by Spiros Denaxas
Spiros Denaxas wrote:
> Hello,
>
> I recently contacted Matt regarding SQL::Abstract and how to add support
> for two features which I *think* are MySQL specific:
>
> 1) REPLACE (more info: http://dev.mysql.com/doc/refman/6.0/en/replace.html)
> 2) UPDATE statements on multiple tables (more info:
> http://dev.mysql.com/doc/refman/6.0/en/update.html)
>

My hunch is that this is not sqla 1.5 material. Just my 2c.

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...
Peter Rabbitson-2

Re: SQL::Abstract : adding support for two potentially MySQL-specific functions

Reply Threaded More More options
Print post
Permalink
In reply to this post by Spiros Denaxas
Spiros Denaxas wrote:
> Hello,
>
> I recently contacted Matt regarding SQL::Abstract and how to add support
> for two features which I *think* are MySQL specific:
>
> 1) REPLACE (more info: http://dev.mysql.com/doc/refman/6.0/en/replace.html)
> 2) UPDATE statements on multiple tables (more info:
> http://dev.mysql.com/doc/refman/6.0/en/update.html)
>

It didn't occur to me this morning, but you can define them locally via the
custom operator hooks:

http://search.cpan.org/~ribasushi/SQL-Abstract-1.58/lib/SQL/Abstract.pm#SPECIAL_OPERATORS
http://search.cpan.org/~ribasushi/SQL-Abstract-1.58/lib/SQL/Abstract.pm#UNARY_OPERATORS

SQLA 1.5 does not have a sane databse aware api, and focuses on ansi sql
at this point. Thus my reluctance to include this into the core of the module.

Dissenting thoughts of course are welcome :)

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/dbix-class@...