RE: [CDBI] Dealing with non-required primary keys

[prev] [thread] [next] [Date index for 2005/09/04]

From: John Drago
Subject: RE: [CDBI] Dealing with non-required primary keys
Date: 03:35 on 04 Sep 2005
>=20
> > > It's not really important to add a constraint to Class::DBI to
handle
> > > the typename; the RDBMS will take care of that.  What is important
is
> > > how to deal with the typeid.
> >
> > What do you mean - "how to deal with the typeid"?
> How to tell Class::DBI that the typeid is a generated by the database
upon
> insertion.

It sounds like you're running into problems with auto-increment fields.
I've used Class:DBI on MySQL and Postgres without any problems.  What
database are you having issues with?

> >
> > > So what would you recommend?  Is this a technical feat that can't
be
> > > accomplished in Class::DBI?  I should mention that "don't use
primary
> > > keys" isn't really an option.  I need to use primary keys because
I'm
> > > using quite a few "has_a" relationships in other modules that use
the
> > > primary keys I'm using.
> >
> > Is there something preventing you from doing it this way?
> >
> "has_a" relationships are used in linking foreign keys to primary
keys.
> If you don't correctly specify the primary keys, then they don't work.
> If this explanation isn't sufficient, you're going to have to expound
> upon what you mean by "this way," as I'm taking it to mean "not using
> primary keys."
>=20

By "this way" I mean this:

  Music::CD->has_a(artist =3D> 'Music::Artist');
  print $cd->artist->name;

Is there another way you're using foreign keys in has_a() relationships?

>=20
> _______________________________________________
> ClassDBI mailing list
> ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
> http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi


_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

(message missing)

[CDBI] Dealing with non-required primary keys
Rusty Phillips 01:20 on 04 Sep 2005

RE: [CDBI] Dealing with non-required primary keys
Rusty Phillips 02:39 on 04 Sep 2005

Re: [CDBI] Dealing with non-required primary keys
Peter Speltz 10:17 on 04 Sep 2005

Re: [CDBI] Dealing with non-required primary keys
Rusty Phillips 11:24 on 04 Sep 2005

Re: [CDBI] Dealing with non-required primary keys
Peter Speltz 11:44 on 04 Sep 2005

Re: [CDBI] Dealing with non-required primary keys
Peter Speltz 11:46 on 04 Sep 2005

RE: [CDBI] Dealing with non-required primary keys
John Drago 03:35 on 04 Sep 2005

Re: [CDBI] Dealing with non-required primary keys
Rusty Phillips 12:04 on 04 Sep 2005

Re: [CDBI] Dealing with non-required primary keys
Matt S Trout 12:12 on 04 Sep 2005

Generated at 13:57 on 10 Sep 2005 by mariachi v0.52