English | 简体中文
This repository provides the sample projects for OceanBase.
For basic sample projects, we group them by the programming language, and the sample directories are named after the component name.
For sample projects that works as standalone applications, we put them under applications directory, and the module name typically contains the component name and purpose.
You can copy the sample code to local environment and use it directly after changing the connection info, please see the README file in the sample directory for more details.
We welcome contributions from anyone, thanks to all contributors!
We have created some issues on GitHub for some samples which are simple and good for first time contributors: #16.
The following are samples that have been added or planned to be added in the near future:
- applications
hertzbeatmydatasveltekit- TODO: 
seatunnel 
 - c
- TODO: 
obconnector-c 
 - TODO: 
 - c_plusplus
- TODO: 
mysql-connector-cpp 
 - TODO: 
 - c_sharp
- TODO: 
mysql-connector-netMySqlConnector 
 - TODO: 
 - golang
go-sql-drivergorm- TODO: 
xormobkv-table-client-go 
 - java
mybatismybatis-plusmysql-connector-javaoceanbase-clientspring-jdbcspringboottestcontainers-java- TODO: 
hibernatespring-data-jpahikaricpflink-cdcoblogclientobkv-table-client-java 
 - php
- TODO: 
mysqlipdo 
 - TODO: 
 - python
mysql-connector-pythonpymysqlsqlalchemy- TODO: 
mysqlclient 
 - ruby
activerecordmysql2sequel
 - rust
- TODO: 
sqlxrust-mysql-simpleobkv-table-client-rust 
 - TODO: 
 
In this repository, every sample project will be as an independent module. The directory name of the module should be same with the tool used in the sample. For example, the sample of mysql-connector-java is named mysql-connector-java.
There are many category directories in the root directory of this repository. For samples that can be run directly through simple commands, we recommend add them to the directory which corresponding to the programming language environment required by the sample. For example, mysql-connector-java needs to be added to the java directory. For samples that require more complex configuration to run, we recommend placing the sample project in the applications directory.
For a simple sample under the programming language category, the directory should contain the following content
- code files
 run.shscript to run codeREADME.mddocumentation for component usage.
If it's hard to use English for you, you can use your native language in the documentation, and we can improve it later.
To ensure that the sample works, please add your module to the GitHub CI workflow. This project provides a standardized workflow for simple samples. For details, please refer to basic-workflow.yml. You only need to add the following options to the yml of the corresponding language in the .github/workflows directory:
module.name: the name of new module, should be same with the module directory name.module.with_oceanbase_container: whether to use a pre-deployed OceanBase container, optional, set 'true' by default. If it's 'true', you can connect to it using username 'root@sys' or 'root@test' with empty password at localhost.
For complex samples that need to be placed in the applications directory, the directory also needs to contain project files and README.md document. In addition, you also need to add ci workflow to application.yml.
Refer to the community website for more details about OceanBase.