New coding guidelines on adding a syspref (INSERT IGNORE)
Hi, Following the discussion on bug 9071, I modified the coding guidelines on [1] and [2] to make IGNORE mandatory when adding a syspref. @QAers, please make sure you agree with this and it will apply to further patches. Cheers, Jonathan [1] http://wiki.koha-community.org/wiki/System_Preferences#Adding_a_new_system_p... [2] http://wiki.koha-community.org/wiki/Database_updates#updatedatabase.pl
Sounds like a great idea! 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 6:43 AM, Jonathan Druart < jonathan.druart@biblibre.com> wrote:
Hi,
Following the discussion on bug 9071, I modified the coding guidelines on [1] and [2] to make IGNORE mandatory when adding a syspref. @QAers, please make sure you agree with this and it will apply to further patches.
Cheers, Jonathan
[1] http://wiki.koha-community.org/wiki/System_Preferences#Adding_a_new_system_p... [2] http://wiki.koha-community.org/wiki/Database_updates#updatedatabase.pl _______________________________________________ Koha-devel mailing list Koha-devel@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/
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? The tweak to System Preferences is fine, because it expressly states what is better, but to continue with just adding a IGNORE in the Database updates seems less than perfect. Sufficient for now perhaps, and better than before, but not really what I hope we are aiming for, right? GPML, Mark Tompsett
On Tue, Apr 7, 2015 at 11:33 AM, Mark Tompsett <mtompset@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
Hi, On Tue, Apr 7, 2015 at 11:53 AM, Christopher Nighswonger <chris.nighswonger@gmail.com> wrote:
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.
'INSERT IGNORE' is grep-able enough for future munging into a DB-agnostic solution. +1 to encouraging use of 'insert ignore' for now. -1 to rejecting patches on account of it; QAers should instead supply follow-ups if needed. Regards, Galen -- Galen Charlton Infrastructure and Added Services Manager Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
I have just added a rule in the koha-qa script to catch, at least, existing occurrences. 2015-04-07 18:19 GMT+02:00 Galen Charlton <gmc@esilibrary.com>:
Hi,
On Tue, Apr 7, 2015 at 11:53 AM, Christopher Nighswonger <chris.nighswonger@gmail.com> wrote:
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.
'INSERT IGNORE' is grep-able enough for future munging into a DB-agnostic solution.
+1 to encouraging use of 'insert ignore' for now.
-1 to rejecting patches on account of it; QAers should instead supply follow-ups if needed.
Regards,
Galen -- Galen Charlton Infrastructure and Added Services Manager Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org _______________________________________________ Koha-devel mailing list Koha-devel@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/
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/ResultS... 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@gmail.com> wrote:
On Tue, Apr 7, 2015 at 11:33 AM, Mark Tompsett <mtompset@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@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/
Greetings, Kyle Hall wrote:
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/ResultS...
I know I've submitted at least one patch that uses that instead of the classic INSERT statement.
Bug number? I’d like to see. Galen does have a point that it is grep-able for future fixing, which is why I didn’t object so heavily, but perhaps something nicer if easy enough to suggest would be good too. Chris Nighswonger wrote:
I would think that this is a quick-and-easy, have-it-today fix, with the ultimate goal to be DB agnostic.
Does this mean someone else is going to work on it? I was thinking perhaps we need a Koha::SystemPreferences put together. This would also help us step towards cleaning up the mess that is C4::Context. GPML, Mark Tompsett
Found it! http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13948 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 1:57 PM, Mark Tompsett <mtompset@hotmail.com> wrote:
Greetings,
Kyle Hall wrote:
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.
Bug number? I’d like to see.
Galen does have a point that it is grep-able for future fixing, which is why I didn’t object so heavily, but perhaps something nicer if easy enough to suggest would be good too.
Chris Nighswonger wrote:
I would think that this is a quick-and-easy, have-it-today fix, with the ultimate goal to be DB agnostic.
Does this mean someone else is going to work on it? I was thinking perhaps we need a Koha::SystemPreferences put together. This would also help us step towards cleaning up the mess that is C4::Context.
GPML, Mark Tompsett _______________________________________________ Koha-devel mailing list Koha-devel@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/
Actually, I think your idea of Koha::SystemPreference is the best way to go, but I've no issue with other solutions in the mean time. 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 1:57 PM, Mark Tompsett <mtompset@hotmail.com> wrote:
Greetings,
Kyle Hall wrote:
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.
Bug number? I’d like to see.
Galen does have a point that it is grep-able for future fixing, which is why I didn’t object so heavily, but perhaps something nicer if easy enough to suggest would be good too.
Chris Nighswonger wrote:
I would think that this is a quick-and-easy, have-it-today fix, with the ultimate goal to be DB agnostic.
Does this mean someone else is going to work on it? I was thinking perhaps we need a Koha::SystemPreferences put together. This would also help us step towards cleaning up the mess that is C4::Context.
GPML, Mark Tompsett _______________________________________________ Koha-devel mailing list Koha-devel@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/
On Tue, Apr 7, 2015 at 1:57 PM, Mark Tompsett <mtompset@hotmail.com> wrote:
Chris Nighswonger wrote:
I would think that this is a quick-and-easy, have-it-today fix, with the ultimate goal to be DB agnostic.
Does this mean someone else is going to work on it? I was thinking perhaps we need a Koha::SystemPreferences put together. This would also help us step towards cleaning up the mess that is C4::Context.
A Koha::SystemPreferences module would be an excellent approach imho. Really the entire database update/system preference code leaves much to be desired even if we were not considering supporting multiple dbs. I'd guess it will take money thrown at it in order to gain inertia. Kind regards, Chris
Greetings, Or me being annoyed. Starting an attempt at Koha::SystemPreferences now. Donations gratefully accepted. Information on how to donate available upon request. GPML, Mark Tompsett From: Christopher Nighswonger Sent: Tuesday, April 07, 2015 2:58 PM To: Mark Tompsett Cc: Koha Devel Subject: Re: [Koha-devel] New coding guidelines on adding a syspref (INSERTIGNORE) On Tue, Apr 7, 2015 at 1:57 PM, Mark Tompsett <mtompset@hotmail.com> wrote: Chris Nighswonger wrote: I would think that this is a quick-and-easy, have-it-today fix, with the ultimate goal to be DB agnostic. Does this mean someone else is going to work on it? I was thinking perhaps we need a Koha::SystemPreferences put together. This would also help us step towards cleaning up the mess that is C4::Context. A Koha::SystemPreferences module would be an excellent approach imho. Really the entire database update/system preference code leaves much to be desired even if we were not considering supporting multiple dbs. I'd guess it will take money thrown at it in order to gain inertia. Kind regards, Chris
Doh! I wish I'd checked this email thread a bit earlier: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13967 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 3:23 PM, Mark Tompsett <mtompset@hotmail.com> wrote:
Greetings,
Or me being annoyed. Starting an attempt at Koha::SystemPreferences now. Donations gratefully accepted. Information on how to donate available upon request. [image: Smile]
GPML, Mark Tompsett
*From:* Christopher Nighswonger <chris.nighswonger@gmail.com> *Sent:* Tuesday, April 07, 2015 2:58 PM *To:* Mark Tompsett <mtompset@hotmail.com> *Cc:* Koha Devel <koha-devel@lists.koha-community.org> *Subject:* Re: [Koha-devel] New coding guidelines on adding a syspref (INSERTIGNORE)
On Tue, Apr 7, 2015 at 1:57 PM, Mark Tompsett <mtompset@hotmail.com> wrote:
Chris Nighswonger wrote:
I would think that this is a quick-and-easy, have-it-today fix, with the ultimate goal to be DB agnostic.
Does this mean someone else is going to work on it? I was thinking perhaps we need a Koha::SystemPreferences put together. This would also help us step towards cleaning up the mess that is C4::Context.
A Koha::SystemPreferences module would be an excellent approach imho. Really the entire database update/system preference code leaves much to be desired even if we were not considering supporting multiple dbs.
I'd guess it will take money thrown at it in order to gain inertia.
Kind regards, Chris
_______________________________________________ Koha-devel mailing list Koha-devel@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/
Greetings, Better late than never. GPML, Mark Tompsett From: Kyle Hall Sent: Wednesday, April 08, 2015 6:40 AM To: Mark Tompsett Cc: Christopher Nighswonger ; Koha Devel Subject: Re: [Koha-devel] New coding guidelines on adding a syspref (INSERTIGNORE) Doh! I wish I'd checked this email thread a bit earlier: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13967 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 3:23 PM, Mark Tompsett <mtompset@hotmail.com> wrote: Greetings, Or me being annoyed. Starting an attempt at Koha::SystemPreferences now. Donations gratefully accepted. Information on how to donate available upon request. GPML, Mark Tompsett From: Christopher Nighswonger Sent: Tuesday, April 07, 2015 2:58 PM To: Mark Tompsett Cc: Koha Devel Subject: Re: [Koha-devel] New coding guidelines on adding a syspref (INSERTIGNORE) On Tue, Apr 7, 2015 at 1:57 PM, Mark Tompsett <mtompset@hotmail.com> wrote: Chris Nighswonger wrote: I would think that this is a quick-and-easy, have-it-today fix, with the ultimate goal to be DB agnostic. Does this mean someone else is going to work on it? I was thinking perhaps we need a Koha::SystemPreferences put together. This would also help us step towards cleaning up the mess that is C4::Context. A Koha::SystemPreferences module would be an excellent approach imho. Really the entire database update/system preference code leaves much to be desired even if we were not considering supporting multiple dbs. I'd guess it will take money thrown at it in order to gain inertia. Kind regards, Chris _______________________________________________ Koha-devel mailing list Koha-devel@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/
participants (5)
-
Christopher Nighswonger -
Galen Charlton -
Jonathan Druart -
Kyle Hall -
Mark Tompsett