mirror of
https://github.com/supleed2/nanobot.git
synced 2024-11-09 20:25:48 +00:00
Make whois
commands case-insensitive
This commit is contained in:
parent
69e7a5a4f4
commit
89a9d2b085
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "select * from members where realname=$1",
|
||||
"query": "select * from members where lower(nickname)=lower($1)",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
@ -42,5 +42,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "56f54bfdc63d7c09add2bb4dec1e6a4544a684611755bcf2fa9424702ecd11cf"
|
||||
"hash": "00f839a86be2867afbb09fbbd0b940914bc63425c15ea3d156b437944d0e2247"
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"db_name": "PostgreSQL",
|
||||
"query": "select * from members where nickname=$1",
|
||||
"query": "select * from members where lower(realname)=lower($1)",
|
||||
"describe": {
|
||||
"columns": [
|
||||
{
|
||||
|
@ -42,5 +42,5 @@
|
|||
false
|
||||
]
|
||||
},
|
||||
"hash": "87fdce1d94c71a23196d11d87fbc748cb4c9ef59333f546da68b52322bd104c2"
|
||||
"hash": "de27ac619959b8f39424b8c4c46044377c40bc92785dddf927dba6d26bea522b"
|
||||
}
|
|
@ -55,11 +55,13 @@ pub(crate) async fn get_member_by_nickname(
|
|||
pool: &sqlx::PgPool,
|
||||
nickname: &str,
|
||||
) -> Result<Option<Member>, Error> {
|
||||
Ok(
|
||||
sqlx::query_as!(Member, "select * from members where nickname=$1", nickname)
|
||||
.fetch_optional(pool)
|
||||
.await?,
|
||||
Ok(sqlx::query_as!(
|
||||
Member,
|
||||
"select * from members where lower(nickname)=lower($1)",
|
||||
nickname
|
||||
)
|
||||
.fetch_optional(pool)
|
||||
.await?)
|
||||
}
|
||||
|
||||
/// Get member entry by Real Name
|
||||
|
@ -67,11 +69,13 @@ pub(crate) async fn get_member_by_realname(
|
|||
pool: &sqlx::PgPool,
|
||||
realname: &str,
|
||||
) -> Result<Option<Member>, Error> {
|
||||
Ok(
|
||||
sqlx::query_as!(Member, "select * from members where realname=$1", realname)
|
||||
.fetch_optional(pool)
|
||||
.await?,
|
||||
Ok(sqlx::query_as!(
|
||||
Member,
|
||||
"select * from members where lower(realname)=lower($1)",
|
||||
realname
|
||||
)
|
||||
.fetch_optional(pool)
|
||||
.await?)
|
||||
}
|
||||
|
||||
/// Add member entry to members table
|
||||
|
|
Loading…
Reference in a new issue