OceanBase logo

OceanBase

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Resources

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS

OceanBase Cloud

OceanBase Database

Tools

Connectors and Middleware

QUICK START

OceanBase Cloud

OceanBase Database

BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Company

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

International - English
中国站 - 简体中文
日本 - 日本語
Sign In
Start on Cloud

A unified distributed database ready for your transactional, analytical, and AI workloads.

DEPLOY YOUR WAY

OceanBase Cloud

The best way to deploy and scale OceanBase

OceanBase Enterprise

Run and manage OceanBase on your infra

TRY OPEN SOURCE

OceanBase Community Edition

The free, open-source distributed database

OceanBase seekdb

Open source AI native search database

Customer Stories

Real-world success stories from enterprises across diverse industries.

View All
BY USE CASES

Mission-Critical Transactions

Global & Multicloud Application

Elastic Scaling for Peak Traffic

Real-time Analytics

Active Geo-redundancy

Database Consolidation

Comprehensive knowledge hub for OceanBase.

Blog

Live Demos

Training & Certification

Documentation

Official technical guides, tutorials, API references, and manuals for all OceanBase products.

View All
PRODUCTS
OceanBase CloudOceanBase Database
ToolsConnectors and Middleware
QUICK START
OceanBase CloudOceanBase Database
BEST PRACTICES

Practical guides for utilizing OceanBase more effectively and conveniently

Learn more about OceanBase – our company, partnerships, and trust and security initiatives.

About OceanBase

Partner

Trust Center

Contact Us

Start on Cloud
编组
All Products
    • Databases
    • iconOceanBase Database
    • iconOceanBase Cloud
    • iconOceanBase Tugraph
    • iconInteractive Tutorials
    • iconOceanBase Best Practices
    • Tools
    • iconOceanBase Cloud Platform
    • iconOceanBase Migration Service
    • iconOceanBase Developer Center
    • iconOceanBase Migration Assessment
    • iconOceanBase Admin Tool
    • iconOceanBase Loader and Dumper
    • iconOceanBase Deployer
    • iconKubernetes operator for OceanBase
    • iconOceanBase Diagnostic Tool
    • iconOceanBase Binlog Service
    • Connectors and Middleware
    • iconOceanBase Database Proxy
    • iconEmbedded SQL in C for OceanBase
    • iconOceanBase Call Interface
    • iconOceanBase Connector/C
    • iconOceanBase Connector/J
    • iconOceanBase Connector/ODBC
    • iconOceanBase Connector/NET
icon

OceanBase Tugraph

V3.3.3Enterprise Edition

  • Guide
    • What is a graph
    • What is a graph database
    • TuGraph Quick Start
  • Operating
    • Introduction
    • Installation
    • Data Importing
    • Service configuration
    • Service operations
    • Tools
      • tugraph_cypher Instructions
      • TuGraph Browser
      • TuGraph DataX Instructions
      • TuGraph Explore Instructions
    • High Availability mode
    • Database Management
    • User rights Management
  • Developer Document
    • TuGraph RESTful API
    • TuGraph-Cypher
    • TuGraph Stored Procedure Guide
    • Graph Analytics Engine
      • Bootstrap program
      • OlapBase API
      • OlapOnDB API
      • OlapOnDisk API
      • TuGraph Built-in Algorithm Description
  • Client
    • TuGraph Java SDK
    • TuGraph Python SDK
    • TuGraph C++ SDK
  • Supplement
    • Update the content description
  • Community
    • TuGraph Contribution Guide
    • TuGraph community roles
    • TuGraph Open source planning
    • Ant_Group_Open_Source_Individual_CLA_English_Chinese_2021
    • Ant_Group_Open_Source_Corporate_CLA_English_Chinese_2021

Download PDF

What is a graph What is a graph database TuGraph Quick Start Introduction Installation Data Importing Service configuration Service operations tugraph_cypher Instructions TuGraph Browser TuGraph DataX Instructions TuGraph Explore Instructions High Availability mode Database Management User rights Management TuGraph RESTful API TuGraph-Cypher TuGraph Stored Procedure Guide Bootstrap program OlapBase API OlapOnDB API OlapOnDisk API TuGraph Built-in Algorithm Description TuGraph Java SDK TuGraph Python SDK TuGraph C++ SDK Update the content description TuGraph Contribution Guide TuGraph community roles TuGraph Open source planningAnt_Group_Open_Source_Individual_CLA_English_Chinese_2021Ant_Group_Open_Source_Corporate_CLA_English_Chinese_2021
OceanBase logo

The Unified Distributed Database for the AI Era.

Follow Us
Products
OceanBase CloudOceanBase EnterpriseOceanBase Community EditionOceanBase seekdb
Resources
DocsBlogLive DemosTraining & Certification
Company
About OceanBaseTrust CenterLegalPartnerContact Us
Follow Us

© OceanBase 2026. All rights reserved

Cloud Service AgreementPrivacy PolicySecurity
Contact Us
Document Feedback
  1. Documentation Center
  2. OceanBase Tugraph
  3. V3.3.3
iconOceanBase Tugraph
V 3.3.3Enterprise Edition

TuGraph C++ SDK

Last Updated:2023-06-25 03:23:24  Updated
share
What is on this page
Instructions
Demo
Instantiate the client object
Call cypher
Call stored procedure
Load stored procedure
Import from a byte stream schema
Import node and edge data from a byte stream
**Import schema from a file **
Import edge data from a file

folded

share

This document is the usage instruction of TuGraph C++ SDK

Instructions

C++ Client can use RPC to connect to lgraph_server to import data, execute stored procedures, call Cypher and other operations.

Demo

Instantiate the client object

Introduce dependencies and instantiate

RpcClient client3("0.0.0.0:19099", "admin", "73@TuGraph");
RpcClient(const std::string& url, const std::string& user, const std::string& password);
@param url: tugraph host looks like ip:port
@param user: login user name
@param password: login password

Call cypher

    std::string str;
    bool ret = client.CallCypher(str,
        "CALL db.createVertexLabel('actor', 'name', 'name', string, false, 'age', int8, true)");

    bool CallCypher(std::string& result, const std::string& cypher,
        const std::string& graph = "default",
        bool json_format = true,
        double timeout = 0);
    @param result: the result returned by the service.
    @param cypher: inquire statement.
    @param graph: the graph to query.
    @param json_format: The result is returned in JSON format
    @param timeout: Maximum execution time, overruns will be interrupted
    @return: whether the command is executed successfully

Call stored procedure

    std::string str;
    bool ret = client.CallPlugin(str, "CPP", "test_plugin1", "bcefg");
    bool CallPlugin(std::string& result, const std::string& plugin_type,
        const std::string& plugin_name, const std::string& param,
        double plugin_time_out = 0.0, bool in_process = false,
        const std::string& graph = "default", bool json_format = true,
        double timeout = 0);
    @param result: the result returned by the service.
    @param plugin_type: the plugin type, currently supported CPP and PY
    @param plugin_name: plugin name
    @param param: the execution parameters
    @param plugin_timeout: Maximum execution time, overruns will be interrupted
    @param graph: the graph to query.
    @param json_format: The result is returned in JSON format
    @param timeout: Maximum execution time, overruns will be interrupted
    @return: whether the command is executed successfully

Load stored procedure

    std::string str;
    bool ret = client.LoadPlugin(str, code_sleep, "PY", "python_plugin1", "PY", "this is a test plugin",
    bool LoadPlugin(std::string& result, const std::string& source_file,
        const std::string& plugin_type, const std::string& plugin_name,
        const std::string& code_type, const std::string& plugin_description,
        bool read_only, const std::string& graph = "default", bool json_format = true,
        double timeout = 0);
    @param result: the result returned by the service.
    @param source_file: the source_file contain plugin code
    @param plugin_type: the plugin type, currently supported CPP and PY
    @param plugin_name: plugin name
    @param code_type: code type, currently supported PY, SO, CPP, ZIP
    @param plugin_description: plugin description
    @param read_only: plugin is read only or not
    @param graph: the graph to query.
    @param json_format: The result is returned in JSON format
    @param timeout: Maximum execution time, overruns will be interrupted
    @return: whether the command is executed successfully

Import from a byte stream schema

    std::string str;
    bool ret = client.ImportSchemaFromContent(str, sImportContent["schema"]);
    bool ImportSchemaFromContent(std::string& result, const std::string& schema,
        const std::string& graph = "default", bool json_format = true,
        double timeout = 0);
    @param result: the result returned by the service.
    @param schema: the schema to be imported
    @param graph: the graph to query.
    @param json_format: The result is returned in JSON format
    @param timeout: Maximum execution time, overruns will be interrupted
    @return: whether the command is executed successfully

Import node and edge data from a byte stream

    std::string str;
    ret = client.ImportDataFromContent(str, sImportContent["person_desc"], sImportContent["person"],",");
    bool ImportDataFromContent(std::string& result, const std::string& desc,
        const std::string& data, const std::string& delimiter,
        bool continue_on_error = false, int thread_nums = 8,
        const std::string& graph = "default", bool json_format = true,
        double timeout = 0);
    @param result: the result returned by the service.
    @param desc: data format description
    @param data: the data to be imported
    @param delimiter: data separator
    @param continueOnError: whether to continue when importing data fails
    @param threadNums: maximum number of threads
    @param graph: the graph to query.
    @param json_format: The result is returned in JSON format
    @param timeout: Maximum execution time, overruns will be interrupted
    @return: whether the command is executed successfully

**Import schema from a file **

    std::string conf_file("./yago.conf");
    std::string str;
    ret = client.ImportSchemaFromFile(str, conf_file);
    bool ImportSchemaFromFile(std::string& result, const std::string& schema_file,
        const std::string& graph = "default", bool json_format = true,
        double timeout = 0);
    @param result: the result returned by the service.
    @param schemaFile: the schema_file contain schema
    @param graph: the graph to query.
    @param json_format: The result is returned in JSON format
    @param timeout: Maximum execution time, overruns will be interrupted
    @return: whether the command is executed successfully

Import edge data from a file

    std::string conf_file("./yago.conf");
    std::string str;
    ret = client.ImportDataFromFile(str, conf_file, ",");
    bool ImportDataFromFile(std::string& result, const std::string& conf_file,
        const std::string& delimiter, bool continue_on_error = false,
        int thread_nums = 8, int skip_packages = 0,
        const std::string& graph = "default", bool json_format = true,
        double timeout = 0);
    @param result: the result returned by the service.
    @param conf_file: data file contain format description and data
    @param delimiter: data separator
    @param continue_on_error: whether to continue when importing data fails
    @param thread_nums: maximum number of threads
    @param skip_packages: skip packages number
    @param graph: the graph to query.
    @param json_format: The result is returned in JSON format
    @param timeout: Maximum execution time, overruns will be interrupted
    @return: whether the command is executed successfully

Previous topic

TuGraph Python SDK
Last

Next topic

Update the content description
Next
What is on this page
Instructions
Demo
Instantiate the client object
Call cypher
Call stored procedure
Load stored procedure
Import from a byte stream schema
Import node and edge data from a byte stream
**Import schema from a file **
Import edge data from a file