7 releases (4 breaking)
new 0.5.1 | Dec 19, 2024 |
---|---|
0.5.0 | Dec 13, 2024 |
0.4.0 | Dec 12, 2024 |
0.3.0 | Dec 12, 2024 |
0.1.4 | Dec 11, 2024 |
#730 in Database interfaces
505 downloads per month
46KB
1K
SLoC
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
Dependencies
~7–18MB
~237K SLoC