missed a git add
This commit is contained in:
parent
80dfe8b7f2
commit
8ccb2e6c46
19
web3_proxy/src/bin/web3_proxy_cli/count_users.rs
Normal file
19
web3_proxy/src/bin/web3_proxy_cli/count_users.rs
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
use argh::FromArgs;
|
||||||
|
use entities::user;
|
||||||
|
use log::info;
|
||||||
|
use migration::sea_orm::{self, EntityTrait, PaginatorTrait};
|
||||||
|
|
||||||
|
#[derive(FromArgs, PartialEq, Debug, Eq)]
|
||||||
|
/// Create a new user and api key
|
||||||
|
#[argh(subcommand, name = "count_users")]
|
||||||
|
pub struct CountUsersSubCommand {}
|
||||||
|
|
||||||
|
impl CountUsersSubCommand {
|
||||||
|
pub async fn main(self, db: &sea_orm::DatabaseConnection) -> anyhow::Result<()> {
|
||||||
|
let count = user::Entity::find().count(db).await?;
|
||||||
|
|
||||||
|
info!("user count: {}", count);
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user