File schema_system_catalog_install.hpp¶
File List > cubrid > src > object > schema_system_catalog_install.hpp
Go to the documentation of this file
/*
*
* Copyright 2016 CUBRID Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
/*
* schema_system_catalog_install.hpp
*/
#ifndef _SCHEMA_SYSTEM_CATALOG_INSTALL_HPP_
#define _SCHEMA_SYSTEM_CATALOG_INSTALL_HPP_
#include <string>
namespace cubschema
{
// forward definitions
struct system_catalog_definition;
class system_catalog_initializer
{
public:
// classes
static system_catalog_definition get_class ();
static system_catalog_definition get_attribute ();
static system_catalog_definition get_domain ();
static system_catalog_definition get_method ();
static system_catalog_definition get_meth_sig ();
static system_catalog_definition get_meth_arg ();
static system_catalog_definition get_meth_file ();
static system_catalog_definition get_query_spec ();
static system_catalog_definition get_index ();
static system_catalog_definition get_index_key ();
static system_catalog_definition get_auth ();
static system_catalog_definition get_trigger ();
static system_catalog_definition get_partition ();
static system_catalog_definition get_data_type ();
static system_catalog_definition get_stored_procedure ();
static system_catalog_definition get_stored_procedure_code ();
static system_catalog_definition get_stored_procedure_args ();
static system_catalog_definition get_serial ();
static system_catalog_definition get_ha_apply_info ();
static system_catalog_definition get_collation ();
static system_catalog_definition get_charset ();
static system_catalog_definition get_dual ();
static system_catalog_definition get_server ();
static system_catalog_definition get_synonym ();
static system_catalog_definition get_histogram ();
static system_catalog_definition get_global_tran ();
// views
static system_catalog_definition get_view_class ();
static system_catalog_definition get_view_direct_super_class ();
static system_catalog_definition get_view_vclass ();
static system_catalog_definition get_view_attribute ();
static system_catalog_definition get_view_attr_setdomain_elm ();
static system_catalog_definition get_view_method ();
static system_catalog_definition get_view_meth_arg ();
static system_catalog_definition get_view_meth_arg_setdomain_elm ();
static system_catalog_definition get_view_meth_file ();
static system_catalog_definition get_view_index ();
static system_catalog_definition get_view_index_key ();
static system_catalog_definition get_view_auth ();
static system_catalog_definition get_view_trigger ();
static system_catalog_definition get_view_partition ();
static system_catalog_definition get_view_stored_procedure ();
static system_catalog_definition get_view_stored_procedure_args ();
static system_catalog_definition get_view_serial ();
static system_catalog_definition get_view_ha_apply_info ();
static system_catalog_definition get_view_collation ();
static system_catalog_definition get_view_user ();
static system_catalog_definition get_view_authorization ();
static system_catalog_definition get_view_charset ();
static system_catalog_definition get_view_synonym ();
static system_catalog_definition get_view_server ();
static system_catalog_definition get_view_db_histogram ();
};
// TODO: find right place
// TODO: implement formatting utility function for std::string (like fmt library)
const inline std::string format_varchar (const int size)
{
std::string s ("varchar(");
s += std::to_string (size);
s += ")";
return s;
}
const inline std::string format_varbit (const int size)
{
std::string s ("bit varying(");
s += std::to_string (size);
s += ")";
return s;
}
const inline std::string format_numeric (const int prec, const int scale)
{
std::string s ("numeric(");
s += std::to_string (prec);
s += ",";
s += std::to_string (scale);
s += ")";
return s;
}
const inline std::string format_sequence (const std::string_view type)
{
std::string s ("sequence of");
if (!type.empty ())
{
s.append (" ");
s.append (type);
}
return s;
}
const inline std::string format_set (const std::string_view type)
{
std::string s ("set of");
if (!type.empty ())
{
s.append (" ");
s.append (type);
}
return s;
}
} // namespace cubschema
// TODO: move them to proper place
const char *sm_define_view_class_spec (void);
const char *sm_define_view_direct_super_class_spec (void);
const char *sm_define_view_vclass_spec (void);
const char *sm_define_view_attribute_spec (void);
const char *sm_define_view_attr_setdomain_elm_spec (void);
const char *sm_define_view_method_spec (void);
const char *sm_define_view_method_arg_spec (void);
const char *sm_define_view_meth_arg_setdomain_elm_spec (void);
const char *sm_define_view_meth_file_spec (void);
const char *sm_define_view_index_spec (void);
const char *sm_define_view_index_key_spec (void);
const char *sm_define_view_auth_spec (void);
const char *sm_define_view_trigger_spec (void);
const char *sm_define_view_partition_spec (void);
const char *sm_define_view_stored_procedure_spec (void);
const char *sm_define_view_stored_procedure_args_spec (void);
const char *sm_define_view_serial_spec (void);
const char *sm_define_view_ha_apply_info_spec (void);
const char *sm_define_view_collation_spec (void);
const char *sm_define_view_user_spec (void);
const char *sm_define_view_authorization_spec (void);
const char *sm_define_view_charset_spec (void);
const char *sm_define_view_synonym_spec (void);
const char *sm_define_view_server_spec (void);
const char *sm_define_view_histogram_spec (void);
#endif /* _SCHEMA_SYSTEM_CATALOG_INSTALL_HPP_ */