@@ -4455,6 +4455,121 @@ pub struct ScanToken {
44554455 #[ prost( enumeration = "KeywordKind" , tag = "5" ) ]
44564456 pub keyword_kind : i32 ,
44574457}
4458+ /// protobuf-c doesn't support optional fields, so any optional strings
4459+ /// are just an empty string if it should be the equivalent of None/nil.
4460+ ///
4461+ /// These fields have `// optional` at the end of the line.
4462+ ///
4463+ /// Upstream issue: <https://github.com/protobuf-c/protobuf-c/issues/476>
4464+ #[ derive( serde:: Serialize ) ]
4465+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
4466+ pub struct SummaryResult {
4467+ #[ prost( message, repeated, tag = "1" ) ]
4468+ pub tables : :: prost:: alloc:: vec:: Vec < summary_result:: Table > ,
4469+ /// The value here is the table name (i.e. schema.table or just table).
4470+ #[ prost( map = "string, string" , tag = "2" ) ]
4471+ pub aliases : :: std:: collections:: HashMap <
4472+ :: prost:: alloc:: string:: String ,
4473+ :: prost:: alloc:: string:: String ,
4474+ > ,
4475+ #[ prost( string, repeated, tag = "3" ) ]
4476+ pub cte_names : :: prost:: alloc:: vec:: Vec < :: prost:: alloc:: string:: String > ,
4477+ #[ prost( message, repeated, tag = "4" ) ]
4478+ pub functions : :: prost:: alloc:: vec:: Vec < summary_result:: Function > ,
4479+ #[ prost( message, repeated, tag = "5" ) ]
4480+ pub filter_columns : :: prost:: alloc:: vec:: Vec < summary_result:: FilterColumn > ,
4481+ #[ prost( string, repeated, tag = "6" ) ]
4482+ pub statement_types : :: prost:: alloc:: vec:: Vec < :: prost:: alloc:: string:: String > ,
4483+ /// optional, empty if truncation limit is -1
4484+ #[ prost( string, tag = "7" ) ]
4485+ pub truncated_query : :: prost:: alloc:: string:: String ,
4486+ }
4487+ /// Nested message and enum types in `SummaryResult`.
4488+ pub mod summary_result {
4489+ #[ derive( serde:: Serialize ) ]
4490+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
4491+ pub struct Table {
4492+ #[ prost( string, tag = "1" ) ]
4493+ pub name : :: prost:: alloc:: string:: String ,
4494+ #[ prost( string, tag = "2" ) ]
4495+ pub schema_name : :: prost:: alloc:: string:: String ,
4496+ #[ prost( string, tag = "3" ) ]
4497+ pub table_name : :: prost:: alloc:: string:: String ,
4498+ #[ prost( enumeration = "Context" , tag = "4" ) ]
4499+ pub context : i32 ,
4500+ }
4501+ #[ derive( serde:: Serialize ) ]
4502+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
4503+ pub struct Function {
4504+ #[ prost( string, tag = "1" ) ]
4505+ pub name : :: prost:: alloc:: string:: String ,
4506+ #[ prost( string, tag = "2" ) ]
4507+ pub function_name : :: prost:: alloc:: string:: String ,
4508+ /// optional
4509+ #[ prost( string, tag = "3" ) ]
4510+ pub schema_name : :: prost:: alloc:: string:: String ,
4511+ #[ prost( enumeration = "Context" , tag = "4" ) ]
4512+ pub context : i32 ,
4513+ }
4514+ #[ derive( serde:: Serialize ) ]
4515+ #[ derive( Clone , PartialEq , :: prost:: Message ) ]
4516+ pub struct FilterColumn {
4517+ /// optional
4518+ #[ prost( string, tag = "1" ) ]
4519+ pub schema_name : :: prost:: alloc:: string:: String ,
4520+ /// optional
4521+ #[ prost( string, tag = "2" ) ]
4522+ pub table_name : :: prost:: alloc:: string:: String ,
4523+ #[ prost( string, tag = "3" ) ]
4524+ pub column : :: prost:: alloc:: string:: String ,
4525+ }
4526+ #[ derive( serde:: Serialize ) ]
4527+ #[ derive(
4528+ Clone ,
4529+ Copy ,
4530+ Debug ,
4531+ PartialEq ,
4532+ Eq ,
4533+ Hash ,
4534+ PartialOrd ,
4535+ Ord ,
4536+ :: prost:: Enumeration
4537+ ) ]
4538+ #[ repr( i32 ) ]
4539+ pub enum Context {
4540+ None = 0 ,
4541+ Select = 1 ,
4542+ Dml = 2 ,
4543+ Ddl = 3 ,
4544+ Call = 4 ,
4545+ }
4546+ impl Context {
4547+ /// String value of the enum field names used in the ProtoBuf definition.
4548+ ///
4549+ /// The values are not transformed in any way and thus are considered stable
4550+ /// (if the ProtoBuf definition does not change) and safe for programmatic use.
4551+ pub fn as_str_name ( & self ) -> & ' static str {
4552+ match self {
4553+ Self :: None => "None" ,
4554+ Self :: Select => "Select" ,
4555+ Self :: Dml => "DML" ,
4556+ Self :: Ddl => "DDL" ,
4557+ Self :: Call => "Call" ,
4558+ }
4559+ }
4560+ /// Creates an enum from field names used in the ProtoBuf definition.
4561+ pub fn from_str_name ( value : & str ) -> :: core:: option:: Option < Self > {
4562+ match value {
4563+ "None" => Some ( Self :: None ) ,
4564+ "Select" => Some ( Self :: Select ) ,
4565+ "DML" => Some ( Self :: Dml ) ,
4566+ "DDL" => Some ( Self :: Ddl ) ,
4567+ "Call" => Some ( Self :: Call ) ,
4568+ _ => None ,
4569+ }
4570+ }
4571+ }
4572+ }
44584573#[ derive( serde:: Serialize ) ]
44594574#[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , PartialOrd , Ord , :: prost:: Enumeration ) ]
44604575#[ repr( i32 ) ]
0 commit comments