MCPcopy Create free account
hub / github.com/acking-you/static_flow / run

Function run

crates/cli/src/commands/init.rs:15–46  ·  view source on GitHub ↗
(db_path: &Path)

Source from the content-addressed store, hash-verified

13};
14
15pub async fn run(db_path: &Path) -> Result<()> {
16 let db = connect_db(db_path).await?;
17
18 let articles_table = ensure_table(&db, "articles", article_schema()).await?;
19 let images_table = ensure_table(&db, "images", image_schema()).await?;
20 ensure_table(&db, "taxonomies", taxonomy_schema()).await?;
21 let _interactive_store = InteractivePageStore::connect(&db_path.to_string_lossy()).await?;
22
23 if let Err(err) = ensure_fts_index(&articles_table, "content").await {
24 tracing::warn!("Failed to create FTS index on articles: {err}");
25 }
26
27 if let Err(err) = ensure_vector_index(&articles_table, "vector_en").await {
28 tracing::warn!("Failed to create vector index on articles (vector_en): {err}");
29 }
30 if let Err(err) = ensure_vector_index(&articles_table, "vector_zh").await {
31 tracing::warn!("Failed to create vector index on articles (vector_zh): {err}");
32 }
33 if let Err(err) = ensure_vector_index(&images_table, "vector").await {
34 tracing::warn!("Failed to create vector index on images: {err}");
35 }
36
37 let _ = articles_table
38 .query()
39 .full_text_search(FullTextSearchQuery::new("init".to_string()))
40 .limit(1)
41 .execute()
42 .await;
43
44 tracing::info!("LanceDB initialized at {}", db_path.display());
45 Ok(())
46}

Callers

nothing calls this directly

Calls 9

connect_dbFunction · 0.85
article_schemaFunction · 0.85
image_schemaFunction · 0.85
taxonomy_schemaFunction · 0.85
ensure_fts_indexFunction · 0.85
ensure_vector_indexFunction · 0.85
executeMethod · 0.80
queryMethod · 0.80
ensure_tableFunction · 0.50

Tested by

no test coverage detected