Rename query_row_col to query_get_value

Since function `query_row_col` no longer accept column number argument,
it is misleading to mention column in its name.
This commit is contained in:
Dmitry Bogatov
2019-09-12 18:42:12 +00:00
parent bef25ad5f6
commit bb4081e503
13 changed files with 32 additions and 32 deletions

View File

@@ -139,7 +139,7 @@ impl Chat {
if self.typ == Chattype::Single {
return context
.sql
.query_row_col(
.query_get_value(
context,
"SELECT c.addr FROM chats_contacts cc \
LEFT JOIN contacts c ON c.id=cc.contact_id \
@@ -277,7 +277,7 @@ impl Chat {
};
if self.typ == Chattype::Single {
if let Some(id) = context.sql.query_row_col(
if let Some(id) = context.sql.query_get_value(
context,
"SELECT contact_id FROM chats_contacts WHERE chat_id=?;",
params![self.id as i32],
@@ -721,7 +721,7 @@ fn prepare_msg_common(context: &Context, chat_id: u32, msg: &mut Message) -> Res
}
fn last_msg_in_chat_encrypted(context: &Context, sql: &Sql, chat_id: u32) -> bool {
let packed: Option<String> = sql.query_row_col(
let packed: Option<String> = sql.query_get_value(
context,
"SELECT param \
FROM msgs WHERE timestamp=(SELECT MAX(timestamp) FROM msgs WHERE chat_id=?) \
@@ -908,7 +908,7 @@ unsafe fn set_draft_raw(context: &Context, chat_id: u32, mut msg: Option<&mut Me
fn get_draft_msg_id(context: &Context, chat_id: u32) -> u32 {
context
.sql
.query_row_col::<_, i32>(
.query_get_value::<_, i32>(
context,
"SELECT id FROM msgs WHERE chat_id=? AND state=?;",
params![chat_id as i32, MessageState::OutDraft],
@@ -1002,7 +1002,7 @@ pub fn get_chat_msgs(context: &Context, chat_id: u32, flags: u32, marker1before:
pub fn get_msg_cnt(context: &Context, chat_id: u32) -> usize {
context
.sql
.query_row_col::<_, i32>(
.query_get_value::<_, i32>(
context,
"SELECT COUNT(*) FROM msgs WHERE chat_id=?;",
params![chat_id as i32],
@@ -1013,7 +1013,7 @@ pub fn get_msg_cnt(context: &Context, chat_id: u32) -> usize {
pub fn get_fresh_msg_cnt(context: &Context, chat_id: u32) -> usize {
context
.sql
.query_row_col::<_, i32>(
.query_get_value::<_, i32>(
context,
"SELECT COUNT(*) FROM msgs \
WHERE state=10 \
@@ -1784,7 +1784,7 @@ pub unsafe fn forward_msgs(
pub fn get_chat_contact_cnt(context: &Context, chat_id: u32) -> libc::c_int {
context
.sql
.query_row_col(
.query_get_value(
context,
"SELECT COUNT(*) FROM chats_contacts WHERE chat_id=?;",
params![chat_id as i32],
@@ -1797,7 +1797,7 @@ pub fn get_chat_cnt(context: &Context) -> usize {
/* no database, no chats - this is no error (needed eg. for information) */
context
.sql
.query_row_col::<_, isize>(
.query_get_value::<_, isize>(
context,
"SELECT COUNT(*) FROM chats WHERE id>9 AND blocked=0;",
params![],