Skip to content
Snippets Groups Projects
Commit 998824e8 authored by Dmitry Ivanov's avatar Dmitry Ivanov
Browse files

fix(pgproto): workaround for broken ORDER BY in tab completion query

parent b002c3b0
No related branches found
No related tags found
1 merge request!1315Improve pgproto's tab completion tests
......@@ -16,12 +16,14 @@ impl WellKnownQuery {
WellKnownQuery::ListOfTables(..) => {
// TODO: filter _pico names like PostgreSQL filters pg_ names
r#"
select
"name" as "relname",
NULL::text as "text"
from "_pico_table"
where substr("name", 1, $1::int) = $2::text
order by "relname"
select * from (
select
name as relname,
NULL::text as "text"
from _pico_table
where name like $1::text || '%'
) q
order by q.relname
"#
.into()
}
......@@ -31,10 +33,7 @@ impl WellKnownQuery {
pub fn parameters(&self) -> Vec<SbroadValue> {
match self {
WellKnownQuery::ListOfTables(pattern) => {
vec![
SbroadValue::from(pattern.len() as u64),
SbroadValue::from(pattern.to_string()),
]
vec![SbroadValue::from(pattern.to_string())]
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment