mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
24 lines
601 B
Rust
24 lines
601 B
Rust
use sqlx::sqlite::SqliteConnectOptions;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), std::io::Error> {
|
|
dotenv::dotenv().ok();
|
|
|
|
napi_build::setup();
|
|
let options = SqliteConnectOptions::new()
|
|
.filename("../../affine.db")
|
|
.journal_mode(sqlx::sqlite::SqliteJournalMode::Off)
|
|
.locking_mode(sqlx::sqlite::SqliteLockingMode::Exclusive)
|
|
.create_if_missing(true);
|
|
let pool = sqlx::sqlite::SqlitePoolOptions::new()
|
|
.max_connections(1)
|
|
.connect_with(options)
|
|
.await
|
|
.unwrap();
|
|
sqlx::query(affine_schema::SCHEMA)
|
|
.execute(&pool)
|
|
.await
|
|
.unwrap();
|
|
Ok(())
|
|
}
|