@@ -5757,3 +5757,127 @@ impl From<AlterPolicy> for crate::ast::Statement {
57575757 crate :: ast:: Statement :: AlterPolicy ( v)
57585758 }
57595759}
5760+
5761+ /// `CREATE TEXT SEARCH CONFIGURATION` statement.
5762+ ///
5763+ /// Note: this is a PostgreSQL-specific statement.
5764+ /// <https://www.postgresql.org/docs/current/sql-createtsconfig.html>
5765+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5766+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5767+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5768+ pub struct CreateTextSearchConfiguration {
5769+ /// Name of the text search configuration being created.
5770+ pub name : ObjectName ,
5771+ /// Options list — must include `PARSER = parser_name`.
5772+ pub options : Vec < SqlOption > ,
5773+ }
5774+
5775+ impl fmt:: Display for CreateTextSearchConfiguration {
5776+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5777+ write ! (
5778+ f,
5779+ "CREATE TEXT SEARCH CONFIGURATION {name} ({options})" ,
5780+ name = self . name,
5781+ options = display_comma_separated( & self . options) ,
5782+ )
5783+ }
5784+ }
5785+
5786+ impl From < CreateTextSearchConfiguration > for crate :: ast:: Statement {
5787+ fn from ( v : CreateTextSearchConfiguration ) -> Self {
5788+ crate :: ast:: Statement :: CreateTextSearchConfiguration ( v)
5789+ }
5790+ }
5791+
5792+ /// `CREATE TEXT SEARCH DICTIONARY` statement.
5793+ ///
5794+ /// Note: this is a PostgreSQL-specific statement.
5795+ /// <https://www.postgresql.org/docs/current/sql-createtsdictionary.html>
5796+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5797+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5798+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5799+ pub struct CreateTextSearchDictionary {
5800+ /// Name of the text search dictionary being created.
5801+ pub name : ObjectName ,
5802+ /// Options list — must include `TEMPLATE = template_name`.
5803+ pub options : Vec < SqlOption > ,
5804+ }
5805+
5806+ impl fmt:: Display for CreateTextSearchDictionary {
5807+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5808+ write ! (
5809+ f,
5810+ "CREATE TEXT SEARCH DICTIONARY {name} ({options})" ,
5811+ name = self . name,
5812+ options = display_comma_separated( & self . options) ,
5813+ )
5814+ }
5815+ }
5816+
5817+ impl From < CreateTextSearchDictionary > for crate :: ast:: Statement {
5818+ fn from ( v : CreateTextSearchDictionary ) -> Self {
5819+ crate :: ast:: Statement :: CreateTextSearchDictionary ( v)
5820+ }
5821+ }
5822+
5823+ /// `CREATE TEXT SEARCH PARSER` statement.
5824+ ///
5825+ /// Note: this is a PostgreSQL-specific statement.
5826+ /// <https://www.postgresql.org/docs/current/sql-createtsparser.html>
5827+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5828+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5829+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5830+ pub struct CreateTextSearchParser {
5831+ /// Name of the text search parser being created.
5832+ pub name : ObjectName ,
5833+ /// Options list — must include `START`, `GETTOKEN`, `END`, `LEXTYPES` (and optionally `HEADLINE`).
5834+ pub options : Vec < SqlOption > ,
5835+ }
5836+
5837+ impl fmt:: Display for CreateTextSearchParser {
5838+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5839+ write ! (
5840+ f,
5841+ "CREATE TEXT SEARCH PARSER {name} ({options})" ,
5842+ name = self . name,
5843+ options = display_comma_separated( & self . options) ,
5844+ )
5845+ }
5846+ }
5847+
5848+ impl From < CreateTextSearchParser > for crate :: ast:: Statement {
5849+ fn from ( v : CreateTextSearchParser ) -> Self {
5850+ crate :: ast:: Statement :: CreateTextSearchParser ( v)
5851+ }
5852+ }
5853+
5854+ /// `CREATE TEXT SEARCH TEMPLATE` statement.
5855+ ///
5856+ /// Note: this is a PostgreSQL-specific statement.
5857+ /// <https://www.postgresql.org/docs/current/sql-createtstemplate.html>
5858+ #[ derive( Debug , Clone , PartialEq , PartialOrd , Eq , Ord , Hash ) ]
5859+ #[ cfg_attr( feature = "serde" , derive( Serialize , Deserialize ) ) ]
5860+ #[ cfg_attr( feature = "visitor" , derive( Visit , VisitMut ) ) ]
5861+ pub struct CreateTextSearchTemplate {
5862+ /// Name of the text search template being created.
5863+ pub name : ObjectName ,
5864+ /// Options list — must include `LEXIZE` (and optionally `INIT`).
5865+ pub options : Vec < SqlOption > ,
5866+ }
5867+
5868+ impl fmt:: Display for CreateTextSearchTemplate {
5869+ fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
5870+ write ! (
5871+ f,
5872+ "CREATE TEXT SEARCH TEMPLATE {name} ({options})" ,
5873+ name = self . name,
5874+ options = display_comma_separated( & self . options) ,
5875+ )
5876+ }
5877+ }
5878+
5879+ impl From < CreateTextSearchTemplate > for crate :: ast:: Statement {
5880+ fn from ( v : CreateTextSearchTemplate ) -> Self {
5881+ crate :: ast:: Statement :: CreateTextSearchTemplate ( v)
5882+ }
5883+ }
0 commit comments