[Seaside] Re: [Q] Question on Magma (or other Persistence Engine for Squeak/Seaside)

Brent Pinkney brent at zamail.co.za
Sat Apr 14 08:40:04 UTC 2007


> >> 1. how to perform "SELECT something FROM ... WHERE NAME=xxx" kind of operation in ODB.
> >
> > In Magma:
> > 	people := self getMagmaCollectionForPeople.
> > 	oldies := self people where: [ :p | (p name = 'Smith') & (p age > 60) ].
> > 	oldies do: [ :p | p doSomething ].
> >
> I don't need SQL - I do not like it :-) - 

Me neither - Lava exists solely to (on day) give ODBC SQL access to Magma from 3rd party applications.

> I just want to use dictionary 
> because I think inserting and retrieving to/from magma collection is not
> O(1) like dictionary or SQL DB(I'm not sure). So if above code works
> with speed, I have almost no problem on it. I think tag management part
> will be next big problem for me.

Ok - the #where: [ ... ] example above requires that the collection has indices on the #name and #age attributes.
Magma satisfies the query using its indexes, so it is fast.


More information about the Magma mailing list