MySQL 8.0.30
Source Code Documentation
dd::system_views::System_view_select_definition_impl Class Reference

#include <system_view_definition_impl.h>

Inheritance diagram for dd::system_views::System_view_select_definition_impl:
[legend]

Public Member Functions

virtual void add_field (int field_number, const String_type &field_name, const String_type &field_definition, bool add_quotes=false)
 Add a field definition for the SELECT projection. More...
 
virtual void add_from (const String_type &from)
 Add FROM clause for the SELECT. More...
 
virtual void add_where (const String_type &where)
 Add WHERE clause for the SELECT. More...
 
virtual void add_cte_expression (const String_type &cte)
 Add CTE expression before SELECT. More...
 
virtual void add_distinct ()
 Indicates that we should add DISTINCT clause to SELECT. More...
 
virtual void add_star ()
 Indicates selection of all field (SELECT '*'). More...
 
virtual int field_number (const String_type &field_name) const
 Get the field ordinal position number for the given field name. More...
 
String_type build_select_query () const
 Build the SELECT query that is used in the CREATE VIEW command. More...
 
String_type build_ddl_create_view () const override
 Build CREATE VIEW DDL statement for the system view. More...
 
- Public Member Functions inherited from dd::system_views::System_view_definition_impl
virtual const String_typeview_name () const
 Get view name. More...
 
virtual void set_view_name (const String_type &name)
 Set view name. More...
 
- Public Member Functions inherited from dd::system_views::System_view_definition
virtual ~System_view_definition ()=default
 

Private Types

typedef std::map< String_type, int > Field_numbers
 
typedef std::map< int, String_typeField_definitions
 
typedef std::vector< String_typeFrom_clauses
 
typedef std::vector< String_typeWhere_clauses
 

Private Attributes

Field_numbers m_field_numbers
 
Field_definitions m_field_definitions
 
From_clauses m_from_clauses
 
Where_clauses m_where_clauses
 
dd::String_type m_cte_expression
 
bool m_is_distinct {false}
 
bool m_add_star {false}
 

Additional Inherited Members

- Static Public Member Functions inherited from dd::system_views::System_view_definition_impl
static const String_type fs_name_collation ()
 Get collation clause to append to view definition for some view columns based on lower_case_table_names. More...
 

Member Typedef Documentation

◆ Field_definitions

◆ Field_numbers

◆ From_clauses

◆ Where_clauses

Member Function Documentation

◆ add_cte_expression()

virtual void dd::system_views::System_view_select_definition_impl::add_cte_expression ( const String_type cte)
inlinevirtual

Add CTE expression before SELECT.

Parameters
cteString representing the CTE expression.

◆ add_distinct()

virtual void dd::system_views::System_view_select_definition_impl::add_distinct ( )
inlinevirtual

Indicates that we should add DISTINCT clause to SELECT.

◆ add_field()

virtual void dd::system_views::System_view_select_definition_impl::add_field ( int  field_number,
const String_type field_name,
const String_type field_definition,
bool  add_quotes = false 
)
inlinevirtual

Add a field definition for the SELECT projection.

This function can be called more than once. The call will add a new projection to the SELECT command.

Parameters
field_numberOrdinal position of field in the projection list.
field_nameField name used for the SELECT's projection.
field_definitionExpression representing the projection.
add_quotesIf true, output single quotes around the field_definition.

◆ add_from()

virtual void dd::system_views::System_view_select_definition_impl::add_from ( const String_type from)
inlinevirtual

Add FROM clause for the SELECT.

This function can be called more than once. The clause will be appended to the previous FROM clause string.

Parameters
fromString representing the FROM clause.

◆ add_star()

virtual void dd::system_views::System_view_select_definition_impl::add_star ( )
inlinevirtual

Indicates selection of all field (SELECT '*').

◆ add_where()

virtual void dd::system_views::System_view_select_definition_impl::add_where ( const String_type where)
inlinevirtual

Add WHERE clause for the SELECT.

This function can be called more than once. The clause will be appended to the previous WHERE clause string.

Parameters
whereString representing the WHERE clause.

◆ build_ddl_create_view()

String_type dd::system_views::System_view_select_definition_impl::build_ddl_create_view ( ) const
inlineoverridevirtual

Build CREATE VIEW DDL statement for the system view.

Returns
String_type containing the DDL statement for the target view.

Implements dd::system_views::System_view_definition_impl.

◆ build_select_query()

String_type dd::system_views::System_view_select_definition_impl::build_select_query ( ) const
inline

Build the SELECT query that is used in the CREATE VIEW command.

Returns
The SELECT query string.

◆ field_number()

virtual int dd::system_views::System_view_select_definition_impl::field_number ( const String_type field_name) const
inlinevirtual

Get the field ordinal position number for the given field name.

Parameters
field_nameColumn name for which the field number is returned.
Returns
Integer representing position of column in projection list.

Member Data Documentation

◆ m_add_star

bool dd::system_views::System_view_select_definition_impl::m_add_star {false}
private

◆ m_cte_expression

dd::String_type dd::system_views::System_view_select_definition_impl::m_cte_expression
private

◆ m_field_definitions

Field_definitions dd::system_views::System_view_select_definition_impl::m_field_definitions
private

◆ m_field_numbers

Field_numbers dd::system_views::System_view_select_definition_impl::m_field_numbers
private

◆ m_from_clauses

From_clauses dd::system_views::System_view_select_definition_impl::m_from_clauses
private

◆ m_is_distinct

bool dd::system_views::System_view_select_definition_impl::m_is_distinct {false}
private

◆ m_where_clauses

Where_clauses dd::system_views::System_view_select_definition_impl::m_where_clauses
private

The documentation for this class was generated from the following file: