Example of a using DBi.Postgresql with GLORP

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

Example of a using DBi.Postgresql with GLORP

Tim Kack
Hi all,

I have a couple of very easy questions and if someone have pointers on
how to proceed I would be very happy:

The first question how do I simply connect using the DBI.Postgresql
accessor for GLORP in gst?

VW would do something like this:

|login accessor|
    login := Login new database: PostgreSQLPlatform new;
       username: 'usernameHere';
       password: 'passwordHere';
       connectString: '127.0.0.1_test'.
    accessor := DatabaseAccessor forLogin: login.
    accessor login.

The second thing is more of an opinion question:

Is it worthwhile to port GOODS to gst? Or would it better to focus on
the larger and quite mature EyeDB (but without smalltalk bindings)
odbms?

Apologies if this is really basic stuff but I need to figure out how to
use the DBI framework to be able to slowly port a newer version of
GLORP.
With an upto date Glorp I can start to do some benchmarks between some
opensource RDBMSes and ODBMses.

Best regards,
Tim



_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Example of a using DBi.Postgresql with GLORP

Paolo Bonzini-2
On 10/20/2009 12:08 AM, Tim Kack wrote:
> Hi all,
>
> I have a couple of very easy questions and if someone have pointers on
> how to proceed I would be very happy:
>
> The first question how do I simply connect using the DBI.Postgresql
> accessor for GLORP in gst?

The platform classes have been ported only to MySQL.

If you want to stick with PG, I think it's easier if you use ROE
instead.  ROE and DBI are very integrated (to the point that the
DBI.Table class is a subclass of ROE.RASQLRelation!), so every DBI
provider must support ROE.

For examples on how to use the DBI framework, I think your best bet is
to look at the Table class in packages/dbi/Table.st.

> Is it worthwhile to port GOODS to gst? Or would it better to focus on
> the larger and quite mature EyeDB (but without smalltalk bindings)
> odbms?

I'll let others answer since I am not very familiar with these technologies.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Example of a using DBi.Postgresql with GLORP

Tim Kack
In reply to this post by Tim Kack
Hi Nigel,

Thanks a lot. I will give it a go and see if I can make the failing
tests to work as well.

Cheers,
Tim

On Fri, 2009-10-23 at 10:03 +1100, Nigel Williams wrote:

> On 20/10/2009, at 9:08 AM, Tim Kack wrote:
>
> > |login accessor|
> >   login := Login new database: PostgreSQLPlatform new;
> >      username: 'usernameHere';
> >      password: 'passwordHere';
> >      connectString: '127.0.0.1_test'.
> >   accessor := DatabaseAccessor forLogin: login.
> >   accessor login.
>
> The version of GLORP that's packaged with GNU Smalltalk doesn't work  
> with PostgreSQL.
>
> If you're planning on getting a newer version working, you may be  
> interested in the work I've done porting the version that's packaged  
> with VW 7.6. It's at http://elder-gods.net/~nigelw/glorp2004.tar.gz 
> and while it's not complete and the test cases don't all run, I am  
> actually using it day to day with a PostgreSQL database. :)
>
> The code I'm using to set the login up is:
>
>             login := (Glorp.Login new)
>                 database: Glorp.PostgreSQLPlatform new;
>                 username: nil;
>                 password: nil;
>                 connectString: 'dbi:PostgreSQL:db=appdb';
>                 yourself.
>             accessor := Glorp.DatabaseAccessor forLogin: login.
>             accessor logging: true.
>             accessor login.
>             session := Glorp.GlorpSession new.
>             session system: (MyDescriptorSystem forAccessor: accessor).
>             session accessor: accessor.
>
>
> Nigel




_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk
Reply | Threaded
Open this post in threaded view
|

Re: Example of a using DBi.Postgresql with GLORP

Paolo Bonzini-2
> Thanks a lot. I will give it a go and see if I can make the failing
> tests to work as well.

Can you register the project on smaltalk.gnu.org?  It would be great
to have a repository on a place such as github.

Once all or most tests pass I'll drop Glorp from the main gst tarball.

Paolo


_______________________________________________
help-smalltalk mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/help-smalltalk