Skip to content

Commit

Permalink
[CBRD-24622] Create 10 SCHEMA Files for each object type. (#4088)
Browse files Browse the repository at this point in the history
http://jira.cubrid.org/browse/CBRD-24623

To move data by object without editing schema file, when creating schema file, it is necessary to create by object as follows.
Creates 10 schema files using options, and stores the file list in xxx_schema_info.
  • Loading branch information
airnet73 authored Feb 21, 2023
1 parent d38434c commit 14d7e06
Show file tree
Hide file tree
Showing 20 changed files with 1,369 additions and 265 deletions.
3 changes: 2 additions & 1 deletion msg/de_DE.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ gültige Optionen:\n\
--use-delimiter '"' verwenden, wo ein Identifikator anfängt und endet; Standard: nicht verwenden\n\
-S, --SA-mode Stand-Alone-Ausführung\n\
-C, --CS-mode Client-Server-Ausführung\n\
--datafile-per-class eine Objektdatei für jede Klasse erzeugen; Standard: inaktiv\n
--datafile-per-class eine Objektdatei für jede Klasse erzeugen; Standard: inaktiv\n\
--split-schema-files Schemainformationen nach Objekt aufteilen und jede Datei generieren; Standard: Eine Schemadatei mit allen Objekten generieren\n



Expand Down
4 changes: 2 additions & 2 deletions msg/en_US.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,8 @@ valid options:\n\
--use-delimiter use '"' where an identifier begins and ends; default: don't use\n\
-S, --SA-mode stand-alone mode execution\n\
-C, --CS-mode client-server mode execution\n\
--datafile-per-class create a object file for each class; default: disabled\n

--datafile-per-class create a object file for each class; default: disabled\n\
--split-schema-files Split schema information by object and generate each file; Default: generate one schema file with all objects\n


$set 14 MSGCAT_UTIL_SET_COMPACTDB
Expand Down
4 changes: 2 additions & 2 deletions msg/en_US/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,8 @@ valid options:\n\
--use-delimiter use '"' where an identifier begins and ends; default: don't use\n\
-S, --SA-mode stand-alone mode execution\n\
-C, --CS-mode client-server mode execution\n\
--datafile-per-class create a object file for each class; default: disabled\n

--datafile-per-class create a object file for each class; default: disabled\n\
--split-schema-files split schema information by object and generate each file; Default: generate one schema file with all objects\n


$set 14 MSGCAT_UTIL_SET_COMPACTDB
Expand Down
3 changes: 2 additions & 1 deletion msg/es_ES.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ opciones validas:\n\
--use-delimiter utilizar '"' donde un identificador empieza y acaba; estandar: no utilizar\n\
-S, --SA-mode modo de ejecucion independiente\n\
-C, --CS-mode modo de ejecucion cliente-servidor\n\
--datafile-per-class crear un archivo de objeto para cada clase; estandar: inhabilitado\n
--datafile-per-class crear un archivo de objeto para cada clase; estandar: inhabilitado\n\
--split-schema-files dividir la información del esquema por objeto y generar cada archivo; Predeterminado: generar un archivo de esquema con todos los objetos\n



Expand Down
3 changes: 2 additions & 1 deletion msg/fr_FR.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,8 @@ options valids:\n\
--use-delimiter utilise '"' dans les endroits où un identificateur commence ou se termine; par défaut: ne pas utiliser\n\
-S, --SA-mode exécution en mode autonome\n\
-C, --CS-mode exécution en mode client-serveur\n\
--datafile-per-class créer un fichier objet pour chaque classe; par défaut: désactivé
--datafile-per-class créer un fichier objet pour chaque classe; par défaut: désactivé\n\
--split-schema-files diviser les informations de schéma par objet et générer chaque fichier ; Par défaut : générer un fichier de schéma avec tous les objets\n



Expand Down
3 changes: 2 additions & 1 deletion msg/it_IT.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ opzioni valide:\n\
--use-delimiter usa '"' dove un identificatore inizia e termina; predefinito: don't use\n\
-S, --SA-mode modalità di esecuzione stand-alone\n\
-C, --CS-mode modalità di esecuzione client-server\n\
--datafile-per-class creare un file oggetto per ogni classe; predefinito: non attivo\n
--datafile-per-class creare un file oggetto per ogni classe; predefinito: non attivo\n\
--split-schema-files dividere le informazioni sullo schema per oggetto e generare ciascun file; Predefinito: genera un file schema con tutti gli oggetti\n



Expand Down
3 changes: 2 additions & 1 deletion msg/ja_JP.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ unloaddb: データベースからスキーマとオブジェクトをアンロ
--use-delimiter 識別者の最初と最後に「"」をつける; デフォルト: つけない\n\
-S, --SA-mode 独立モードで実行\n\
-C, --CS-mode クライアントーサーバモードで実行\n\
--datafile-per-class 格クラス別にオブジェクトファイル生成; デフォルト: ひとつのオブジェクトファイルを生成\n
--datafile-per-class 格クラス別にオブジェクトファイル生成; デフォルト: ひとつのオブジェクトファイルを生成\n\
--split-schema-files オブジェクトごとにスキーマ情報を分割し、各ファイルを生成します。 デフォルト: すべてのオブジェクトを含む 1 つのスキーマ ファイルを生成する\n



Expand Down
3 changes: 2 additions & 1 deletion msg/km_KH.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ valid options:\n\
--use-delimiter use '"' where an identifier begins and ends; default: don't use\n\
-S, --SA-mode stand-alone mode execution\n\
-C, --CS-mode client-server mode execution\n\
--datafile-per-class create a object file for each class; default: disabled\n
--datafile-per-class create a object file for each class; default: disabled\n\
--split-schema-files Split schema information by object and generate each file; Default: generate one schema file with all objects\n



Expand Down
3 changes: 2 additions & 1 deletion msg/ko_KR.euckr/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ unloaddb:
--use-delimiter �ĺ��� ó���� ���� '"' ���; �⺻��: ��� �� ��\n\
-S, --SA-mode ���� ��� ����\n\
-C, --CS-mode Ŭ���̾�Ʈ ���� ��� ����\n\
--datafile-per-class �� Ŭ������ ������Ʈ ���� ����; �⺻��:�� ���� ������Ʈ ���ϻ���\n
--datafile-per-class �� Ŭ������ ������Ʈ ���� ����; �⺻��:�� ���� ������Ʈ ���ϻ���\n\
--split-schema-files ��Ű�� ������ ������Ʈ���� �и��Ͽ� ������ ���Ϸ� ����; �⺻��: ��� ������Ʈ�� ���Ե� �� ���� ��Ű�� ���� ����\n



Expand Down
4 changes: 2 additions & 2 deletions msg/ko_KR.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,8 @@ unloaddb: 데이터베이스에서 스키마와 객체를 언로드\n\
--use-delimiter 식별자 처음과 끝에 '"' 사용; 기본값: 사용 안 함\n\
-S, --SA-mode 독립 모드 실행\n\
-C, --CS-mode 클라이언트 서버 모드 실행\n\
--datafile-per-class 각 클래스별 오브젝트 파일 생성; 기본값:한 개의 오브젝트 파일생성\n

--datafile-per-class 각 클래스별 오브젝트 파일 생성; 기본값:한 개의 오브젝트 파일생성\n\
--split-schema-files 스키마 정보를 오브젝트별로 분리하여 각각의 파일로 생성; 기본값: 모든 오브젝트가 포함된 한 개의 스키마 파일 생성\n


$set 14 MSGCAT_UTIL_SET_COMPACTDB
Expand Down
3 changes: 2 additions & 1 deletion msg/ro_RO.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,8 @@ opţiuni valide:\n\
implicit: nu se foloseşte delimitator\n\
-S, --SA-mode mod de execuţie independent\n\
-C, --CS-mode mod de execuţie client-server\n\
--datafile-per-class creează un fişier obiect pentru fieacre clasă; implicit: dezactivat\n
--datafile-per-class creează un fişier obiect pentru fieacre clasă; implicit: dezactivat\n\
--split-schema-files împărțiți informațiile de schemă pe obiect și generați fiecare fișier; Implicit: generați un fișier de schemă cu toate obiectele\n



Expand Down
3 changes: 2 additions & 1 deletion msg/tr_TR.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,8 @@ geçerli seçenekler:\n\
--use-delimiter kullanımı '"' bir tanımlayıcı nereden başlayıp nerede bittiği; varsayılan: kullanmayın\n\
-S, --SA-mode stand-alone modu yürütme\n\
-C, --CS-mode istemci-sunucu modunda yürütme\n\
--datafile-per-class her sınıf için bir nesne dosyası oluşturmak; varsayılan: devre dışı\n
--datafile-per-class her sınıf için bir nesne dosyası oluşturmak; varsayılan: devre dışı\n\
--split-schema-files şema bilgilerini nesneye göre ayırın ve her dosyayı oluşturun; Varsayılan: tüm nesnelerle bir şema dosyası oluştur\n



Expand Down
3 changes: 2 additions & 1 deletion msg/vi_VN.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,8 @@ valid options:\n\
--use-delimiter use '"' where an identifier begins and ends; default: don't use\n\
-S, --SA-mode stand-alone mode execution\n\
-C, --CS-mode client-server mode execution\n\
--datafile-per-class create a object file for each class; default: disabled\n
--datafile-per-class create a object file for each class; default: disabled\n\
--split-schema-files split schema information by object and generate each file; Default: generate one schema file with all objects\n



Expand Down
8 changes: 5 additions & 3 deletions msg/zh_CN.utf8/utils.msg
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,9 @@ loaddb: 将对象和结构导入到数据库.\n\
-d, --data-file=FILE 从文件 FILE 读取数据\n\
-t, --table=TABLE 用TABLE名替代数据文件中找不到表头的表\n\
--error-control-file=FILE 指定文件 FILE 用来描述在读取数据过程中如何处理特定的错误\n\
--ignore-class-file=FILE 指定文件 FILE 用来描述要忽略掉的类\n
--ignore-class-file=FILE 指定文件 FILE 用来描述要忽略掉的类\n\
--no-user-specified-name Find classes, serials, and triggers by their object names without their owner names.\n\
This is to load files generated by cubrid before version 11.2.\n


$set 13 MSGCAT_UTIL_SET_UNLOADDB
Expand Down Expand Up @@ -551,8 +553,8 @@ unloaddb: 从数据库导出对象和结构.\n\
-S, --SA-mode 单机模式执行\n\
-C, --CS-mode 客户端-服务器模式执行\n\
--datafile-per-class 为每个表创建一个对象文件; 默认: 禁止\n\
--no-user-specified-name Find classes, serials, and triggers by their object names without their owner names.\n\
This is to load files generated by cubrid before version 11.2.\n
--split-schema-files 按对象拆分模式信息并生成每个文件; 默认:生成一个包含所有对象的模式文件\n



$set 14 MSGCAT_UTIL_SET_COMPACTDB
Expand Down
11 changes: 10 additions & 1 deletion src/executables/extract_schema.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,45 @@

#include "dbtype_def.h"
#include <stdio.h>
#include <vector>
#include <string>

typedef enum
{
FOLLOW_STORAGE_ORDER = 0,
FOLLOW_ATTRIBUTE_ORDER = 1
} EMIT_STORAGE_ORDER;

// *INDENT-OFF*
struct extract_context
{
/* input */
int do_auth;
EMIT_STORAGE_ORDER storage_order;
const char *exec_name;
const char *output_dirname;
const char *output_prefix;

/* working */
int has_indexes;
std::vector<std::string> schema_file_list;
DB_OBJLIST *classes;
DB_OBJLIST *vclass_list_has_using_index;

extract_context ():
do_auth (0),
storage_order (FOLLOW_STORAGE_ORDER),
exec_name (NULL),
output_dirname(NULL),
output_prefix(NULL),
has_indexes (0),
schema_file_list(NULL),
classes (NULL),
vclass_list_has_using_index (NULL)
{
}

void clear_schema_workspace (void);
};

// *INDENT-ON*
#endif /* _EXTRACT_SCHEMA_HPP_ */
Loading

0 comments on commit 14d7e06

Please sign in to comment.