It's an example for Rust and TiDB. Contains subproject:
This is a process about the game, each player has two attributes,
coins and goods, and each player has their own unique id as an identifier.
Players can trade with each other, provided that the coins and goods are sufficient
The process is as follows:
- Create a player
- Create some players
- Read players amount
- Read some players attributes
- Two player trade with insufficient coins or goods
- Two player trade with sufficient coins or goods
- Rust with Cargo
- There is no specific
MSRV(Minimum Supported Rust Version) - Only tested with the latest stable version Rust compiler (older/nightly builds may work...)
- There is no specific
- diesel_cli
It's an example used diesel with mysql feature to connect TiDB.
- Run
diesel migration runto init schema in your tidb. - Run
cargo build --releaseto build entrypoint to test. - Run
./target/release/tidb-example-cmdto start.
diesel example expected output
It's an example service used diesel to connect TiDB. Provide a group of HTTP Restful interface.
- Run
diesel migration runto init schema in your tidb. - Run
cargo build --releaseto build entrypoint to test. - Run
./target/release/tidb-example-serverto start. - Using script to request. It's based on
curl
- request expected output
This software includes the work that is distributed in the Apache License 2.0.