Conversation
- Introduced new `backup` CLI command - Supports plain backup (.sqlite) and compressed backup: - .zip on Windows - .tar.gz on macOS/Linux - Added localized help and messages via i18n (en/it) - Created backup files in ./backups/ with timestamped names - Added OS-specific dependencies (zip, flate2, tar)
- Introduced new `export` CLI command with mutually exclusive format flags: --csv (default), --json, and --xlsx - Implemented handlers: - handle_export_csv: plain text export with semicolon delimiter - handle_export_json: structured JSON array output - handle_export_xlsx: formatted Excel export using umya-spreadsheet - Added localized help and success messages (en/it) - Unified export file naming with timestamp and default export directory - Ensured cross-platform path creation using dirs crate
- Implemented new `import` CLI command supporting: - `--file <path>` (required) - `--csv` (default) and `--json` subcommands - Unified import logic for CSV and JSON using shared `BookRecord` struct (serde) - Added helper function `insert_book_record()` to handle inserts safely - Enabled `INSERT OR IGNORE` for idempotent imports (skip duplicate ISBNs) - Added verbose logging for skipped records (e.g. "Skipped duplicate ISBN: …") - Added non-blocking log write on import completion - Updated i18n strings for new messages (en/it)
…ments ### Added - New `backup` command: - Creates plain `.sqlite` backups - Optional `--compress` flag for `.zip` (Windows) or `.tar.gz` (Unix) - Timestamped filenames and localized output - New `export` command: - Supports `--csv`, `--json`, and `--xlsx` output formats - Formatted Excel exports via umya-spreadsheet - Cross-platform export path management - New `import` command: - Supports importing from CSV and JSON - Unified structure via `BookRecord` - Idempotent inserts using `INSERT OR IGNORE` - Verbose logging for skipped duplicates - Database migration `PATCH_004_ISBN_INDEX`: - Adds unique index on `books.isbn` to prevent duplicate entries ### Technical - Refactored insert logic into helper `insert_book_record()` - Added non-blocking `write_log` calls in import/export - Extended i18n coverage to new CLI commands and messages - Updated README and CHANGELOG for release 0.2.5 Tag: `v0.2.5`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[0.2.5] - Unreleased
Added
Backup command (
librius backup).sqlitebackups in thebackups/directory--compressflag for compressed backups.zipformat on Windows.tar.gzformat on macOS and LinuxExport command (
librius export)--csv(default): plain text export with semicolon delimiter--json: structured JSON array output--xlsx: formatted Excel file using umya-spreadsheetdirscrate for cross-platform export path handlingImport command (
librius import)--csv(default): semicolon-delimited CSV--json: JSON array of objectsserdeand sharedBookRecordstructisbnINSERT OR IGNOREfor idempotent imports (no duplication)Database
PATCH_004_ISBN_INDEX:books.isbnto prevent duplicatesTechnical
csv = "1.3"for CSV import with serdeinsert_book_record()helper