Thanks to visit codestin.com
Credit goes to github.com

Skip to content

alexsander-projects/sql-app-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SQL App Rust

A Rust application that interacts with an MsSql database and displays the data on a web page.

Table of Contents

Introduction

This project demonstrates a simple Rust application that connects to an MsSql database, queries a table, and presents the information on a web page.

Architecture

The application consists of a basic web server built with the actix-web crate. Database interactions are handled using the tiberius crate. The web page displays a list of products retrieved from the database.

Application Architecture

Prerequisites

Before you begin, ensure you have the following installed:

  • Rust and Cargo
  • An MsSql database instance

Setup

  1. Configure Database Connection:
    • Locate the .env file in the project root.
    • Modify the database connection string to point to your MsSql instance.
  2. Database Schema and Data:
    • The SQL script script.sql contains the necessary commands to create the products table and populate it with sample data.
    • Execute this script in your MsSql database.

Running the Application

  1. Open your terminal in the project's root directory.
  2. Run the application using the command:
    cargo run
  3. Open your web browser and navigate to http://localhost:8080 to view the product list.

Web page displaying product list

Technologies Used

  • Rust
  • actix-web (for the web server)
  • tiberius (for MsSql database connection)
  • HTML (for rendering the web page)

About

A rust app that queries a sql database in Azure and shows the results in a web page

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published