Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cedricziel/baserow-rs
Baserow client for Rust
https://github.com/cedricziel/baserow-rs
baserow baserow-api
Last synced: 16 days ago
JSON representation
Baserow client for Rust
- Host: GitHub
- URL: https://github.com/cedricziel/baserow-rs
- Owner: cedricziel
- Created: 2024-12-11T22:56:23.000Z (25 days ago)
- Default Branch: main
- Last Pushed: 2024-12-19T20:41:53.000Z (17 days ago)
- Last Synced: 2024-12-19T20:48:17.295Z (17 days ago)
- Topics: baserow, baserow-api
- Language: Rust
- Homepage:
- Size: 42 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
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 TokenYou 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)
```rust
let configuration = ConfigBuilder::new()
.base_url(endpoint.as_str())
.database_token(api_key.as_str())
.build();
```### Authentication (JWT Token)
```rust
let configuration = ConfigBuilder::new()
.base_url(endpoint.as_str())
.email("[email protected]")
.password("password")
.build();let baserow = Baserow::with_configuration(configuration);
baserow.token_auth().await?;
```### Retrieve a tables' rows by id
```rust
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