baserow-rs

Crates.iobaserow-rs
lib.rsbaserow-rs
version
sourcesrc
created_at2024-12-11 23:20:37.403077
updated_at2024-12-12 22:13:25.219016
descriptionA Rust client for the Baserow API.
homepage
repositoryhttps://github.com/cedricziel/baserow-rs
max_upload_size
id1480604
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Cedric Ziel (cedricziel)

documentation

README

Baserow-rs

Baserow-rs is a Rust client for the Baserow API. It is a work in progress and is not yet ready for production use.

Authentication

Baserow supports two authentication methods:

  • Database Token
  • JWT Token

You should use the database token for server-to-server communication and the JWT token for client-to-server communication.

Note: Some endpoints require a JWT token, some require a database token, and some require both.

Usage

Authentication (Database Token)

let configuration = ConfigBuilder::new()
    .base_url(endpoint.as_str())
    .database_token(api_key.as_str())
    .build();

Authentication (JWT Token)

let configuration = ConfigBuilder::new()
    .base_url(endpoint.as_str())
    .email("test@example.com")
    .password("password")
    .build();

let baserow = Baserow::with_configuration(configuration);
baserow.token_auth().await?;

Retrieve a tables' rows by id

let configuration = ConfigBuilder::new()
    .base_url(endpoint.as_str())
    .database_token(api_key.as_str())
    .build();

let baserow = Baserow::with_configuration(configuration);

// retrieve a table by id
let rows = baserow
    .table_by_id(176)
    // grab a request builder
    .rows()
    // filter by a field
    .filter_by("field_1529", Filter::Equal, "testaaaaaaaaaa")
    // order by a field
    .order_by("field_1529", OrderDirection::Asc)
    // execute the query
    .get()
    .await?;

println!("Rows: {:#?}", rows);

License

Apache 2.0

Commit count: 28

cargo fmt