Skip to content

prrvchr/SQLiteOOo

Repository files navigation

SQLiteOOo logo Documentation

Ce document en français.

The use of this software subjects you to our Terms Of Use.

version 1.2.0

Introduction:

SQLiteOOo is part of a Suite of LibreOffice and/or OpenOffice extensions allowing to offer you innovative services in these office suites.

This extension allows you to use SQLite JDBC database in embedded mode, making the database portable (a single odb file).
It allows you to take advantage of the ACID properties of the underlying SQLite database.

Being free software I encourage you:

  • To duplicate its source code.
  • To make changes, corrections, improvements.
  • To open issue if needed.

In short, to participate in the development of this extension.
Because it is together that we can make Free Software smarter.


Requirement:

The SQLiteOOo extension uses the jdbcDriverOOo extension to work.
It must therefore meet the requirement of the jdbcDriverOOo extension.

Since version 1.2.0, only LibreOffice 24.2.x or higher is supported. If it is not possible for you to use such a version, use the previous version of SQLiteOOo. But in this case, this extension cannot be installed with the HyperSQLOOo extension, see bug #156471. In addition, it will be difficult for you to migrate odb files created under lower versions of SQLiteOOo. I recommend using LibreOffice 24.2.x minimum with SQLiteOOo 1.2.0 or higher.

On Linux and macOS the Python packages used by the extension, if already installed, may come from the system and therefore may not be up to date.
To ensure that your Python packages are up to date it is recommended to use the System Info option in the extension Options accessible by:
Tools -> Options -> Base drivers -> Embedded SQLite Driver -> View log -> System Info
If outdated packages appear, you can update them with the command:
pip install --upgrade <package-name>

For more information see: What has been done for version 1.1.0.


Installation:

It seems important that the file was not renamed when it was downloaded.
If necessary, rename it before installing it.

  • jdbcDriverOOo logo Install jdbcDriverOOo.oxt extension Version

    This extension is necessary to use SQLite version 3.42.0.0 with all its features.

  • SQLiteOOo logo Install SQLiteOOo.oxt extension Version

Restart LibreOffice after installation.
Be careful, restarting LibreOffice may not be enough.

  • On Windows to ensure that LibreOffice restarts correctly, use Windows Task Manager to verify that no LibreOffice services are visible after LibreOffice shuts down (and kill it if so).
  • Under Linux or macOS you can also ensure that LibreOffice restarts correctly, by launching it from a terminal with the command soffice and using the key combination Ctrl + C if after stopping LibreOffice, the terminal is not active (no command prompt).

Use:

How to create a new database:

In LibreOffice / OpenOffice go to File -> New -> Database...:

SQLiteOOo screenshot 1

In step: Select database:

  • select: Create a new database
  • in: Emdedded database: choose: Embedded SQLite Driver
  • click on button: Next

SQLiteOOo screenshot 2

In step: Save and proceed:

  • adjust the parameters according to your needs...
  • click on button: Finish

SQLiteOOo screenshot 3

Have fun...


How does it work:

SQLiteOOo is an com.sun.star.sdbc.Driver UNO service written in Python.
It is an overlay to the jdbcDriverOOo extension allowing to store the SQLite database in an odb file (which is, in fact, a compressed file).

Its operation is quite basic, namely:

  • When requesting a connection, several things are done:
  • When closing or renaming (Save As) the odb file, if the connection was successful, the DocumentHandler copies all files present in the subdirectory into the (new) database directory of the odb file (zip), then delete the subdirectory.

The main purpose of this mode of operation is to take advantage of the ACID characteristics of the underlying database in the event of an abnormal closure of LibreOffice. On the other hand, the function: file -> Save has no effect on the underlying database. Only closing the odb file or saving it under a different name (File -> Save As) will save the database in the odb file.


Has been tested with:

  • LibreOffice 24.2.1.2 - Ubuntu 22.04

I encourage you in case of problem 😕
to create an issue
I will try to solve it 😄


Historical:

What has been done for version 1.0.0:

What has been done for version 1.0.1:

  • Fixed bug 156511 occurring when using the com.sun.star.embed.XStorage interface. The workaround is to use the copyElementTo() method instead of moveElementTo(). Versions of LibreOffice 7.6.x and higher become usable.

What has been done for version 1.0.2:

  • The absence or obsolescence of jdbcDriverOOo extension necessary for the proper functioning of SQLiteOOo now displays an error message.

  • Many other things...

What has been done for version 1.1.0:

  • All Python packages necessary for the extension are now recorded in a requirements.txt file following PEP 508.
  • Now if you are not on Windows then the Python packages necessary for the extension can be easily installed with the command:
    pip install requirements.txt
  • Modification of the Requirement section.

What has been done for version 1.1.1:

What has been done for version 1.1.2:

What has been done for version 1.1.3:

  • Support for the latest version of jdbcDriverOOo 1.1.4 and the SQLite-jdbc-3.45.1.6-SNAPSHOT.jar.
  • Now for proper functioning in Base under: Edit -> Database -> Advanced Settings... -> Query of generated values must be left blank. If you want to use an odb file created with a previous version of SQLiteOOo you must change this setting manually.
  • Normally the next versions of SQLiteOOo should be able to be updated in the list of extensions installed under LibreOffice: Tools -> Extension manager... -> Check for Updates.

What has been done for version 1.1.4:

  • Support for the latest version of jdbcDriverOOo 1.3.1.
  • When saving under a different name, the database if open will be closed correctly.

What has been done for version 1.1.5:

  • Use of the new data format implemented in version 1.1.4. As a result, if you need to open odb files created with a version lower than 1.1.4 you must first open them with version 1.1.4, otherwise an error will be thrown.

What has been done for version 1.2.0:

  • This version is based on fix #154989 available since LibreOffice 24.2.x. It can therefore work with other extensions offering integrated database services.
  • Now SQLiteOOo requires LibreOffice 24.2.x minimum and will load for the url: sdbc:embedded:sqlite.

What remains to be done for version 1.2.0:

  • Add new language for internationalization...

  • Anything welcome...