[Koha-devel] New coding guidelines on adding a syspref (INSERTIGNORE)

Kyle Hall kyle.m.hall at gmail.com
Tue Apr 7 18:29:56 CEST 2015


We could move to using DBIC's find_or_create method as an alternative:
http://search.cpan.org/~ribasushi/DBIx-Class-0.082820/lib/DBIx/Class/ResultSet.pm#find_or_create

I know I've submitted at least one patch that uses that instead of the
classic INSERT statement.

Kyle

http://www.kylehall.info
ByWater Solutions ( http://bywatersolutions.com )
Meadville Public Library ( http://www.meadvillelibrary.org )
Crawford County Federated Library System ( http://www.ccfls.org )
Mill Run Technology Solutions ( http://millruntech.com )

On Tue, Apr 7, 2015 at 11:53 AM, Christopher Nighswonger <
chris.nighswonger at gmail.com> wrote:

> On Tue, Apr 7, 2015 at 11:33 AM, Mark Tompsett <mtompset at hotmail.com>
> wrote:
>
>> Greetings,
>>
>> We have started the move to DBIx, which will grant us back-end
>> portability eventually. Why would we use a mySQL-ism? Is there no nicer way
>> to do this?
>>
>
> A long time ago, when I first opened this bug, I had hoped to code up a
> sub which would handle the check to see if the pref existed or not. The
> thought was to avoid the use of MySQLisms.
>
> I would think that this is a quick-and-easy, have-it-today fix, with the
> ultimate goal to be DB agnostic.
>
> Kind regards,
> Chris
>
>
>
>
>
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20150407/25539941/attachment.html>


More information about the Koha-devel mailing list