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