generated from lucien/actix-react-template
Added database init function
This commit is contained in:
parent
6461ebc629
commit
902e96b205
4 changed files with 13 additions and 8 deletions
|
@ -1,15 +0,0 @@
|
|||
use sqlite::{Connection, State};
|
||||
|
||||
fn main() -> sqlite::Result<()> {
|
||||
let conn = Connection::open("./data/data.db")?;
|
||||
|
||||
conn.execute(
|
||||
"CREATE TABLE articles (
|
||||
id INTEGER PRIMARY KEY,
|
||||
title TEXT NOT NULL,
|
||||
subTitle TEXT,
|
||||
content TEXT NOT NULL,
|
||||
)",
|
||||
[],
|
||||
)?;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue