maressyl / R.ODB

R package to create, query and update OpenDocument Database (.odb) files.
http://bioinformatics.ovsa.fr/ODB
GNU General Public License v3.0
1 stars 1 forks source link

Corrupted file according to LibreOffice after data insertion #8

Closed maressyl closed 4 years ago

maressyl commented 4 years ago

The full example gives a file considered as "corrupted" by LibreOffice (6.0.7.3 and 6.3.5.2), despite ODB can continue to handle it without any trouble.

odb.create("test.odb", overwrite="do")
odb <- odb.open("test.odb")
odb.write(odb, "CREATE TABLE fruits (name VARCHAR(6) PRIMARY KEY)")
odb.insert(odb, "fruits", c("banana", "pear", "peach"))
odb.close(odb, write=TRUE)

Table creation without insertion (or insertion into a fileproduced with LibreOffice) does not raise the error.

kamapu commented 4 years ago

In the older version of ODB I experienced this error at LibreOffice Base when I was trying to create a new database by using a template (an empty .odb database including definitions of tables and relationships) BUT it was working when I defined and filled the database using the functions odb.create, odb.open, odb.write, odb.comments, and odb.insert.

In the fresh new version this second option is not working anymore.

Perhaps this may provide additional information to solve the bug. In any case a test with the "template" option should be also considered.

maressyl commented 4 years ago

Actually it is a very useful comment, thanks a lot @kamapu. This problem started when I replaced the old template with a fresher one, so I reverted to the original one and at least it is now possible again to create and fill a database with ODB and browse it with LibreOffice. Unfortunately the workflow you describe (creating the database with LibreOffice and filling it with R) will still fail, despite it is a quite pertinent one. I will need to catch up with the ODB file format and it may take some time.

Something seems to have changed in LibreOffice (not so surprising in about 8 years), ODB doesn't handle properly recent templates (whether the user provide it or I do).

maressyl commented 4 years ago

Of note, templates created with old versions of LibreOffice (3.5.5 was used to create the one currently shipped with the package) should work fine, but I agree it is not very satisfactory.