Hi Torsten

This looks very interesting. I am looking at a project which needs simple 
persistence, and I was considering MongoDB plus Voyage, which looked like 
overkill. I shall definitely be trying PUnQLite.

I am not yet on Pharo 4; I am using Moose 5.0, which is essentially Pharo 3. To 
load PUnQLite, I used the Gofer script on GitHub, the only problem being that 
the config did not load the PunQLite-Tools package; I got that separately by 
using the Monticello browser.

My main purpose here is to tell you about a problem I found when running the 
'comments.db' example below. The database was generated as expected, but when I 
used the Database Browser to examine the results, I found that trying to 
display the comment for some classes caused a PqFetchError. It affects only a 
small proportion of classes; going through the alphabetical list in the 
browser, the first three classes affected are AbstractDistributionMap, 
AbstractEcryptorDecryptor (sic) and AbstractTimeZone. One curiosity is that, 
once the debugger window has popped up for one entry and been closed down, the 
same window appears whichever other entry is selected next.

I have deleted and recreated the 'comments.db' file to see if that would clear 
the problem, but it persisted. This disclosed another curiosity. The 'choose a 
.db' window that pops up when opening the Database Browser has a button to 
delete a file, but it did not delete my database file when I tried it; I had to 
close down Pharo to free the file and then use Windows Explorer.

It seems that the problem is one which affects the Database Browser only; I 
tried a snippet in a workspace which opened the comments.db database and 
retrieved the entry for AbstractDistributionMap, and it worked correctly.

I hope this is enough detail for you to investigate; if not, come back to me.

Best wishes

Peter Kenny


-----Original Message-----
From: Pharo-users [mailto:pharo-users-boun...@lists.pharo.org] On Behalf Of 
Torsten Bergmann
Sent: 29 January 2015 08:20
To: Any question about pharo is welcome; Pharo Development List
Cc: u...@blueplane.jp
Subject: [Pharo-users] [ANN] PUnQLite NoSQL database project updated

Hi,

are you in need for really simple out of image persistency?

If you like to use a small RDBMS solution with Pharo then there is the 
embeddable SQLite shared library and NBSQLite3 project [1] to access it. 
Combine it with Glorp [2] and you do not have to fight too much with SQL.

On the other end of persistency world there are the so called "NoSQL databases" 
and beside Mongo and all the others that require special setup etc. there is 
this wonderful small UnQLite embeddable database [3] that similar to SQlite 
world only requires a simple library.

Thanks to Masashi Umezawa there is a nice wrapper for Pharo already to access 
this tiny embeddable NoSQL database called "PUnQLite" [4] and [5], also 
including access to the Jx9 machinery of UnQLite. It is really cool that he 
made this available.

This week I updated "PUnQLite" a little bit:
   - refactored the Native boost wrapper for UnQLite (using shared pools, ...)
   - documented classes
   - added a help topic
   - fixed a bug in cursors when accessing the keys in an empty database
   - and finally added a small spec based tool to work with a database file 
(see attached screenshot) 
     One can use it to open an unqlite database, show the key value pairs and 
remove or add entries.

If you are in latest Pharo 4 already you can load all of that right from the 
config browser. Be aware that you need the external unqlite shared library 
which is downloaded and extracted into a folder "pharo-vm" when loading the 
config.

For instance on Windows it automagically downloads a file 
"pharo-vm/unqlite.dll" below your image directory and you just have to copy 
this shared library file to the folder where your VM (Pharo.exe) resides. 
Havent tried on other OS platforms.

>From the Pharo side using the UnQLite database basically works like having 
>some kind "external dictionary" in a database file. Just run that in a 
>workspace:

|db|
db := PqDatabase open: 'comments.db'.
db disableAutoCommit.
db transact: [
Object subclasses do: [:cls | | key | 
    key := cls asString.
    db at: key put: cls comment ]
].
db close.

Then open the "Database Browser" from the world menu and open the "comments.db" 
file.
You can browse the keys and values, remove entries or add new. A filter for the 
keys is also included. Nothing fancy but hope you like it or find it usable.

Couldnt make it to PharoConf 2015 but I hope all participants enjoy their time 
there. 
Keep the others updated by using the #pharodays2015 on Twitter. Have fun!

Bye
T.


[1] 
http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/2015-January/104720.html
[2] 
http://lists.pharo.org/pipermail/pharo-users_lists.pharo.org/2015-January/015809.html
[3] http://unqlite.org/
[4] https://github.com/mumez/PunQLite
[5] http://smalltalkhub.com/#!/~MasashiUmezawa/PunQLite


Reply via email to