Design APIs following modern conventions and best practices to improve usability, maintainability, and consistency across your codebase. APIs should prioritize:
Design APIs following modern conventions and best practices to improve usability, maintainability, and consistency across your codebase. APIs should prioritize:
// Instead of:
.query_sql("foo").with_query("SELECT * FROM bar")
// Prefer:
.query("foo").with_sql("SELECT * FROM bar")
// Instead of:
let now = self.time_provider.now().timestamp_nanos();
Some(now - retention_period as i64)
// Prefer:
self.time_provider.now().checked_sub(Duration::nanoseconds(retention_period))
// Instead of:
let db_query_param = format!("db={}", db.into());
let mut url = self.base_url.join(api_path)?;
url.set_query(Some(&db_query_param));
let mut req = self.http_client.delete(url);
// Prefer:
let mut url = self.base_url.join(api_path)?;
let mut req = self.http_client.delete(url).query(&[("db", db.as_ref())]);
// Instead of duplicating types in multiple crates:
// influxdb3_client::Precision and influxdb3_server::Precision
// Consider moving shared types to a common crate or re-exporting
// from a single source to ensure they're always identical
Enter the URL of a public GitHub repository