Re: Include views in genscripts

Jacob Smullyan <[email protected]> Wed, 1 Jun 2005 22:58:12 -0400
Newsgroups gmane.comp.web.skunkweb
Message-ID <[email protected]>
On Mon, May 30, 2005 at 10:39:27AM +0100, Hamish Lawson wrote:
> I modified the ogenscript script in PyDO 1 so that it only included 
> views as well as tables. What about adopting this for the official version?

Sorry for delay in response.

In PyDO2, dbi's listTables() certainly should list views, also; it
does for postgresql now.  

Currently listTables()isn't used internally.  A function that
populates a module with PyDO classes corresponding to a single
db/schema would be very simple (although pointless, probably, since
you couldn't customize them) and a genscript, when it exists, will use
it.

So far, there hasn't been much positive sentiment expressed about a
genscript for PyDO2, but I think it could be a time-saver in preparing
a skeleton for an api (even if you prefer the generated classes to do
runtime field introspection).  The goal here, I think, should be to
have one db-neutral genscript that delegates all the introspective
work to the dbi driver.  A trivial one that didn't try to figure out
relations between tables is doable now; one savvy about foreign keys
would require more of the dbi api than we have so far.  

js

-- 
Jacob Smullyan
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFCnnXEuqamFyFXXLIRAvreAKC2D9D+tcjhc2Vt7xOQx7GUiEQNwQCfdTKl
T9uucJaqKreXPIH0FrqqCSs=
=ej1N
-----END PGP SIGNATURE-----