Re: [CDBI] How to retrieve meta information from database: not null, default, ...?

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

From: David Baird
Subject: Re: [CDBI] How to retrieve meta information from database: not null, default, ...?
Date: 21:29 on 12 Sep 2005
On 12 Sep 2005 07:53:51 -0700, Randal L. Schwartz <merlyn@xxxxxxxxxx.xxx> w=
rote:
> >>>>> "Alex" =3D=3D Alex Aminoff <alex@xxxxxxxxx.xxx> writes:
>=20
> Alex> Is there some sort of plugin that does this?
>=20
> Call $dbh->column_info("","",$table,$column)->fetchall_arrayref({})
> and dump the resulting data structure.  Perhaps the IS_NULLABLE and
> COLUMN_DEF info will give you what you want.
>=20

There's a couple of helper classes in CDBI::FormBuilder that
encapsulate this. They can be used independently of CDBI::FB, maybe I
should release them separately. Very sparse docs I'm afraid.
Use CDBI::FB::Meta::Table to set up the metadata. Its column() method
returns CDBI::FB::Meta::Column objects. Tweak the list of metadata
you're interested in at the top of CDBI::FB::M::Column.

d.

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

[CDBI] Question
Tyler Rorabaugh 06:55 on 08 Sep 2005

Re: [CDBI] Question
merlyn (Randal L. Schwartz) 10:57 on 08 Sep 2005

Re: [CDBI] How to retrieve meta information from database: not null, default, ...?
David Baird 21:29 on 12 Sep 2005

Re: [CDBI] Question
Matt S Trout 13:11 on 08 Sep 2005

Generated at 23:46 on 13 Sep 2005 by mariachi v0.52