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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Chun, Sungjin
-----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-----
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

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

Hilaire Fernandes-3
I think there is somewere the sushi store example with Magma persistency
you can look at. But moving from RDB to ODB you may need to adapt a bit
your model.

Hilaire


Sungjin Chun a écrit :

> -----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.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

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

Chun, Sungjin
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hilaire Fernandes wrote:
> I think there is somewere the sushi store example with Magma persistency
> you can look at. But moving from RDB to ODB you may need to adapt a bit
> your model.
>
> Hilaire
>

For me, the most difficult part is - and this is my major reason for
previous mail;

1. how to perform "SELECT something FROM ... WHERE NAME=xxx" kind of
operation in ODB.

2. if I save dictionary class to magma, and I changed or added/removed
element from dictionary, the whole dictionary is saved/restored to/from
db file? or just changed element?

Yes, I have almost no experience on this as you might already know, but
I cannot find proper example for me. I'll look on sushi store example.

Thank you.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGH4iBQqspS1+XJHgRAuuUAKDY0oQmaSiW+NUZiVhcK2XReQ2ZCQCdGdl0
Z+5GIoaT7K4arLSE4xxmOnw=
=1qlo
-----END PGP SIGNATURE-----
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside