Skip to content

Issue on docs: embedded replicas rust example #323

@qtfkwk

Description

@qtfkwk

Path: /features/embedded-replicas/introduction

https://docs.turso.tech/features/embedded-replicas/introduction#usage

Hi! Having some confusion with the documentation...

The Rust example has:

use libsql::{Builder};

let build = Builder::new_remote_replica("file:replica.db", "libsql://...", "...")
   .build()
   .await?;
let client = build.connect()?;
client.sync().await?;

Feedback:

  1. Change use libsql::{Builder}; to use libsql::Builder;

  2. client is a Connection. Connection doesn't have any sync method, but Database does... and build is a Database... so perhaps it should be build.sync().await?;?

  3. In general, it would be useful if the examples in the documentation used better, descriptive, and consistent variable names to improve understanding. For example, the prior snippet uses db and conn, which make more sense honestly than build and client. Why are they different here? If there's a good reason, the doc should explain it. If not, they should match the same names used everywhere else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions