mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
Enable garage storage size reading on release builds for postgres
This commit is contained in:
@@ -256,13 +256,6 @@ impl Database {
|
|||||||
let size = match self.orm.as_ref() {
|
let size = match self.orm.as_ref() {
|
||||||
// TODO implement support in other databases
|
// TODO implement support in other databases
|
||||||
sea_orm::DatabaseConnection::SqlxPostgresPoolConnection(_) => {
|
sea_orm::DatabaseConnection::SqlxPostgresPoolConnection(_) => {
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
|
||||||
{
|
|
||||||
/*let query = sea_orm::sea_query::raw_query!(
|
|
||||||
PostgresQueryBuilder,
|
|
||||||
r#"select sum(pg_column_size(g.*)) from garages g where g.user_id = $user_id;"#
|
|
||||||
);*/
|
|
||||||
struct PgColumnSize;
|
struct PgColumnSize;
|
||||||
impl sea_orm::sea_query::Iden for PgColumnSize {
|
impl sea_orm::sea_query::Iden for PgColumnSize {
|
||||||
fn unquoted(&self, s: &mut dyn std::fmt::Write) {
|
fn unquoted(&self, s: &mut dyn std::fmt::Write) {
|
||||||
@@ -280,12 +273,6 @@ impl Database {
|
|||||||
.one(self.orm.as_ref())
|
.one(self.orm.as_ref())
|
||||||
.await?;
|
.await?;
|
||||||
result.map(|x| x.column)
|
result.map(|x| x.column)
|
||||||
}
|
|
||||||
#[cfg(not(debug_assertions))]
|
|
||||||
{
|
|
||||||
let _ = user_id;
|
|
||||||
None
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user