@@ -1437,6 +1437,7 @@ pub enum Statement {
1437
1437
file_format : Option < FileFormat > ,
1438
1438
source : Box < Query > ,
1439
1439
} ,
1440
+ Call ( Function ) ,
1440
1441
Copy {
1441
1442
/// The source of 'COPY TO', or the target of 'COPY FROM'
1442
1443
source : CopySource ,
@@ -1715,7 +1716,9 @@ pub enum Statement {
1715
1716
///
1716
1717
/// Note: this is a PostgreSQL-specific statement,
1717
1718
/// but may also compatible with other SQL.
1718
- Discard { object_type : DiscardObject } ,
1719
+ Discard {
1720
+ object_type : DiscardObject ,
1721
+ } ,
1719
1722
/// SET `[ SESSION | LOCAL ]` ROLE role_name. Examples: [ANSI][1], [Postgresql][2], [MySQL][3], and [Oracle][4].
1720
1723
///
1721
1724
/// [1]: https://jakewheat.github.io/sql-overview/sql-2016-foundation-grammar.html#set-role-statement
@@ -1747,7 +1750,10 @@ pub enum Statement {
1747
1750
///
1748
1751
/// Note: this is a PostgreSQL-specific statements
1749
1752
/// `SET TIME ZONE <value>` is an alias for `SET timezone TO <value>` in PostgreSQL
1750
- SetTimeZone { local : bool , value : Expr } ,
1753
+ SetTimeZone {
1754
+ local : bool ,
1755
+ value : Expr ,
1756
+ } ,
1751
1757
/// SET NAMES 'charset_name' [COLLATE 'collation_name']
1752
1758
///
1753
1759
/// Note: this is a MySQL-specific statement.
@@ -1762,13 +1768,17 @@ pub enum Statement {
1762
1768
/// SHOW FUNCTIONS
1763
1769
///
1764
1770
/// Note: this is a Presto-specific statement.
1765
- ShowFunctions { filter : Option < ShowStatementFilter > } ,
1771
+ ShowFunctions {
1772
+ filter : Option < ShowStatementFilter > ,
1773
+ } ,
1766
1774
/// ```sql
1767
1775
/// SHOW <variable>
1768
1776
/// ```
1769
1777
///
1770
1778
/// Note: this is a PostgreSQL-specific statement.
1771
- ShowVariable { variable : Vec < Ident > } ,
1779
+ ShowVariable {
1780
+ variable : Vec < Ident > ,
1781
+ } ,
1772
1782
/// SHOW VARIABLES
1773
1783
///
1774
1784
/// Note: this is a MySQL-specific statement.
@@ -1806,11 +1816,15 @@ pub enum Statement {
1806
1816
/// SHOW COLLATION
1807
1817
///
1808
1818
/// Note: this is a MySQL-specific statement.
1809
- ShowCollation { filter : Option < ShowStatementFilter > } ,
1819
+ ShowCollation {
1820
+ filter : Option < ShowStatementFilter > ,
1821
+ } ,
1810
1822
/// USE
1811
1823
///
1812
1824
/// Note: This is a MySQL-specific statement.
1813
- Use { db_name : Ident } ,
1825
+ Use {
1826
+ db_name : Ident ,
1827
+ } ,
1814
1828
/// `START [ TRANSACTION | WORK ] | START TRANSACTION } ...`
1815
1829
/// If `begin` is false.
1816
1830
///
@@ -1838,7 +1852,9 @@ pub enum Statement {
1838
1852
if_exists : bool ,
1839
1853
} ,
1840
1854
/// `COMMIT [ TRANSACTION | WORK ] [ AND [ NO ] CHAIN ]`
1841
- Commit { chain : bool } ,
1855
+ Commit {
1856
+ chain : bool ,
1857
+ } ,
1842
1858
/// `ROLLBACK [ TRANSACTION | WORK ] [ AND [ NO ] CHAIN ] [ TO [ SAVEPOINT ] savepoint_name ]`
1843
1859
Rollback {
1844
1860
chain : bool ,
@@ -1934,11 +1950,17 @@ pub enum Statement {
1934
1950
/// `DEALLOCATE [ PREPARE ] { name | ALL }`
1935
1951
///
1936
1952
/// Note: this is a PostgreSQL-specific statement.
1937
- Deallocate { name : Ident , prepare : bool } ,
1953
+ Deallocate {
1954
+ name : Ident ,
1955
+ prepare : bool ,
1956
+ } ,
1938
1957
/// `EXECUTE name [ ( parameter [, ...] ) ]`
1939
1958
///
1940
1959
/// Note: this is a PostgreSQL-specific statement.
1941
- Execute { name : Ident , parameters : Vec < Expr > } ,
1960
+ Execute {
1961
+ name : Ident ,
1962
+ parameters : Vec < Expr > ,
1963
+ } ,
1942
1964
/// `PREPARE name [ ( data_type [, ...] ) ] AS statement`
1943
1965
///
1944
1966
/// Note: this is a PostgreSQL-specific statement.
@@ -1979,9 +2001,13 @@ pub enum Statement {
1979
2001
format : Option < AnalyzeFormat > ,
1980
2002
} ,
1981
2003
/// SAVEPOINT -- define a new savepoint within the current transaction
1982
- Savepoint { name : Ident } ,
2004
+ Savepoint {
2005
+ name : Ident ,
2006
+ } ,
1983
2007
/// RELEASE \[ SAVEPOINT \] savepoint_name
1984
- ReleaseSavepoint { name : Ident } ,
2008
+ ReleaseSavepoint {
2009
+ name : Ident ,
2010
+ } ,
1985
2011
// MERGE INTO statement, based on Snowflake. See <https://docs.snowflake.com/en/sql-reference/sql/merge.html>
1986
2012
Merge {
1987
2013
// optional INTO keyword
@@ -2303,6 +2329,8 @@ impl fmt::Display for Statement {
2303
2329
Ok ( ( ) )
2304
2330
}
2305
2331
2332
+ Statement :: Call ( function) => write ! ( f, "CALL {function}" ) ,
2333
+
2306
2334
Statement :: Copy {
2307
2335
source,
2308
2336
to,
0 commit comments