#sqlite #spreadsheet #ods #sql #column-name

app ods2sql

Create a sqlite3 database from an ODS spreadsheet

6 releases (3 breaking)

0.4.0 Oct 24, 2020
0.3.1 Oct 21, 2020
0.3.0 Mar 13, 2019
0.2.0 Jan 24, 2019
0.1.0 Aug 17, 2018

#2034 in Command line utilities

AGPL-3.0-or-later

22KB
207 lines

ods2sql

license build status

ods2sql creates SQLite database out of your ODS spreadsheet.

Details:

  • Cell values in the first row are used for SQLite column names.
  • To simplify things, all data from spreadsheet is treated as TEXT SQLite type.
    • Boolean cell values (e.g. true/false) are converted to TEXT type and saved as true / false text.
  • Empty cells/errors are inserted as NULL SQLite value.
  • Maximum number of columns is limited by:

Caution!

It works for me, and if it eats your data that's your problem. Read the LICENSE.

Patches for bugs are welcome.

Usage

To create spreadsheet.sqlite out of spreadsheet.ods:

ods2sql spreadsheet.ods

Install

The easiest way is to use Cargo:

cargo install ods2sql

Don't forget to add place where Cargo installs binaries to your PATH for convenience, e.g.:

echo 'export PATH="$PATH:$HOME/.cargo/bin"' >> ~/.bashrc
source ~/.bashrc

Updating

In case of newer version, updating is almost like installing:

cargo install --force ods2sql

License

Licensed under AGPLv3+. For details, see LICENSE.

Dependencies

~32MB
~657K SLoC