mirror of
https://github.com/patarapolw/cjdic2.git
synced 2026-11-08 17:35:18 +00:00
db sub schema (via Arc)
This commit is contained in:
1 parent
442e309a81
commit
62cb1e5902
7 files changed
+368
-340
No files matched your search
@@ -5,11 +5,11 @@ use std::{
|
||||
};
|
||||
|
||||
use anyhow::{Context, Ok};
|
||||
use cjdic2_core::db::import_bundled_zip_file;
|
||||
use rusqlite::Connection;
|
||||
use cjdic2_core::db::Database;
|
||||
|
||||
fn main() -> Result<(), anyhow::Error> {
|
||||
let conn = &mut Connection::open("test.db")?;
|
||||
let db = Database::new("test.db")?;
|
||||
|
||||
let zip_dir = Path::new("src-tauri/resources/yomitan");
|
||||
println!("zip_dir: {:?}", absolute(zip_dir)); // Relative to workspace root
|
||||
|
||||
@@ -23,7 +23,7 @@ fn main() -> Result<(), anyhow::Error> {
|
||||
let start = Instant::now();
|
||||
|
||||
println!("zip_file: {:?}", p);
|
||||
println!("{:?}", import_bundled_zip_file(conn, p, "ja")?,);
|
||||
println!("{:?}", db.yomitan().import_bundled_zip_file(p, "ja")?,);
|
||||
println!("[{:.2?}]", start.elapsed(),);
|
||||
} else {
|
||||
println!("not zip_file: {:?}", p);
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
use std::time::Instant;
|
||||
|
||||
use anyhow::Ok;
|
||||
use cjdic2_core::db::search_yomitan;
|
||||
use rusqlite::Connection;
|
||||
use cjdic2_core::db::Database;
|
||||
|
||||
fn main() -> Result<(), anyhow::Error> {
|
||||
let conn = &mut Connection::open("test.db")?;
|
||||
let db = Database::new("test.db")?;
|
||||
|
||||
let start = Instant::now();
|
||||
let rs = search_yomitan(conn, "擦る", "する", 10, 0)?;
|
||||
let rs = db.yomitan().search_yomitan("擦る", "する", 10, 0)?;
|
||||
println!("{:#?}", rs);
|
||||
println!("n={}", rs.len());
|
||||
println!("[{:.2?}]", start.elapsed());
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
use std::time::Instant;
|
||||
|
||||
use anyhow::Ok;
|
||||
use cjdic2_core::db::create_schema;
|
||||
use rusqlite::Connection;
|
||||
use cjdic2_core::db::Database;
|
||||
|
||||
fn main() -> Result<(), anyhow::Error> {
|
||||
let conn = &mut Connection::open("test.db")?;
|
||||
let db = Database::new("test.db")?;
|
||||
|
||||
let start = Instant::now();
|
||||
create_schema(conn)?;
|
||||
db.yomitan().create_schema()?;
|
||||
println!("[{:.2?}]", start.elapsed());
|
||||
|
||||
Ok(())
|
||||
|
||||
Reference in new issue
Block a user