| 71 | |
| 72 | impl Function { |
| 73 | pub fn function_details(&self) -> Result<&str> { |
| 74 | let details = match self { |
| 75 | Function::Select => { |
| 76 | r#" |
| 77 | Command: SELECT |
| 78 | Description: retrieve rows from a table or view |
| 79 | Syntax: |
| 80 | SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] |
| 81 | [ * | expression [ [ AS ] output_name ] [, ...] ] |
| 82 | [ FROM from_item [, ...] ] |
| 83 | [ WHERE condition ] |
| 84 | [ GROUP BY [ ALL | DISTINCT ] grouping_element [, ...] ] |
| 85 | [ HAVING condition ] |
| 86 | [ WINDOW window_name AS ( window_definition ) [, ...] ] |
| 87 | [ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] select ] |
| 88 | [ ORDER BY expression [ ASC | DESC | USING operator ] [ NULLS { FIRST | LAST } ] [, ...] ] |
| 89 | [ LIMIT { count | ALL } ] |
| 90 | [ OFFSET start [ ROW | ROWS ] ] |
| 91 | |
| 92 | where from_item can be one of: |
| 93 | |
| 94 | [ ONLY ] table_name [ * ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] |
| 95 | [ TABLESAMPLE sampling_method ( argument [, ...] ) [ REPEATABLE ( seed ) ] ] |
| 96 | [ LATERAL ] ( select ) [ AS ] alias [ ( column_alias [, ...] ) ] |
| 97 | with_query_name [ [ AS ] alias [ ( column_alias [, ...] ) ] ] |
| 98 | [ LATERAL ] function_name ( [ argument [, ...] ] ) |
| 99 | [ WITH ORDINALITY ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] |
| 100 | [ LATERAL ] function_name ( [ argument [, ...] ] ) [ AS ] alias ( column_definition [, ...] ) |
| 101 | [ LATERAL ] function_name ( [ argument [, ...] ] ) AS ( column_definition [, ...] ) |
| 102 | [ LATERAL ] ROWS FROM( function_name ( [ argument [, ...] ] ) [ AS ( column_definition [, ...] ) ] [, ...] ) |
| 103 | [ WITH ORDINALITY ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] |
| 104 | from_item [ NATURAL ] join_type from_item [ ON join_condition | USING ( join_column [, ...] ) [ AS join_using_alias ] ] |
| 105 | |
| 106 | and grouping_element can be one of: |
| 107 | |
| 108 | ( ) |
| 109 | expression |
| 110 | ( expression [, ...] ) |
| 111 | |
| 112 | and with_query is: |
| 113 | |
| 114 | with_query_name [ ( column_name [, ...] ) ] AS [ [ NOT ] MATERIALIZED ] ( select | values | insert | update | delete ) |
| 115 | |
| 116 | TABLE [ ONLY ] table_name [ * ]"# |
| 117 | } |
| 118 | Function::Explain => { |
| 119 | r#" |
| 120 | Command: EXPLAIN |
| 121 | Description: show the execution plan of a statement |
| 122 | Syntax: |
| 123 | EXPLAIN [ ANALYZE ] statement |
| 124 | "# |
| 125 | } |
| 126 | Function::Show => { |
| 127 | r#" |
| 128 | Command: SHOW |
| 129 | Description: show the value of a run-time parameter |
| 130 | Syntax: |