I don't think an array of hashes and a hash of arrays could perfectly represent a Table type. There are several important facts of a relational model:unordered columns and tupples, various constraints on columns. E.g. how can we represent multi-unique constraints as an array of hashes?
On 4/4/09, Timothy S. Nelson <wayl...@wayland.id.au> wrote: > On Sat, 4 Apr 2009, Xiao Yafeng wrote: > >>>> 3. Could I define primary key for a bag variable? >>> >>> All items in a Bag are "primary keys", but there's no data additional >>> data associated with it. >> >> I mean whether I can see Set as a table and Bag as a table with a >> unique constraint? like: >> subset test of Bag(test_name Str, test_ID Int, primary >> key(test_ID)) > > I don't think you can really do something like that. Perl 6 as > specified leaves many things up to libraries. Implementing a Table type > will > no doubt be one of those things. I would like to have a Table type that > will > work well with the Tree/Plex type that I am working on. > > In the meantime, a table would need to be represented as an array of > hashes, or a hash of arrays. > > HTH, > > > --------------------------------------------------------------------- > | Name: Tim Nelson | Because the Creator is, | > | E-mail: wayl...@wayland.id.au | I am | > --------------------------------------------------------------------- > > ----BEGIN GEEK CODE BLOCK---- > Version 3.12 > GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- > PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y- > -----END GEEK CODE BLOCK----- > >