fix: postgres feature
This commit is contained in:
parent
a11a70d3e7
commit
dcd5f359c6
13 changed files with 79 additions and 105 deletions
|
@ -18,9 +18,9 @@ impl DataManager {
|
|||
) -> IpBan {
|
||||
IpBan {
|
||||
ip: get!(x->0(String)),
|
||||
created: get!(x->1(isize)) as usize,
|
||||
created: get!(x->1(i64)) as usize,
|
||||
reason: get!(x->2(String)),
|
||||
moderator: get!(x->3(isize)) as usize,
|
||||
moderator: get!(x->3(i64)) as usize,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ impl DataManager {
|
|||
let res = query_rows!(
|
||||
&conn,
|
||||
"SELECT * FROM ipbans ORDER BY created DESC LIMIT $1 OFFSET $2",
|
||||
&[&(batch as isize), &((page * batch) as isize)],
|
||||
&[&(batch as i64), &((page * batch) as i64)],
|
||||
|x| { Self::get_ipban_from_row(x) }
|
||||
);
|
||||
|
||||
|
@ -105,7 +105,7 @@ impl DataManager {
|
|||
Err(e) => return Err(Error::DatabaseConnection(e.to_string())),
|
||||
};
|
||||
|
||||
let res = execute!(&conn, "DELETE FROM ipbans WHERE ip = $1", &[ip]);
|
||||
let res = execute!(&conn, "DELETE FROM ipbans WHERE ip = $1", &[&ip]);
|
||||
|
||||
if let Err(e) = res {
|
||||
return Err(Error::DatabaseError(e.to_string()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue