On 2023-09-07, at 6:02 AM, gettimothy via Squeak-dev squeak-dev@lists.squeakfoundation.org wrote:
Interesting, PG3 takes the postgres jsonb type and converts it into a JsonObject for me.
So, instead of doing asDictionary, I suspect that I should I be able to work on the JsonObject directly without converting it.
Yes, it is a Json object and you can thus do things like accessing items within it by their name - since it cleverly traps the mNU and works it out for you.
heh...there was a moment of "oh! this changes everything" when I saw the
Object asPG3SqlLiteral
Where I thought I could store objects in the database Postgres database directly, but the attempt on an instance of the object only created the Object name
Relational databases are really good at storing huge lists of identical structure rows. Arbitrary structures such as we most commonly use in Smalltalk are not a good match and that's why you need sometimes very complicated code to map from one to the other. It's why GemStone was invented, and Magma, and Glorp - all worth looking up.
If your data includes large lists of the same format, directly using postgresql etc should be fine. My weatherstation stuff for example has a gazillion simple rows of sensor id, the date/time of the reading, the type (temp, humidity, rainfall, etc) and the actual value. Perfect for a relational db table.
If you have more complex structures it might be smart to look at json databases like mongodb as well. (As an aside, I'm a bit confused about mongodb and whether it is open source, free or commercial, etc. Every time I look at a page that appears to offer a 'free download' it seems to try to push me towards a paid option) So far as I can see there is a very old squeak to mongodb interface on squeaksource (http://www.squeaksource.com/MongoTalk.html, an apparently newer version at http://www.smalltalkhub.com/MongoTalkTeam/mongotalk/ ) and a broader spectrum db access package at http://www.squeaksource.com/SqueakDBX
And all that is why I spent much of my life avoiding having anything to do with the damned things.
In Emacs, I can do amazing things with text editing that are not possible in any GUI I have ever worked with, especially squeak. Why reinvent the wheel?
Emacs isn't a wheel, it's a forest of bizarre complicated round-things that can, under some circumstances, be used for wheel-like purposes but only if you remember a gazillion insane key combinations that seem to reularly require more fingers than any natural human has ever had (and I include the small number of people with hexadactily). I used emacs for several years, decades ago, and I still get shudders when it is mentioned.
Also, I freaking hate wikis.
Now that's just plain wrong ;-)
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Meets quality standards: It compiles without errors.