Skip to content

Commit

Permalink
deploy: 3448b18
Browse files Browse the repository at this point in the history
  • Loading branch information
mjovanc committed Nov 26, 2023
1 parent 007f18c commit 840d810
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
22 changes: 2 additions & 20 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,7 @@


<h1 id="welcome-to-njord">Welcome to njord!</h1>
<h2 id="commands">Commands</h2>
<ul>
<li><code>mkdocs new [dir-name]</code> - Create a new project.</li>
<li><code>mkdocs serve</code> - Start the live-reloading docs server.</li>
<li><code>mkdocs build</code> - Build the documentation site.</li>
<li><code>mkdocs -h</code> - Print help message and exit.</li>
</ul>
<h2 id="project-layout">Project layout</h2>
<pre><code>mkdocs.yml # The configuration file.
docs/
index.md # The documentation homepage.
... # Other markdown pages, images and other files.
</code></pre>
<p>A lightweight ORM library for Rust with strong-typed SQL DSL and sequence APIs.</p>

<ul class="metadata page-metadata" data-bi-name="page info" lang="en-us" dir="ltr">
<li class="last-updated-holder displayDate loading">
Expand Down Expand Up @@ -123,12 +111,6 @@ <h2 id="project-layout">Project layout</h2>
<div id="toc-collapse" class="navbar-collapse collapse card">
<ul class="nav flex-column bs-sidenav">
<li class="nav-item main"><a class="nav-link" href="#welcome-to-njord">Welcome to njord!</a></li>
<li class="nav-item">
<a href="#commands" class="nav-link">Commands</a>
</li>
<li class="nav-item">
<a href="#project-layout" class="nav-link">Project layout</a>
</li>
</ul>
</div>
</div></div>
Expand Down Expand Up @@ -216,5 +198,5 @@ <h4 class="modal-title">Search</h4>

<!--
MkDocs version : 1.5.3
Build Date UTC : 2023-11-26 11:38:37.476287+00:00
Build Date UTC : 2023-11-26 11:39:33.169826+00:00
-->
2 changes: 1 addition & 1 deletion search/search_index.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Welcome to njord! Commands mkdocs new [dir-name] - Create a new project. mkdocs serve - Start the live-reloading docs server. mkdocs build - Build the documentation site. mkdocs -h - Print help message and exit. Project layout mkdocs.yml # The configuration file. docs/ index.md # The documentation homepage. ... # Other markdown pages, images and other files.","title":"Home"},{"location":"#welcome-to-njord","text":"","title":"Welcome to njord!"},{"location":"#commands","text":"mkdocs new [dir-name] - Create a new project. mkdocs serve - Start the live-reloading docs server. mkdocs build - Build the documentation site. mkdocs -h - Print help message and exit.","title":"Commands"},{"location":"#project-layout","text":"mkdocs.yml # The configuration file. docs/ index.md # The documentation homepage. ... # Other markdown pages, images and other files.","title":"Project layout"},{"location":"get_started/","text":"Get started To install njord into your Rust project we need to include the dependencies: Cargo.toml [dependencies] # The core APIs, including the Table trait. Always # required when using njord. The \"derive\" feature is only required when # using #[derive(Table)] to make njord work with structs # and enums defined in your crate. njord = { version = \"0.1.0\", features = [\"derive\"] }","title":"GetStarted"},{"location":"get_started/#get-started","text":"To install njord into your Rust project we need to include the dependencies: Cargo.toml [dependencies] # The core APIs, including the Table trait. Always # required when using njord. The \"derive\" feature is only required when # using #[derive(Table)] to make njord work with structs # and enums defined in your crate. njord = { version = \"0.1.0\", features = [\"derive\"] }","title":"Get started"},{"location":"sqlite/","text":"Sqlite Setup connection First thing you need to do is to setup a connection is: let conn = sqlite::open(\"my_database.db\"); We can also use a in-memory database: let conn = sqlite::open_in_memory(\"my_database.db\"); Define tables To define a table we use derive with the Table (provided by njord) and Default procedural macro. Then we create a simple struct with a given name. The name of the struct will be the table name in the database: #[derive(Table, Default)] struct Posts { title: String, description: String, } #[derive(Table, Default)] struct Categories { name: String, } Initialize database with tables First thing we need to do before we do any insert , select etc is to initialize the database with the defined tables. To initialize the database we need to box the struct and call default() and save it to a variable: let posts_table = Box::<Posts>::default(); let categories_table = Box::<Categories>::default(); Now we add them to a tables vector: let mut tables: Vec<Box<dyn Table>> = vec![posts_table, categories_table]; Lastly, we call the init() function to setup the tables from the tables vector, such as: sqlite::init(conn, tables); Insert data to table To insert data, we need to initialize our Posts struct that we created with values for each field: let table_row: Posts = Posts { title: \"A post title\".to_string(), description: \"Some description for for a post\".to_string(), }; We insert the row by passing a connection and a reference to the table_row: sqlite::insert(conn, &table_row); Drop table To drop a table, it is a simple as: sqlite::drop_table(conn, &Posts::default()); Select Docs are coming soon... WHERE ORDER BY GROUP BY LIMIT OFFSET","title":"Sqlite"},{"location":"sqlite/#sqlite","text":"","title":"Sqlite"},{"location":"sqlite/#setup-connection","text":"First thing you need to do is to setup a connection is: let conn = sqlite::open(\"my_database.db\"); We can also use a in-memory database: let conn = sqlite::open_in_memory(\"my_database.db\");","title":"Setup connection"},{"location":"sqlite/#define-tables","text":"To define a table we use derive with the Table (provided by njord) and Default procedural macro. Then we create a simple struct with a given name. The name of the struct will be the table name in the database: #[derive(Table, Default)] struct Posts { title: String, description: String, } #[derive(Table, Default)] struct Categories { name: String, }","title":"Define tables"},{"location":"sqlite/#initialize-database-with-tables","text":"First thing we need to do before we do any insert , select etc is to initialize the database with the defined tables. To initialize the database we need to box the struct and call default() and save it to a variable: let posts_table = Box::<Posts>::default(); let categories_table = Box::<Categories>::default(); Now we add them to a tables vector: let mut tables: Vec<Box<dyn Table>> = vec![posts_table, categories_table]; Lastly, we call the init() function to setup the tables from the tables vector, such as: sqlite::init(conn, tables);","title":"Initialize database with tables"},{"location":"sqlite/#insert-data-to-table","text":"To insert data, we need to initialize our Posts struct that we created with values for each field: let table_row: Posts = Posts { title: \"A post title\".to_string(), description: \"Some description for for a post\".to_string(), }; We insert the row by passing a connection and a reference to the table_row: sqlite::insert(conn, &table_row);","title":"Insert data to table"},{"location":"sqlite/#drop-table","text":"To drop a table, it is a simple as: sqlite::drop_table(conn, &Posts::default());","title":"Drop table"},{"location":"sqlite/#select","text":"Docs are coming soon...","title":"Select"},{"location":"sqlite/#where","text":"","title":"WHERE"},{"location":"sqlite/#order-by","text":"","title":"ORDER BY"},{"location":"sqlite/#group-by","text":"","title":"GROUP BY"},{"location":"sqlite/#limit","text":"","title":"LIMIT"},{"location":"sqlite/#offset","text":"","title":"OFFSET"}]}
{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"Welcome to njord! A lightweight ORM library for Rust with strong-typed SQL DSL and sequence APIs.","title":"Home"},{"location":"#welcome-to-njord","text":"A lightweight ORM library for Rust with strong-typed SQL DSL and sequence APIs.","title":"Welcome to njord!"},{"location":"get_started/","text":"Get started To install njord into your Rust project we need to include the dependencies: Cargo.toml [dependencies] # The core APIs, including the Table trait. Always # required when using njord. The \"derive\" feature is only required when # using #[derive(Table)] to make njord work with structs # and enums defined in your crate. njord = { version = \"0.1.0\", features = [\"derive\"] }","title":"GetStarted"},{"location":"get_started/#get-started","text":"To install njord into your Rust project we need to include the dependencies: Cargo.toml [dependencies] # The core APIs, including the Table trait. Always # required when using njord. The \"derive\" feature is only required when # using #[derive(Table)] to make njord work with structs # and enums defined in your crate. njord = { version = \"0.1.0\", features = [\"derive\"] }","title":"Get started"},{"location":"sqlite/","text":"Sqlite Setup connection First thing you need to do is to setup a connection is: let conn = sqlite::open(\"my_database.db\"); We can also use a in-memory database: let conn = sqlite::open_in_memory(\"my_database.db\"); Define tables To define a table we use derive with the Table (provided by njord) and Default procedural macro. Then we create a simple struct with a given name. The name of the struct will be the table name in the database: #[derive(Table, Default)] struct Posts { title: String, description: String, } #[derive(Table, Default)] struct Categories { name: String, } Initialize database with tables First thing we need to do before we do any insert , select etc is to initialize the database with the defined tables. To initialize the database we need to box the struct and call default() and save it to a variable: let posts_table = Box::<Posts>::default(); let categories_table = Box::<Categories>::default(); Now we add them to a tables vector: let mut tables: Vec<Box<dyn Table>> = vec![posts_table, categories_table]; Lastly, we call the init() function to setup the tables from the tables vector, such as: sqlite::init(conn, tables); Insert data to table To insert data, we need to initialize our Posts struct that we created with values for each field: let table_row: Posts = Posts { title: \"A post title\".to_string(), description: \"Some description for for a post\".to_string(), }; We insert the row by passing a connection and a reference to the table_row: sqlite::insert(conn, &table_row); Drop table To drop a table, it is a simple as: sqlite::drop_table(conn, &Posts::default()); Select Docs are coming soon... WHERE ORDER BY GROUP BY LIMIT OFFSET","title":"Sqlite"},{"location":"sqlite/#sqlite","text":"","title":"Sqlite"},{"location":"sqlite/#setup-connection","text":"First thing you need to do is to setup a connection is: let conn = sqlite::open(\"my_database.db\"); We can also use a in-memory database: let conn = sqlite::open_in_memory(\"my_database.db\");","title":"Setup connection"},{"location":"sqlite/#define-tables","text":"To define a table we use derive with the Table (provided by njord) and Default procedural macro. Then we create a simple struct with a given name. The name of the struct will be the table name in the database: #[derive(Table, Default)] struct Posts { title: String, description: String, } #[derive(Table, Default)] struct Categories { name: String, }","title":"Define tables"},{"location":"sqlite/#initialize-database-with-tables","text":"First thing we need to do before we do any insert , select etc is to initialize the database with the defined tables. To initialize the database we need to box the struct and call default() and save it to a variable: let posts_table = Box::<Posts>::default(); let categories_table = Box::<Categories>::default(); Now we add them to a tables vector: let mut tables: Vec<Box<dyn Table>> = vec![posts_table, categories_table]; Lastly, we call the init() function to setup the tables from the tables vector, such as: sqlite::init(conn, tables);","title":"Initialize database with tables"},{"location":"sqlite/#insert-data-to-table","text":"To insert data, we need to initialize our Posts struct that we created with values for each field: let table_row: Posts = Posts { title: \"A post title\".to_string(), description: \"Some description for for a post\".to_string(), }; We insert the row by passing a connection and a reference to the table_row: sqlite::insert(conn, &table_row);","title":"Insert data to table"},{"location":"sqlite/#drop-table","text":"To drop a table, it is a simple as: sqlite::drop_table(conn, &Posts::default());","title":"Drop table"},{"location":"sqlite/#select","text":"Docs are coming soon...","title":"Select"},{"location":"sqlite/#where","text":"","title":"WHERE"},{"location":"sqlite/#order-by","text":"","title":"ORDER BY"},{"location":"sqlite/#group-by","text":"","title":"GROUP BY"},{"location":"sqlite/#limit","text":"","title":"LIMIT"},{"location":"sqlite/#offset","text":"","title":"OFFSET"}]}
Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit 840d810

Please sign in to comment.