From dc55ea320101282f200c0117ebdf7033f3bae927 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 18 Jan 2023 15:48:33 +0300 Subject: feat(corp/data-import): parse and import link types Change-Id: Iae01d1dc6894117dc693b4690d8bc79861212ae6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7863 Tested-by: BuildkiteCI Reviewed-by: tazjin --- corp/russian/data-import/src/db_setup.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'corp/russian/data-import/src/db_setup.rs') diff --git a/corp/russian/data-import/src/db_setup.rs b/corp/russian/data-import/src/db_setup.rs index 1a9e2dd87913..d85374dfa8dd 100644 --- a/corp/russian/data-import/src/db_setup.rs +++ b/corp/russian/data-import/src/db_setup.rs @@ -50,6 +50,12 @@ CREATE TABLE word_grammemes ( FOREIGN KEY(word) REFERENCES words(ROWID) ) STRICT; +-- table for link types +CREATE TABLE link_types ( + id INTEGER PRIMARY KEY, + name TEXT +) STRICT; + "#, ) .ensure("setting up initial table schema failed"); @@ -76,6 +82,16 @@ pub fn insert_oc_element(conn: &Connection, elem: OcElement) { } OcElement::Lemma(lemma) => insert_lemma(conn, lemma), + + OcElement::LinkType(lt) => { + conn.execute( + "INSERT INTO link_types (id, name) VALUES (?1, ?2)", + (<.id, <.name), + ) + .ensure("failed to insert link type"); + + info!("inserted link type {}", lt.name); + } } } -- cgit 1.4.1