### Start KingbaseES Database and Initialize Schema with Docker Compose Source: https://github.com/yunaiv/yudao-cloud/blob/master/sql/tools/README.md Launches a KingbaseES database container using Docker Compose. Before starting, the KingbaseES Docker image (x86_64 or aarch64) must be downloaded and loaded. After the container is up, a manual command is necessary to execute the schema script (`schema.sql`) using `ksql` inside the container. All operations must be executed from the `sql/tools` directory. ```Bash docker load -i kdb_x86_64_V009R001C001B0025.tar ``` ```Bash docker compose up -d kingbase docker compose exec kingbase bash -c 'ksql -U $DB_USER -d test -f /tmp/schema.sql' ``` -------------------------------- ### Start DM Database and Initialize Schema with Docker Compose Source: https://github.com/yunaiv/yudao-cloud/blob/master/sql/tools/README.md Launches a DM (Dameng) database container using Docker Compose. Before starting, the DM Docker image must be downloaded and loaded. After the container is up, a manual command is necessary to execute the schema script (`schema.sql`) using `disql` inside the container, as DM does not support direct initialization scripts. All operations must be executed from the `sql/tools` directory. ```Bash docker load -i dm8_20240715_x86_rh6_rq_single.tar ``` ```Bash docker compose up -d dm8 docker compose exec dm8 bash -c '/opt/dmdbms/bin/disql SYSDBA/SYSDBA001 \`/tmp/schema.sql' exit ``` -------------------------------- ### Install Python Dependency for MySQL DDL Conversion Source: https://github.com/yunaiv/yudao-cloud/blob/master/sql/tools/README.md Installs the `simple-ddl-parser` Python library, which is a required dependency for the `convertor.py` script. This script is used to convert MySQL DDL to other database formats. ```Bash pip install simple-ddl-parser # pip3 install simple-ddl-parser ``` -------------------------------- ### Start MySQL Test Database with Docker Compose Source: https://github.com/yunaiv/yudao-cloud/blob/master/sql/tools/README.md Launches a MySQL database container in detached mode using Docker Compose. This operation should be executed from the `sql/tools` directory. After startup, the project's SQL scripts will be automatically imported, which may take 1-2 minutes. ```Bash docker compose up -d mysql ``` -------------------------------- ### Start SQL Server Test Database and Initialize Schema with Docker Compose Source: https://github.com/yunaiv/yudao-cloud/blob/master/sql/tools/README.md Launches a SQL Server database container using Docker Compose. Due to SQL Server's lack of direct initialization script support via Docker Compose, an additional command is required to manually execute the schema creation script (`create_schema.sh`) inside the container after it starts. This operation should be executed from the `sql/tools` directory. ```Bash docker compose up -d sqlserver docker compose exec sqlserver bash /tmp/create_schema.sh ``` -------------------------------- ### Start Oracle Test Database with Docker Compose Source: https://github.com/yunaiv/yudao-cloud/blob/master/sql/tools/README.md Launches an Oracle database container using Docker Compose. Separate commands are provided for x86 and Apple Silicon (M1) architectures. Note that for Apple Silicon, the ORACLE_SID is 'FREE' instead of 'XE'. This operation should be executed from the `sql/tools` directory. ```Bash docker compose up -d oracle ``` ```Bash docker compose up -d oracle_m1 ``` -------------------------------- ### Start Huawei OpenGauss Database and Initialize Schema with Docker Compose Source: https://github.com/yunaiv/yudao-cloud/blob/master/sql/tools/README.md Launches an OpenGauss database container using Docker Compose. After the container is up, a manual command is necessary to execute the schema script (`schema.sql`) using `gsql` inside the container. This operation should be executed from the `sql/tools` directory. ```Bash docker compose up -d opengauss docker compose exec opengauss bash -c '/usr/local/opengauss/bin/gsql -U $GS_USERNAME -W $GS_PASSWORD -d postgres -f /tmp/schema.sql' ``` -------------------------------- ### Start PostgreSQL Test Database with Docker Compose Source: https://github.com/yunaiv/yudao-cloud/blob/master/sql/tools/README.md Launches a PostgreSQL database container in detached mode using Docker Compose. This operation should be executed from the `sql/tools` directory. After startup, the project's SQL scripts will be automatically imported, which may take 1-2 minutes. ```Bash docker compose up -d postgres ``` -------------------------------- ### Destroy and Recreate Docker Compose Database Containers Source: https://github.com/yunaiv/yudao-cloud/blob/master/sql/tools/README.md Provides instructions for destroying and recreating a Docker Compose-managed database container to obtain a clean database instance. This involves stopping the container, removing its associated data volume, and then recreating the container. An example is provided for PostgreSQL. ```Bash docker compose down postgres docker volume rm ruoyi-vue-pro_postgres ``` -------------------------------- ### Convert MySQL DDL to Other Database Formats using Python Script Source: https://github.com/yunaiv/yudao-cloud/blob/master/sql/tools/README.md Executes the `convertor.py` Python script located in `sql/tools/` to convert MySQL DDL from `sql/mysql/ruoyi-vue-pro.sql` into a specified target database format (e.g., PostgreSQL). The output is printed to the terminal and can be redirected to a temporary file. Supported target databases include Oracle, SQL Server, DM8, Kingbase, and OpenGauss. ```Bash python3 convertor.py postgres # python3 convertor.py postgres > tmp.sql ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.