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 inserting data in a new template #2

Open maressyl opened 9 years ago

maressyl commented 9 years ago

Template is LibreOffice 3.5.5, current LibreOffice version is 4.4.0

maressyl commented 4 years ago

Solved in d43933a

maressyl commented 4 years ago

As observed with #8, it will be a bit more complicated than just updating the packaged template file, as it seems newer .odb files require a different processing to not be considered "corrupted" by LibreOffice.

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.

kamapu commented 4 years ago

Some news on this issue? As mentioned before, I'm able to create databases in PostgreSQL and MySQL from own packages but for a broader audience (students and colleagues with little background on relational databases) it is quite crucial to be able to write databases for Base (LibreOffice) and yours is the only R-package aiming to such task (isn't it?).

maressyl commented 4 years ago

It is the only package with this purpose I know indeed. Unfortunately the problem seems quite complex as it requires to dive into the ODF specifications without any clue on what LibreOffice doesn't like with our file (which is quite frustrating...), and unfortunately I don't have this kind of free time these days. I will try my best but can't guarantee it will be fixed soon unfortunately, any help with narrowing the problem would be very welcome.

Best, Sylvain

kamapu commented 4 years ago

I wish, I could help but this is out of my expertise.

Did you tried contacting developers of LibreOffice?

We are writing Base Files with your package and then importing the content into R (to harmonize input tables that are usually cross tables and relational models with column-oriented tables). At the moment we didn't detected any problem with the data contained in the files once we read the tables in R...

kamapu commented 4 years ago

I would try to post the issue in the libreoffice.org distribution list, thus I will complement with an example.

kamapu commented 4 years ago

While the file is not opened by LibreOffice, the content of the database is still there.

1) The database is created in R

library(ODB)

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)

2) The file is written in the working directory but any attempt to open it retrieves an error message.

Screenshot from 2020-09-18 18-18-31

3) By pushing the button Yes you open an empty LibreOffice Write document.

4) Interestingly, you can open the database in R and retrieve its content without any problem.

odb <- odb.open("test.odb")
odb.read(odb, "SELECT * FROM fruits")

#>     NAME
#> 1 banana
#> 2  peach
#> 3   pear