Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nitindahiya-dev/rust-sqlite-vault

Rust-based application that interacts with an SQLite database
https://github.com/nitindahiya-dev/rust-sqlite-vault

cli cli-app rust sqlite

Last synced: 1 day ago
JSON representation

Rust-based application that interacts with an SQLite database

Awesome Lists containing this project

README

        

# 🚀 Rust-SQLite-Vault

Welcome to **Rust-SQLite-Vault**! This repository contains a Rust-based application that interacts with an SQLite database. The project demonstrates efficient database handling, secure data storage, and seamless integration with Rust's powerful ecosystem.

![Rust Logo](https://www.rust-lang.org/static/images/rust-logo-blk.svg)

## 🌟 Introduction

**Rust-SQLite-Vault** is a project that aims to provide an example of how to use Rust with SQLite for secure and efficient data management. Whether you're a Rustacean or new to Rust, this repository offers valuable insights into using Rust's type system and performance advantages for database applications.

## ✨ Features

  • 🚀 **High Performance**: Leveraging Rust's speed and safety for database operations.

  • 🔒 **Security**: Safe and secure data handling.

  • 📦 **Easy Integration**: Simple setup and integration with SQLite.

  • 📜 **Comprehensive Documentation**: Detailed comments and documentation for ease of understanding.



  • ## 🛠️ Installation

    ### Prerequisites

    Ensure you have the following installed:

  • [Rust](https://www.rust-lang.org/learn/get-started)

  • [SQLite](https://www.sqlite.org/download.html)



  • ### Steps

    1. **Clone the Repository**

    ```sh
    git clone https://github.com/your-username/rust-sqlite-vault.git
    cd rust-sqlite-vault
    ```

    2. **Install Dependencies**

    ```sh
    cargo build
    ```

    3. **Run the Application**

    ```sh
    cargo run
    ```

    ## 🚀 Usage

    To use this application, follow the steps below:

    1. **Initialize Database**

    Run the application to initialize and set up your SQLite database.

    2. **Perform Operations**

    Use the provided functions to perform CRUD (Create, Read, Update, Delete) operations on the database.

    ### Example

    ```rust
    // Example Rust code to interact with the database
    use rusqlite::{params, Connection};

    fn main() -> Result<(), Box> {
    let conn = Connection::open("my_database.db")?;
    conn.execute(
    "CREATE TABLE IF NOT EXISTS user (id INTEGER PRIMARY KEY, name TEXT NOT NULL, age INTEGER NOT NULL)",
    params![],
    )?;
    conn.execute("INSERT INTO user (name, age) VALUES (?1, ?2)", params!["Alice", 30])?;
    Ok(())
    }