From b20813338833dd5976e2f8bff6d2d5c00b79cf9c Mon Sep 17 00:00:00 2001 From: Ziyang Hu Date: Sat, 26 Nov 2022 17:43:49 +0800 Subject: [PATCH] update rust doc --- cozo-core/README.md | 3 +++ cozo-core/src/lib.rs | 16 +++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 cozo-core/README.md diff --git a/cozo-core/README.md b/cozo-core/README.md new file mode 100644 index 00000000..88aa7790 --- /dev/null +++ b/cozo-core/README.md @@ -0,0 +1,3 @@ +# Cozo-core + +This crate contains the implementation proper of CozoDB. \ No newline at end of file diff --git a/cozo-core/src/lib.rs b/cozo-core/src/lib.rs index c7235dbd..2f578ddc 100644 --- a/cozo-core/src/lib.rs +++ b/cozo-core/src/lib.rs @@ -7,21 +7,23 @@ */ //! This crate provides the core functionalities of [CozoDB](https://github.com/cozodb/cozo). -//! It may be used directly for embedding CozoDB in other applications. +//! It may be used to embed CozoDB in your application. //! -//! This doc describes the Rust API. For general information about how to use Cozo, see: +//! This doc describes the Rust API. To learn how to use CozoDB to query (CozoScript), see: //! -//! * [Installation and first queries](https://github.com/cozodb/cozo#install) -//! * [Tutorial](https://nbviewer.org/github/cozodb/cozo-docs/blob/main/tutorial/tutorial.ipynb) -//! * [Manual for CozoScript](https://cozodb.github.io/current/manual/) +//! * [CozoScript Tutorial](https://nbviewer.org/github/cozodb/cozo-docs/blob/main/tutorial/tutorial.ipynb) +//! * [CozoScript Manual](https://cozodb.github.io/current/manual/) //! -//! Example usage: +//! You can run all the queries described in the tutorial with an in-browser DB [here](https://cozodb.github.io/wasm-demo/) +//! without installing anything. +//! +//! Rust API usage: //! ``` //! use cozo::*; //! //! let db = DbInstance::new("mem", "", Default::default()).unwrap(); //! let script = "?[a] := a in [1, 2, 3]"; -//! let result = db.run_script(script, &Default::default()).unwrap(); +//! let result = db.run_script(script, Default::default()).unwrap(); //! println!("{:?}", result); //! ``` //! We created an in-memory database above. There are other persistent options: