Split large core modules into focused child modules (#102)
This commit is contained in:
1 parent
b9023c1d15
commit
4548b6ac64
12 files changed
+674
-644
No files matched your search
@@ -0,0 +1,30 @@
|
||||
use rusqlite::{Connection, params};
|
||||
|
||||
use crate::model::Match;
|
||||
|
||||
/// Returns whether the Match was new.
|
||||
pub(super) fn insert_match(
|
||||
db: &Connection,
|
||||
puuid: &str,
|
||||
m: &Match,
|
||||
queue_id: u32,
|
||||
raw: &str,
|
||||
) -> rusqlite::Result<bool> {
|
||||
let inserted = db.execute(
|
||||
"INSERT OR IGNORE INTO matches
|
||||
(puuid, match_id, queue_id, champion_id, champion_name, placement, win, started_at_ms, raw)
|
||||
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9)",
|
||||
params![
|
||||
puuid,
|
||||
m.match_id,
|
||||
queue_id,
|
||||
m.champion_id,
|
||||
m.champion_name,
|
||||
m.placement,
|
||||
m.win,
|
||||
m.started_at_ms,
|
||||
raw
|
||||
],
|
||||
)?;
|
||||
Ok(inserted == 1)
|
||||
}
|
||||
Reference in new issue
Block a user