mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
use refs
This commit is contained in:
parent
f463c71d4f
commit
aad0e266f6
6 changed files with 30 additions and 30 deletions
|
|
@ -24,12 +24,12 @@ impl Database {
|
|||
Ok(Self { connection })
|
||||
}
|
||||
|
||||
pub fn add(&self, app_id: i64) -> Result<usize, Error> {
|
||||
pub fn add(&self, app_id: &i64) -> Result<usize, Error> {
|
||||
self.connection
|
||||
.execute("INSERT INTO `app_browser` (`app_id`) VALUES (?)", [app_id])
|
||||
}
|
||||
|
||||
pub fn records(&self, app_id: i64) -> Result<Vec<Table>, Error> {
|
||||
pub fn records(&self, app_id: &i64) -> Result<Vec<Table>, Error> {
|
||||
let mut statement = self
|
||||
.connection
|
||||
.prepare("SELECT `id`, `app_id` WHERE `app_id` = ?")?;
|
||||
|
|
@ -51,7 +51,7 @@ impl Database {
|
|||
Ok(records)
|
||||
}
|
||||
|
||||
pub fn delete(&self, id: i64) -> Result<usize, Error> {
|
||||
pub fn delete(&self, id: &i64) -> Result<usize, Error> {
|
||||
self.connection
|
||||
.execute("DELETE FROM `app_browser` WHERE `id` = ?", [id])
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue