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

Skip to content

jamespepplinkhouse/rust-api-sqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rust-api-sqlite

Overview

I made this in 20 minutes or so by asking ChatGPT-4 things like:

  • Write me a high performance REST api server in rust code
  • How do I add sqlite support to read users from a database

Getting Started

$ ./scripts/create-db.sh
$ cargo run
  • Optionally, use a DB tool like DBeaver to add some rows to the DB (users.db)
  • Open http://127.0.0.1:8080/user/1 in a browser
  • Be amazed that it returns data from SQLite in <5 ms! (on my Macbook Pro M2) :-D

To build in release mode:

$ cargo build --release
$ ./target/release/rust-api-sqlite

Tips

If you run into trouble:

  • Ask ChatGPT to explain the code
  • Ask ChatGPT to solve compiler errors/warnings

About

An example repo trying out Rust and SQLite by pairing with ChatGPT-4!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published