Re: [CDBI] How to retrieve meta information from database: not null, default, ...?
[prev]
[thread]
[next]
[Date index for 2005/09/12]
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