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 |
#6 in #column-name
22KB
207 lines
ods2sql
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 toTEXT
type and saved astrue
/false
text.
- Boolean cell values (e.g.
- Empty cells/errors are inserted as
NULL
SQLite value. - Maximum number of columns is limited by:
SQLITE_LIMIT_VARIABLE_NUMBER
to 999 parameters inINSERT
statements.SQLITE_MAX_COLUMN
to 2000 columns in a table.- LibreOffice has a hardcoded limit of 1024 columns.
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
~40MB
~722K SLoC