-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9b94559
commit 26978e6
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
**/*.rs.bk | ||
/config/private_patterns | ||
/config/private_vk_tokens | ||
/database | ||
/notes | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,29 @@ | ||
use rusqlite::*; | ||
use std::*; | ||
|
||
/* SMS entry point. */ | ||
fn main() { | ||
println!("SMS started."); | ||
|
||
match sms_db_init() { | ||
Ok(_) => println!("Database initialization succeeded."), | ||
Err(_) => panic!("Database initialization failed."), | ||
} | ||
|
||
println!("SMS stopped."); | ||
} | ||
|
||
/* Database initialization. */ | ||
fn sms_db_init() -> Result<()> { | ||
let _ = fs::create_dir("database"); | ||
let sms_db_conn = Connection::open("database/sms_db_sqlite")?; | ||
|
||
let _ = sms_db_conn.execute( | ||
"CREATE TABLE if not exists vor_obl_settlements ( | ||
id integer primary key, | ||
settlement_id integer, | ||
settlement_title text | ||
)", NO_PARAMS); | ||
|
||
Ok(()) | ||
} |