Crate tsubakuro_rust_core

Source
Expand description

tsubakuro-rust-core is the core library to access Tsurugi written in Rust.

§Overview

The procedure for executing SQL in tsubakuro-rust-core is generally as follows.

  1. Create a Session (to connect to the Tsurugi DB server).
    1. Create a ConnectionOption.
    2. Set endpoint url (e.g. tcp://localhost:12345), etc to ConnectionOption.
    3. Invoke Session::connect().
  2. Make a SqlClient from Session.
    1. Invoke Session::make_client().
  3. When using prepared statement, create a SqlPreparedStatement from SqlClient.
    1. Invoke SqlClient::prepare().
  4. Start a transaction (create a Transaction from SqlClient).
    1. Create a TransactionOption.
    2. Set TransactionType, etc to TransactionOption.
    3. Invoke SqlClient::start_transaction().
  5. Execute SQL using SqlClient, Transaction (and SqlPreparedStatement).
  6. Commit transaction.
    1. Create a CommitOption.
    2. Set CommitType, etc to CommitOption.
    3. Invoke SqlClient::commit().
  7. Close transaction.
    1. Invoke Transaction::close().
  8. Close prepared statement if created.
    1. Invoke SqlPreparedStatement::close().
  9. Close session.
    1. Invoke Session::close().

§Examples

See https://github.com/project-tsurugi/tsubakuro-rust/tree/master/tsubakuro-rust-core#example.

Modules§

prelude