This queue is for tickets about the Gtk2-Ex-Datasheet-DBI CPAN distribution.

Report information
The Basics
Id:
36740
Status:
open
Priority:
Low/Low

People
Owner:
Nobody in particular
Requestors:
user42 [...] zip.com.au
Cc:
AdminCc:

BugTracker
Severity:
(no value)
Broken in:
(no value)
Fixed in:
(no value)



Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 7B2594D8005 for <bug-gtk2-ex-datasheet-dbi@rt.cpan.org>; Fri, 13 Jun 2008 20:39:18 -0400 (EDT)
Received: (qmail 10458 invoked from network); 14 Jun 2008 00:39:15 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 14 Jun 2008 00:39:15 -0000
Received: from mailout1-9.pacific.net.au (HELO mailout1.pacific.net.au) (125.255.80.128) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Jun 2008 17:38:55 -0700
Received: from mailproxy2.pacific.net.au (mailproxy2.pacific.net.au [61.8.2.163]) by mailout1.pacific.net.au (Postfix) with ESMTP id 89FC139ECFB for <bug-gtk2-ex-datasheet-dbi@rt.cpan.org>; Sat, 14 Jun 2008 10:38:48 +1000 (EST)
Received: from blah.blah (ppp2564.dyn.pacific.net.au [61.8.37.100]) by mailproxy2.pacific.net.au (Postfix) with ESMTP id 262442740F for <bug-gtk2-ex-datasheet-dbi@rt.cpan.org>; Sat, 14 Jun 2008 10:38:48 +1000 (EST)
Received: from gg by blah.blah with local (Exim 4.69) (envelope-from <gg@zip.com.au>) id 1K7Jmc-00022B-BI for bug-gtk2-ex-datasheet-dbi@rt.cpan.org; Sat, 14 Jun 2008 10:38:18 +1000
Delivered-To: cpan-bug+gtk2-ex-datasheet-dbi@diesel.bestpractical.com
MIME-Version: 1.0
User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.2 (gnu/linux)
Subject: multiple columns for primary key
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
Return-Path: <gg@zip.com.au>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-gtk2-ex-datasheet-dbi@rt.cpan.org
Date: Sat, 14 Jun 2008 10:38:18 +1000
X-Spam-Level: *
Message-Id: <878wx8g8at.fsf@blah.blah>
content-type: text/plain; charset="utf-8"
To: bug-gtk2-ex-datasheet-dbi@rt.cpan.org
From: Kevin Ryde <user42@zip.com.au>
X-RT-Original-Encoding: us-ascii
Content-Length: 408
I tried editing a row in a datasheet where the primary key had multiple columns, and the edit was applied to multiple rows of the table. It'd be good if multi-column primary keys could be supported. (I'm using sqlite and the "primary_key_info" already in use has all the columns.) Or if it's a bit hard for the moment I guess going read-only on multi-column primary key would prevent strange updates etc.
MIME-Version: 1.0
X-Spam-Status: No, hits=-3.6 required=8.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW
In-Reply-To: <rt-3.6.HEAD-32567-1213403992-1530.36740-4-0@rt.cpan.org>
X-Ironport-Anti-Spam-Result: Au0AAChAU0jLnjoE/2dsb2JhbAAIrRY
X-Mailer: Evolution 2.22.1
References: <RT-Ticket-36740@rt.cpan.org> <878wx8g8at.fsf@blah.blah> <rt-3.6.HEAD-32567-1213403992-1530.36740-4-0@rt.cpan.org>
X-Ironport-Anti-Spam-Filtered: true
Content-Type: text/plain; charset=UTF-8
X-RT-Original-Encoding: utf-8
X-Ironport-Av: E=Sophos;i="4.27,643,1204470000"; d="scan'208";a="342761593"
Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id A09414D8005 for <bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org>; Sat, 14 Jun 2008 06:56:19 -0400 (EDT)
Received: (qmail 18634 invoked from network); 14 Jun 2008 10:56:18 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 14 Jun 2008 10:56:18 -0000
Received: from outbound.icp-qv1-irony-out1.iinet.net.au (HELO outbound.icp-qv1-irony-out1.iinet.net.au) (203.59.1.108) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Sat, 14 Jun 2008 03:56:11 -0700
Received: from unknown (HELO [192.168.1.1]) ([203.158.58.4]) by outbound.icp-qv1-irony-out1.iinet.net.au with ESMTP; 14 Jun 2008 18:56:07 +0800
Delivered-To: cpan-bug+Gtk2-Ex-Datasheet-DBI@diesel.bestpractical.com
Subject: Re: [rt.cpan.org #36740] multiple columns for primary key
Return-Path: <dan@entropy.homelinux.org>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org
Date: Sat, 14 Jun 2008 20:36:57 +1000
X-Spam-Level: *
Message-Id: <1213439817.4537.55.camel@metabox.entropy.homelinux.org>
To: bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org, user42@zip.com.au
Content-Transfer-Encoding: 8bit
From: Daniel Kasak <dan@entropy.homelinux.org>
RT-Message-ID: <rt-3.6.HEAD-32546-1213440994-693.36740-0-0@rt.cpan.org>
Content-Length: 2373
On Fri, 2008-06-13 at 20:39 -0400, Kevin Ryde via RT wrote:
Show quoted text
> Fri Jun 13 20:39:51 2008: Request 36740 was acted upon. > Transaction: Ticket created by user42@zip.com.au > Queue: Gtk2-Ex-Datasheet-DBI > Subject: multiple columns for primary key > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: user42@zip.com.au > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=36740 > > > > I tried editing a row in a datasheet where the primary key had multiple > columns, and the edit was applied to multiple rows of the table. > > It'd be good if multi-column primary keys could be supported. (I'm > using sqlite and the "primary_key_info" already in use has all the > columns.)
Hi. Thanks for using my software :) The only setup we support is an auto-incrementing primary key. I should probably make this clear in the documentation. If you have a read of the insert, update and last_insert_id methods of Gtk2::Ex::DBI & Gtk2::Ex::Datasheet::DBI, you'll see why. You can keep your existing multi-column KEY, but you should add an auto_incrementing primary key to all tables you want to edit. This requirement is in no way exclusive to Gtk2::Ex::DBI & Gtk2::Ex::Datasheet::DBI. The only app that I know of that allows anything else is MS Access, and it uses timestamps instead. Having said that, if you can add support for multi-column primary keys without breaking things, I'll happily add it. It's never really crossed my mind to do it. I *did* think about supporting non-incrementing primary keys, but that lead to a number of problems that made me change my mind.
Show quoted text
> Or if it's a bit hard for the moment I guess going read-only > on multi-column primary key would prevent strange updates etc.
Yes that makes more sense. I already do this when I find a table with *no* primary key. I'll have to make myself such a table and test to see how to detect for it in various DB servers. I'll be working on a new release over the next couple of days. I'll try to add this to the list. Unfortunately I lost my entire website in a server meltdown ( again ). But I'll release via cpan soon. Thanks again for trying out my software. Of course, I think you should also check out Gtk2::Ex::DBI, which you use with Glade to create forms. Gtk2::Ex::Datasheet::DBI is based on Gtk2::Ex::DBI. Dan
MIME-Version: 1.0
X-Spam-Status: No, hits=-2.6 required=8.0 tests=BAYES_00
In-Reply-To: <1213439817.4537.55.camel@metabox.entropy.homelinux.org> (Daniel Kasak's message of "Sat, 14 Jun 2008 20:36:57 +1000")
References: <RT-Ticket-36740@rt.cpan.org> <878wx8g8at.fsf@blah.blah> <rt-3.6.HEAD-32567-1213403992-1530.36740-4-0@rt.cpan.org> <1213439817.4537.55.camel@metabox.entropy.homelinux.org>
Content-Type: text/plain; charset=utf-8
X-RT-Original-Encoding: utf-8
Received: from x1.develooper.com (x1.develooper.com [63.251.223.170]) by diesel.bestpractical.com (Postfix) with SMTP id 59F324D803E for <bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org>; Sun, 15 Jun 2008 20:18:12 -0400 (EDT)
Received: (qmail 28491 invoked from network); 16 Jun 2008 00:18:11 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 16 Jun 2008 00:18:11 -0000
Received: from mailout2-1.pacific.net.au (HELO mailout2.pacific.net.au) (61.8.2.224) by 16.mx.develooper.com (qpsmtpd/0.43rc1) with ESMTP; Sun, 15 Jun 2008 17:18:08 -0700
Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout2.pacific.net.au (Postfix) with ESMTP id D096AB54FA for <bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org>; Mon, 16 Jun 2008 10:18:04 +1000 (EST)
Received: from blah.blah (ppp25F3.dyn.pacific.net.au [61.8.37.243]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id 36E528C28 for <bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org>; Mon, 16 Jun 2008 10:18:04 +1000 (EST)
Received: from gg by blah.blah with local (Exim 4.69) (envelope-from <gg@zip.com.au>) id 1K82Pb-0001jR-0A for bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org; Mon, 16 Jun 2008 10:17:31 +1000
Delivered-To: cpan-bug+Gtk2-Ex-Datasheet-DBI@diesel.bestpractical.com
User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.2 (gnu/linux)
Subject: Re: [rt.cpan.org #36740] multiple columns for primary key
Return-Path: <gg@zip.com.au>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org
Date: Mon, 16 Jun 2008 10:17:29 +1000
X-Spam-Level: *
Message-Id: <878wx65j3a.fsf@blah.blah>
To: bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org
Content-Transfer-Encoding: quoted-printable
From: Kevin Ryde <user42@zip.com.au>
RT-Message-ID: <rt-3.6.HEAD-19197-1213575499-1522.36740-0-0@rt.cpan.org>
Content-Length: 1153
Daniel Kasak <dan@entropy.homelinux.org> writes:
Show quoted text
> > The only setup we support is an auto-incrementing primary key.
I didn't realize that.
Show quoted text
> If you have a read of the insert, update and last_insert_id methods of > Gtk2::Ex::DBI & Gtk2::Ex::Datasheet::DBI, you'll see why.
Ah. I only got as far as the "update" in apply() of CHANGED, which looked like it might take anything for the "$primary_key=?" bit.
Show quoted text
> You can keep your existing multi-column KEY, but you should add an > auto_incrementing primary key to all tables you want to edit.
That might be possible, I've got a couple of tables with my own id numbers to uniquify rows anyway. Though I've also got bits like CREATE TABLE split ( symbol TEXT NOT NULL, date DATE NOT NULL, new TEXT NOT NULL, -- number old TEXT NOT NULL, -- number note TEXT DEFAULT NULL, PRIMARY KEY (symbol, date)) or even a primary key "(symbol, date, type)" for multiple flavours of row with the same date. I made my own custom TreeModel for a big data block, but for the rest I was thinking "why can't someone else do it?" :-)
From gg@zip.com.au Mon May 31 20: 06:50 2010
MIME-Version: 1.0
X-Spam-Status: No, score=-10.553 tagged_above=-99.9 required=10 tests=[AWL=0.046, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8] autolearn=ham
In-Reply-To: <1213439817.4537.55.camel@metabox.entropy.homelinux.org> (Daniel Kasak's message of "Sat, 14 Jun 2008 20:36:57 +1000")
X-Spam-Flag: NO
References: <RT-Ticket-36740@rt.cpan.org> <878wx8g8at.fsf@blah.blah> <rt-3.6.HEAD-32567-1213403992-1530.36740-4-0@rt.cpan.org> <1213439817.4537.55.camel@metabox.entropy.homelinux.org>
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
Message-ID: <87sk57k43s.fsf@blah.blah>
Content-Type: text/plain; charset="utf-8"
X-RT-Original-Encoding: utf-8
X-Spam-Score: -10.553
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 840EA2407CA for <cpan-bug+Gtk2-Ex-Datasheet-DBI@hipster.bestpractical.com>; Mon, 31 May 2010 20:06:50 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UZKiaoFDN3q8 for <cpan-bug+Gtk2-Ex-Datasheet-DBI@hipster.bestpractical.com>; Mon, 31 May 2010 20:06:48 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id CDB58240791 for <bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org>; Mon, 31 May 2010 20:06:47 -0400 (EDT)
Received: (qmail 22465 invoked by uid 103); 1 Jun 2010 00:07:33 -0000
Received: from x16.dev (10.0.100.26) by x1.dev with QMQP; 1 Jun 2010 00:07:33 -0000
Received: from mailout1-3.pacific.net.au (HELO mailout1.pacific.net.au) (61.8.2.210) by 16.mx.develooper.com (qpsmtpd/0.80) with ESMTP; Mon, 31 May 2010 17:07:31 -0700
Received: from mailproxy1.pacific.net.au (mailproxy1.pacific.net.au [61.8.2.162]) by mailout1.pacific.net.au (Postfix) with ESMTP id 370B95A73F2 for <bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org>; Tue, 1 Jun 2010 10:07:27 +1000 (EST)
Received: from blah.blah (ppp2956.dyn.pacific.net.au [61.8.41.86]) by mailproxy1.pacific.net.au (Postfix) with ESMTP id B3DDD8C0E for <bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org>; Tue, 1 Jun 2010 10:07:26 +1000 (EST)
Received: from gg by blah.blah with local (Exim 4.71) (envelope-from <gg@zip.com.au>) id 1OJF0q-0002wK-O4 for bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org; Tue, 01 Jun 2010 10:07:20 +1000
Delivered-To: cpan-bug+Gtk2-Ex-Datasheet-DBI@hipster.bestpractical.com
Subject: Re: [rt.cpan.org #36740] multiple columns for primary key
User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)
Return-Path: <gg@zip.com.au>
X-Spam-Check-BY: 16.mx.develooper.com
X-Original-To: cpan-bug+Gtk2-Ex-Datasheet-DBI@hipster.bestpractical.com
X-RT-Mail-Extension: gtk2-ex-datasheet-dbi
Date: Tue, 01 Jun 2010 10:07:19 +1000
X-Spam-Level:
To: bug-Gtk2-Ex-Datasheet-DBI@rt.cpan.org
From: Kevin Ryde <user42@zip.com.au>
RT-Message-ID: <rt-3.8.HEAD-10882-1275350858-1112.36740-0-0@rt.cpan.org>
Content-Length: 376
Daniel Kasak <dan@entropy.homelinux.org> writes:
Show quoted text
> > The only setup we support is an auto-incrementing primary key. I should > probably make this clear in the documentation.
Is it possible to ask the datasheet to use the sqlite ROWID if I don't otherwise have a suitable primary key? I suppose the datasheet code would have to look at $dbh->last_insert_id() when inserting.


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.