mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
move profile filesystem dependencies init on the main level
This commit is contained in:
parent
b60ac5fb3f
commit
e8680cb052
3 changed files with 35 additions and 30 deletions
|
|
@ -1,3 +1,4 @@
|
|||
use sqlite::Connection;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct Database {
|
||||
|
|
@ -6,18 +7,18 @@ pub struct Database {
|
|||
|
||||
impl Database {
|
||||
// Construct new application DB
|
||||
pub fn init(connection: Arc<sqlite::Connection>) -> Database {
|
||||
pub fn init(connection: Arc<Connection>) -> Database {
|
||||
// Init app table
|
||||
if let Err(e) = connection.execute(
|
||||
if let Err(error) = connection.execute(
|
||||
r"
|
||||
CREATE TABLE IF NOT EXISTS `app`
|
||||
(
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
|
||||
`time` INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`time` INTEGER NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)
|
||||
",
|
||||
) {
|
||||
panic!("{e}");
|
||||
panic!("{error}");
|
||||
}
|
||||
|
||||
// Return struct
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue