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.io

Installation by Language

Rust Installation

Requirements:

  • Rust 1.70 or later
  • Tokio runtime for async operations

Install via Cargo:

cargo add ekodb_client tokio

Or add to Cargo.toml:

[dependencies]
ekodb_client = "0.1"
tokio = { version = "1", features = ["full"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

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.aws.ekodb.io
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.1"

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

Need Help?