Skip to main content

Installation

Prerequisites

Before installing a client library, make sure you have:

  1. Deployed an ekoDB instance - See Getting Started
  2. Retrieved your API key - See Authentication
  3. Your database URL - Format: https://{SUBDOMAIN}.{ENVIRONMENT}.{PROVIDER}.ekodb.net

Installation by Language

Rust Installation

Requirements:

  • Rust 1.70 or later
  • Tokio runtime for async operations

Install via Cargo:

cargo add ekodb_client

The ekodb_client package already includes all required dependencies (serde, serde_json, tokio, etc.).

Optional: Add tokio for macros in your code

If you want to use #[tokio::main] or other tokio macros in your own code:

cargo add tokio --features macros

Verify Installation:

use ekodb_client::Client;

fn main() {
println!("ekoDB Rust client installed successfully!");
}

Configuration

After installation, configure your client with your database URL and API key:

use ekodb_client::Client;
use std::env;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::builder()
.base_url(env::var("EKODB_URL")?)
.api_key(env::var("EKODB_API_KEY")?)
.timeout(std::time::Duration::from_secs(30))
.max_retries(3)
.build()?;

// Client is ready to use
Ok(())
}

Environment Variables

We recommend using environment variables for configuration:

# .env file
EKODB_URL=https://your-subdomain.production.google.ekodb.net
EKODB_API_KEY=your-api-key-here

Troubleshooting

Compilation errors

Make sure you have the latest version:

cargo update ekodb_client

Feature flag issues

If you get TLS-related errors, check your feature flags:

# Use rustls (default)
ekodb_client = "0.4.0"

# Or use native-tls
ekodb_client = { version = "0.4.0", default-features = false, features = ["native-tls"] }

Need Help?