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

Sungjin Chun chunsj at embian.com
Fri Apr 13 07:54:24 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Following method - under this message is my schema generation class
method for my personal seaside application. As you know I'm using
SQLite3 through FFI. My problem is that the speed is rather slow even
though I'm the only user if the number of record grows especially
finding records with tags.

Ok, now my real question is that can anyone provide me simple example of
Magma or other OODB or persistence engine for squeak/seaside so that I
can convert following SQLite3 based system to suggested one. My only
restriction is that squeak/seaside should not be affected by accidental
quit/close. For example, I've had problems with MinneStore when I close
squeak without saving and move/rename my folder/directory though I did
not specify fixed db path.

Thanks in advance and following is my method.

createSchema
	"self createSchema"
	| db |
	db _ SQLiteConnection fileNamed: self dbPath.

	db executeQuery: 'CREATE TABLE NOTE(NID INTEGER PRIMARY KEY
AUTOINCREMENT, TITLE STRING, DESCR STRING)'.
	db executeQuery: 'CREATE INDEX NOTETITLE ON NOTE (TITLE)'.

	db executeQuery: 'CREATE TABLE SOMEDAY(NID INTEGER PRIMARY KEY
AUTOINCREMENT, TITLE STRING, DESCR STRING)'.
	db executeQuery: 'CREATE INDEX SOMEDAYTITLE ON SOMEDAY (TITLE)'.

	db executeQuery: 'CREATE TABLE ACTION(NID INTEGER PRIMARY KEY
AUTOINCREMENT, TITLE STRING, DESCR STRING, DONE CHARACTER(1))'.
	db executeQuery: 'CREATE INDEX ACTIONTITLE ON ACTION (TITLE)'.
	db executeQuery: 'CREATE INDEX ACTIONDONE ON ACTION (DONE)'.

	db executeQuery: 'CREATE TABLE REMINDER(NID INTEGER PRIMARY KEY
AUTOINCREMENT, TITLE STRING, DESCR STRING, DONE CHARACTER(1), DUEDATE
INTEGER)'.
	db executeQuery: 'CREATE INDEX REMINDERTITLE ON REMINDER(TITLE)'.
	db executeQuery: 'CREATE INDEX REMINDERDONE ON REMINDER(DONE)'.
	db executeQuery: 'CREATE INDEX REMINDERDUEDATE ON REMINDER(DUEDATE)'.

	db executeQuery: 'CREATE TABLE WAITFOR(NID INTEGER PRIMARY KEY
AUTOINCREMENT, TITLE STRING, DESCR STRING, DONE CHARACTER(1), DUEDATE
INTEGER, OWNERS STRING)'.
	db executeQuery: 'CREATE INDEX WAITFORTITLE ON WAITFOR(TITLE)'.
	db executeQuery: 'CREATE INDEX WAITFORDONE ON WAITFOR(DONE)'.
	db executeQuery: 'CREATE INDEX WAITFORDUEDATE ON WAITFOR(DUEDATE)'.

	db executeQuery: 'CREATE TABLE TAG(TID INTEGER PRIMARY KEY
AUTOINCREMENT, NAME STRING)'.
	db executeQuery: 'CREATE INDEX TAGNAME ON TAG(NAME)'.

	db executeQuery: 'CREATE TABLE OBJTAG(RID INTEGER PRIMARY KEY
AUTOINCREMENT, NID INTEGER, TID INTEGER, NCLS STRING)'.
	db executeQuery: 'CREATE INDEX OBJTAGCLS ON OBJTAG(NCLS)'.
	db executeQuery: 'CREATE INDEX OBJTAGNID ON OBJTAG(NID)'.
	db executeQuery: 'CREATE INDEX OBJTAGTID ON OBJTAG(TID)'.
	db executeQuery: 'CREATE INDEX OBJTAGNIDCLS ON OBJTAG(NID, NCLS)'.

	db executeQuery: 'SELECT LAST_INSERT_ROWID()'.
	db close.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGHzcwQqspS1+XJHgRAo4fAJ9K4UYVditWAGHAPmy9uD+xon/t4ACeNwLm
VwyGcu8giklajGPj1WLLn9A=
=Js/x
-----END PGP SIGNATURE-----



More information about the Squeak-dev mailing list