Skip to content

Commit

Permalink
deploy: 790d10f
Browse files Browse the repository at this point in the history
  • Loading branch information
mjovanc committed Nov 26, 2023
1 parent 0fdac18 commit 29a2016
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 274 deletions.
5 changes: 4 additions & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">


<meta name="author" content="Marcus Cvjeticanin">

<link rel="shortcut icon" href="//img/favicon.ico">
<title>njord - A lightweight ORM library for Rust</title>
Expand Down Expand Up @@ -60,6 +60,9 @@
<i class="fa fa-search"></i> Search
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/mjovanc/njord"><i class="fa fa-github"></i> GitHub</a>
</li>
</ul>
</div>
</div>
Expand Down
5 changes: 4 additions & 1 deletion about/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">


<meta name="author" content="Marcus Cvjeticanin">
<link rel="canonical" href="https://njord.rs/about/">
<link rel="shortcut icon" href="../img/favicon.ico">
<title>About - njord - A lightweight ORM library for Rust</title>
Expand Down Expand Up @@ -62,6 +62,9 @@
<i class="fa fa-search"></i> Search
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/mjovanc/njord/edit/master/docs/about.md"><i class="fa fa-github"></i> Edit on GitHub</a>
</li>
</ul>
</div>
</div>
Expand Down
9 changes: 6 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="None">

<meta name="description" content="A lightweight ORM library for Rust with strong-typed SQL DSL and sequence API.">
<meta name="author" content="Marcus Cvjeticanin">
<link rel="canonical" href="https://njord.rs/">
<link rel="shortcut icon" href="./img/favicon.ico">
<title>njord - A lightweight ORM library for Rust</title>
Expand Down Expand Up @@ -62,6 +62,9 @@
<i class="fa fa-search"></i> Search
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/mjovanc/njord/edit/master/docs/index.md"><i class="fa fa-github"></i> Edit on GitHub</a>
</li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -264,5 +267,5 @@ <h4 class="modal-title">Search</h4>

<!--
MkDocs version : 1.5.3
Build Date UTC : 2023-11-26 11:52:15.731834+00:00
Build Date UTC : 2023-11-26 11:56:03.837501+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! 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\"] } 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":"Home"},{"location":"#welcome-to-njord","text":"","title":"Welcome to njord!"},{"location":"#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":"","title":"SQlite"},{"location":"#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":"#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":"#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":"#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":"#drop-table","text":"To drop a table, it is a simple as: sqlite::drop_table(conn, &Posts::default());","title":"Drop table"},{"location":"#select","text":"Docs are coming soon...","title":"Select"},{"location":"#where","text":"","title":"WHERE"},{"location":"#order-by","text":"","title":"ORDER BY"},{"location":"#group-by","text":"","title":"GROUP BY"},{"location":"#limit","text":"","title":"LIMIT"},{"location":"#offset","text":"","title":"OFFSET"},{"location":"about/","text":"About njord is a lightweight ORM library for Rust with strong-typed SQL DSL and sequence API.","title":"About"},{"location":"about/#about","text":"njord is a lightweight ORM library for Rust with strong-typed SQL DSL and sequence API.","title":"About"},{"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! 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\"] } 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":"Home"},{"location":"#welcome-to-njord","text":"","title":"Welcome to njord!"},{"location":"#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":"","title":"SQlite"},{"location":"#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":"#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":"#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":"#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":"#drop-table","text":"To drop a table, it is a simple as: sqlite::drop_table(conn, &Posts::default());","title":"Drop table"},{"location":"#select","text":"Docs are coming soon...","title":"Select"},{"location":"#where","text":"","title":"WHERE"},{"location":"#order-by","text":"","title":"ORDER BY"},{"location":"#group-by","text":"","title":"GROUP BY"},{"location":"#limit","text":"","title":"LIMIT"},{"location":"#offset","text":"","title":"OFFSET"},{"location":"about/","text":"About njord is a lightweight ORM library for Rust with strong-typed SQL DSL and sequence API.","title":"About"},{"location":"about/#about","text":"njord is a lightweight ORM library for Rust with strong-typed SQL DSL and sequence API.","title":"About"}]}
5 changes: 0 additions & 5 deletions sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,4 @@
<lastmod>2023-11-26</lastmod>
<changefreq>daily</changefreq>
</url>
<url>
<loc>https://njord.rs/sqlite/</loc>
<lastmod>2023-11-26</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.
Loading

0 comments on commit 29a2016

Please sign in to comment.