add files

This commit is contained in:
Nicholas Orlowsky 2023-08-02 23:14:46 -05:00 committed by Nicholas Orlowsky
commit 206ccb66ad
140 changed files with 367 additions and 0 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

8
.vscode/settings.json vendored Normal file
View file

@ -0,0 +1,8 @@
{
"rust-analyzer.linkedProjects": [
"./squirrel-server/Cargo.toml",
"./squirrel-client/Cargo.toml",
"./squirrel-server/Cargo.toml",
"./squirrel-server/Cargo.toml"
]
}

25
README.md Normal file
View file

@ -0,0 +1,25 @@
# SQUIRREL
SQL Query Util-Izing Rust's Reliable and Efficient Logic
---
## About
This is a SQL database written in Rust. It will be based off of (and hopefully be made wire-compatible with) PostgreSQL's syntax.
## Feature roadmap
[ ] Table creation via CREATE with varchar & integer datatype
[ ] SELECT * query
[ ] SELECT (filtered columns) query
[ ] Primary Keys via B+ Tree
[ ] Foreign Keys
[ ] Some form of JOINs
[ ] Support [Postgres' messaging system](https://www.postgresql.org/docs/current/protocol-flow.html#id-1.10.6.7.3) (wire compatability)
... other stuff is TBD

BIN
squirrel-client/.DS_Store vendored Normal file

Binary file not shown.

7
squirrel-client/Cargo.lock generated Normal file
View file

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "squirrel-client"
version = "0.1.0"

View file

@ -0,0 +1,8 @@
[package]
name = "squirrel-client"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]

View file

@ -0,0 +1,33 @@
use std::net::{TcpStream};
use std::io::{Read, Write};
use std::str::from_utf8;
use std::io;
fn main() {
match TcpStream::connect("localhost:5433") {
Ok(mut stream) => {
println!("Connected to Database");
loop {
print!("SQUIRREL: ");
io::stdout().flush().unwrap();
let mut msg_str = String::new();
std::io::stdin().read_line(&mut msg_str).unwrap();
let msg = msg_str.as_bytes();
stream.write(msg).unwrap();
let mut response_size_buffer = [0 as u8; 8];
stream.read_exact(&mut response_size_buffer).unwrap();
let response_size: usize = usize::from_le_bytes(response_size_buffer);
let mut response_buffer = vec![0 as u8; response_size];
stream.read_exact(&mut response_buffer).unwrap();
println!("{}", String::from_utf8(response_buffer).expect("a utf-8 string"));
}
},
Err(e) => {
println!("Failed to connect: {}", e);
}
}
}

View file

@ -0,0 +1 @@
{"rustc_fingerprint":15117991565403657335,"outputs":{"10376369925670944939":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n/Users/nickorlow/.rustup/toolchains/stable-x86_64-apple-darwin\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_feature=\"sse3\"\ntarget_feature=\"ssse3\"\ntarget_has_atomic=\"128\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"macos\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"apple\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.66.1 (90743e729 2023-01-10)\nbinary: rustc\ncommit-hash: 90743e7298aca107ddaa0c202a4d3604e29bfeb6\ncommit-date: 2023-01-10\nhost: x86_64-apple-darwin\nrelease: 1.66.1\nLLVM version: 15.0.2\n","stderr":""},"15697416045686424142":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.dylib\nlib___.dylib\nlib___.a\nlib___.dylib\n","stderr":""}},"successes":{}}

View file

@ -0,0 +1,3 @@
Signature: 8a477f597d28d172789f06886806bc55
# This file is a cache directory tag created by cargo.
# For information about cache directory tags see https://bford.info/cachedir/

View file

View file

@ -0,0 +1 @@
{"rustc":15960151841407381252,"features":"[]","target":5890690864744368165,"profile":17483045194147818835,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/squirrel-client-33fcc2abd5f16ea1/dep-bin-squirrel-client"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}

View file

@ -0,0 +1 @@
This file has an mtime of when this was started.

View file

@ -0,0 +1,2 @@
{"message":"unused import: `std::str::from_utf8`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/main.rs","byte_start":59,"byte_end":78,"line_start":3,"line_end":3,"column_start":5,"column_end":24,"is_primary":true,"text":[{"text":"use std::str::from_utf8;","highlight_start":5,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_imports)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove the whole `use` item","code":null,"level":"help","spans":[{"file_name":"src/main.rs","byte_start":55,"byte_end":79,"line_start":3,"line_end":3,"column_start":1,"column_end":25,"is_primary":true,"text":[{"text":"use std::str::from_utf8;","highlight_start":1,"highlight_end":25}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused import: `std::str::from_utf8`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:3:5\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m3\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0muse std::str::from_utf8;\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `#[warn(unused_imports)]` on by default\u001b[0m\n\n"}
{"message":"1 warning emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: 1 warning emitted\u001b[0m\n\n"}

View file

@ -0,0 +1 @@
{"rustc":15960151841407381252,"features":"[]","target":5890690864744368165,"profile":11736316127369858332,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/squirrel-client-7b0016b2ccfe1737/dep-bin-squirrel-client"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}

View file

@ -0,0 +1 @@
This file has an mtime of when this was started.

View file

@ -0,0 +1,2 @@
{"message":"unused import: `std::str::from_utf8`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/main.rs","byte_start":59,"byte_end":78,"line_start":3,"line_end":3,"column_start":5,"column_end":24,"is_primary":true,"text":[{"text":"use std::str::from_utf8;","highlight_start":5,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_imports)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove the whole `use` item","code":null,"level":"help","spans":[{"file_name":"src/main.rs","byte_start":55,"byte_end":79,"line_start":3,"line_end":3,"column_start":1,"column_end":25,"is_primary":true,"text":[{"text":"use std::str::from_utf8;","highlight_start":1,"highlight_end":25}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused import: `std::str::from_utf8`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:3:5\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m3\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0muse std::str::from_utf8;\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `#[warn(unused_imports)]` on by default\u001b[0m\n\n"}
{"message":"1 warning emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: 1 warning emitted\u001b[0m\n\n"}

View file

@ -0,0 +1 @@
This file has an mtime of when this was started.

View file

@ -0,0 +1,2 @@
{"message":"unused import: `std::str::from_utf8`","code":{"code":"unused_imports","explanation":null},"level":"warning","spans":[{"file_name":"src/main.rs","byte_start":59,"byte_end":78,"line_start":3,"line_end":3,"column_start":5,"column_end":24,"is_primary":true,"text":[{"text":"use std::str::from_utf8;","highlight_start":5,"highlight_end":24}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(unused_imports)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"remove the whole `use` item","code":null,"level":"help","spans":[{"file_name":"src/main.rs","byte_start":55,"byte_end":79,"line_start":3,"line_end":3,"column_start":1,"column_end":25,"is_primary":true,"text":[{"text":"use std::str::from_utf8;","highlight_start":1,"highlight_end":25}],"label":null,"suggested_replacement":"","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: unused import: `std::str::from_utf8`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:3:5\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m3\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0muse std::str::from_utf8;\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^^^^^^^^^^^^^^^\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `#[warn(unused_imports)]` on by default\u001b[0m\n\n"}
{"message":"1 warning emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: 1 warning emitted\u001b[0m\n\n"}

View file

@ -0,0 +1 @@
{"rustc":15960151841407381252,"features":"[]","target":5890690864744368165,"profile":11506243869495082934,"path":1684066648322511884,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/squirrel-client-f592498fe5f8f544/dep-test-bin-squirrel-client"}}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0}

View file

@ -0,0 +1,5 @@
/Users/nickorlow/programming/personal/SQUIRREL/squirrel-client/target/debug/deps/squirrel_client-33fcc2abd5f16ea1.rmeta: src/main.rs
/Users/nickorlow/programming/personal/SQUIRREL/squirrel-client/target/debug/deps/squirrel_client-33fcc2abd5f16ea1.d: src/main.rs
src/main.rs:

View file

@ -0,0 +1,5 @@
/Users/nickorlow/programming/personal/SQUIRREL/squirrel-client/target/debug/deps/squirrel_client-7b0016b2ccfe1737: src/main.rs
/Users/nickorlow/programming/personal/SQUIRREL/squirrel-client/target/debug/deps/squirrel_client-7b0016b2ccfe1737.d: src/main.rs
src/main.rs:

View file

@ -0,0 +1,5 @@
/Users/nickorlow/programming/personal/SQUIRREL/squirrel-client/target/debug/deps/squirrel_client-f592498fe5f8f544.rmeta: src/main.rs
/Users/nickorlow/programming/personal/SQUIRREL/squirrel-client/target/debug/deps/squirrel_client-f592498fe5f8f544.d: src/main.rs
src/main.rs:

Some files were not shown because too many files have changed in this diff Show more