[squeak-dev] Testing PostgresV3

Levente Uzonyi leves at caesar.elte.hu
Wed Jul 3 09:54:13 UTC 2019

Hi Tim,

On Tue, 2 Jul 2019, tim Rowledge wrote:

> I've finally got to try out the http://www.squeaksource.com/PostgresV3 package and it's nearly kinda working. I think.

Great news.

> Warning - I know very little about databases. I probably don't even know the right words to use...
> Installing
> --------
> This was a bit more tricky than I'd like because there is no immediately obvious advice on installing.  First time I tried to load the "oh that looks a plausible root package" PostgresV3 but it actually locked up my image completely. So that's probably not the thing to load...
> Loading Core, Help & DBAPI seems to have installed a basic setup ok. It's certainly nice to have the Help package added to the system, but it would need quite a lot of expansion to assist DB-newbies like me.

Right. The "root" package is only there to keep the full history or the 
project. It was split into multiple packages a while ago, but the "root" 
package should still work in Squeak 4.3 and/or 4.4.

If you want to load everything there is, then use the following installer 

Installer ss
 	project: 'PostgresV3';
 	addPackage: 'JSON';
 	addPackage: 'PostgresV3-Core';
 	addPackage: 'PostgresV3-Pool';
 	addPackage: 'PostgresV3-Json';
 	addPackage: 'PostgresV3-CodeMirror';
 	addPackage: 'PostgresV3-Help';
 	addPackage: 'PostgresV3-DBAPI';
 	addPackage: 'PostgresV3-Tests-Core';
 	addPackage: 'PostgresV3-Tests-Pool';

or you can use the Monticello Configuration:

MCMcmUpdater updateFromRepository: 'http://squeaksource.com/PostgresV3'.

You definitely don't need everything from here. What you need depends on 
what you want to achieve with the database and Squeak.

You'll need PostgresV3-Core for sure.
As its name suggests, PostgresV3-Pool contains a connection pool. It is 
convenient to have one around, but if your application is single-threaded 
and you want to write SQL queries as strings, then you can get away with 
not setting up one.
The JSON (which is a fork of the original JSON package[1]) and 
the PostgresV3-Json packages provide JSON support (queries can have json 
parameters and can return json objects).
PostgresV3-CodeMirror provides a way to interact with the database as an 
API. There are functions you can call which can return objects/rows.
PostgresV3-DBAPI is a way to write SQL strings and execute them. I have 
never really used it, because I prefer the API-way. Balázs wrote a mail 
about the latter[2].

> Collectively we could do better with some sort of install guidance for packages on SqueakSource etc; I'm not sure what would really solve it. Perhaps a package called something obvious like 'install' that does loading or at least has a commit message that describes loading or... I know there is the whole 'ConfigurationOfBlah' stuff but how would one be expected to find one starting from SqueakSource?  Some info on the package Wiki that SSrc provides would help too; perhaps even mentioning if SqueakMap has a nice installer ready to help?

Those would be really useful. If only it wouldn't be so cumbersome to 
interact with SqueakMap.

> Testing
> ------
> Almost worked! Got back an error saying the pg_hba.conf didn't know my IP, so someone at the office has to do magic. I'd guess that somewhere in PG3Connection>>#processStates one might benefit from checking the received message for error stuff.

Right, low-level error handling could be improved, but in such cases the 
connection is usually closed by the server (as it was in your case due to 
authentication failure).

If you have any questions, Balázs and I are here to help.


[1] http://www.squeaksource.com/JSON.html
[2] http://forum.world.st/Status-of-PostgresV3-td4780110.html#a4780666
> tim
> --
> tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
> I asked Mom if I was a gifted child ... she said they certainly wouldn't have paid for me.

More information about the Squeak-dev mailing list