1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! SQLite export support for Last.fm data types.
//!
//! This module is only available when the `sqlite` feature flag is enabled.
//!
//! # Example
//! ```ignore
//! use lastfm_client::LastFmClient;
//!
//! let client = LastFmClient::new("your_api_key")?;
//! let path = client
//! .recent_tracks("username")
//! .fetch_and_save_sqlite("recent_tracks")
//! .await?;
//! println!("Saved to {path}");
//! ```
/// Trait for types that can be exported to a `SQLite` database.
///
/// Implementors declare their table schema and provide row-binding logic,
/// enabling generic bulk-insert operations across all data types.
/// Trait for types that can be loaded from a `SQLite` database.
///
/// This is the read-side companion to [`SqliteExportable`]. Implementors
/// declare a SELECT query and a row-to-value mapping function, enabling
/// [`crate::file_handler::FileHandler::load_sqlite`] to work generically
/// across all data types.
///
/// # Field coverage
///
/// `SQLite` schemas store a curated subset of each type's fields (see the
/// `SqliteExportable` schema for each type). Fields that are **not** stored
/// (e.g. `image`, `streamable`, human-readable date strings) are
/// reconstructed with sensible empty/default values on load. The loaded
/// data is fully usable for analysis — all aggregation methods such as
/// `to_set()`, `top_artists()`, `by_date()`, etc. work correctly.