This is an automated email from the ASF dual-hosted git repository.
xuanwo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-opendal.git
The following commit(s) were added to refs/heads/main by this push:
new 84d9bf729 docs: Add docs on website for libsql services (#3299)
84d9bf729 is described below
commit 84d9bf72952f17da9aa8cb8cc143b46c6cd8288f
Author: Nadeshiko Manju <[email protected]>
AuthorDate: Mon Oct 16 15:56:49 2023 +0800
docs: Add docs on website for libsql services (#3299)
Signed-off-by: Manjusaka <[email protected]>
---
website/docs/services/libsql.mdx | 75 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)
diff --git a/website/docs/services/libsql.mdx b/website/docs/services/libsql.mdx
new file mode 100644
index 000000000..b9a042e90
--- /dev/null
+++ b/website/docs/services/libsql.mdx
@@ -0,0 +1,75 @@
+---
+title: LibSQL
+---
+
+[libSQL](https://github.com/tursodatabase/libsql) service support.
+
+import Docs from '../../../core/src/services/libsql/docs.md'
+
+<Docs components={props.components} />
+
+### Via Config
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+<Tabs>
+ <TabItem value="rust" label="Rust" default>
+
+```rust
+use anyhow::Result;
+use opendal::Operator;
+use opendal::Scheme;
+use std::collections::HashMap;
+
+#[tokio::main]
+async fn main() -> Result<()> {
+ let mut map = HashMap::new();
+ map.insert("root".to_string(), "/".to_string());
+ map.insert("connection_string".to_string(),
"https://example.com/db".to_string());
+ map.insert("auth_token".to_string(), "secret".to_string());
+ map.insert("table".to_string(), "your_table".to_string());
+ map.insert("key_field".to_string(), "key".to_string());
+ map.insert("value_field".to_string(), "value".to_string());
+
+ let op: Operator = Operator::via_map(Scheme::Libsql, map)?;
+ Ok(())
+}
+```
+
+ </TabItem>
+ <TabItem value="node.js" label="Node.js">
+
+```javascript
+import { Operator } from "opendal";
+
+async function main() {
+ const op = new Operator("libsql", {
+ root: "/",
+ connection_string: "https://example.com/db",
+ auth_token: "secret",
+ table: "your_table",
+ key_field: "key",
+ value_field: "value",
+ });
+}
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+import opendal
+
+op = opendal.Operator("libsql",
+ root="/",
+ connection_string="https://example.com/db",
+ auth_token="secret",
+ table="your_table",
+ key_field="key",
+ value_field="value"
+)
+```
+
+ </TabItem>
+</Tabs>