stellarsql / StellarSQL

🚧 (Archived) StellarSQL: a minimal SQL DBMS written in Rust
https://stellarsql.github.io/StellarSQL/stellar_sql/
MIT License
86 stars 16 forks source link

Feature/file storage #2

Closed tom6311tom6311 closed 5 years ago

tom6311tom6311 commented 5 years ago

Brief

Features:

  1. Design storage directory hierarchy. Example here
  2. Map storage hierarchy to Rust structs, Including:
    • Mapping to .json files: UsernamesJson, DbsJson, TablesJson
    • Mapping to elements inside json files: UsernameInfo, DbInfo, TableInfo
  3. Functions for username-level operations:
    • File::create_username, File::get_usernames, File::remove_username
  4. Functions for db-level operations:
    • File::create_db, File::get_dbs, File::remove_db
  5. Design test cases for each member functions of File
  6. Specify Input / Output spec of TODO functions
    • File::create_table, File::load_tables, File::append_rows, File::fetch_rows, File::delete_rows, File::modify_row
todo[bot] commented 5 years ago

create_table(username: &str, db_name: &str, table: &TableInfo, file_base_path: Option<&str>) -> Result<(), FileError>

https://github.com/tigercosmos/StellarSQL/blob/3dd1f9799c439242ee6b8e590fc4f2df23712043/src/storage/file.rs#L367-L372


This comment was generated by todo based on a TODO comment in 3dd1f9799c439242ee6b8e590fc4f2df23712043 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

load_tables(username: &str, db_name: &str, file_base_path: Option<&str>) -> Result<Vec<TableInfo>, FileError>

https://github.com/tigercosmos/StellarSQL/blob/3dd1f9799c439242ee6b8e590fc4f2df23712043/src/storage/file.rs#L369-L374


This comment was generated by todo based on a TODO comment in 3dd1f9799c439242ee6b8e590fc4f2df23712043 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

append_rows(username: &str, db_name: &str, table_name: &str, rows: &Vec<Row>, file_base_path: Option<&str>) -> Result<Vec<u32>, FileError>

https://github.com/tigercosmos/StellarSQL/blob/3dd1f9799c439242ee6b8e590fc4f2df23712043/src/storage/file.rs#L371-L376


This comment was generated by todo based on a TODO comment in 3dd1f9799c439242ee6b8e590fc4f2df23712043 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

fetch_rows(username: &str, db_name: &str, table_name: &str, row_id_range: &Vec<u32>, file_base_path: Option<&str>) -> Result<Vec<Row>, FileError>

https://github.com/tigercosmos/StellarSQL/blob/3dd1f9799c439242ee6b8e590fc4f2df23712043/src/storage/file.rs#L373-L378


This comment was generated by todo based on a TODO comment in 3dd1f9799c439242ee6b8e590fc4f2df23712043 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

delete_rows(username: &str, db_name: &str, table_name: &str, row_id_range: &Vec<u32>, file_base_path: Option<&str>) -> Result<(), FileError>

https://github.com/tigercosmos/StellarSQL/blob/3dd1f9799c439242ee6b8e590fc4f2df23712043/src/storage/file.rs#L375-L380


This comment was generated by todo based on a TODO comment in 3dd1f9799c439242ee6b8e590fc4f2df23712043 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

modify_row(username: &str, db_name: &str, table_name: &str, row_id: u32, new_row: &Row, file_base_path: Option<&str>) -> Result<(), FileError>

https://github.com/tigercosmos/StellarSQL/blob/3dd1f9799c439242ee6b8e590fc4f2df23712043/src/storage/file.rs#L377-L382


This comment was generated by todo based on a TODO comment in 3dd1f9799c439242ee6b8e590fc4f2df23712043 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

create_table(username: &str, db_name: &str, table: &TableInfo, file_base_path: Option<&str>) -> Result<(), FileError>

https://github.com/tigercosmos/StellarSQL/blob/bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7/src/storage/file.rs#L358-L363


This comment was generated by todo based on a TODO comment in bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

load_tables(username: &str, db_name: &str, file_base_path: Option<&str>) -> Result<Vec<TableInfo>, FileError>

https://github.com/tigercosmos/StellarSQL/blob/bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7/src/storage/file.rs#L360-L365


This comment was generated by todo based on a TODO comment in bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

append_rows(username: &str, db_name: &str, table_name: &str, rows: &Vec<Row>, file_base_path: Option<&str>) -> Result<Vec<u32>, FileError>

https://github.com/tigercosmos/StellarSQL/blob/bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7/src/storage/file.rs#L362-L367


This comment was generated by todo based on a TODO comment in bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

fetch_rows(username: &str, db_name: &str, table_name: &str, row_id_range: &Vec<u32>, file_base_path: Option<&str>) -> Result<Vec<Row>, FileError>

https://github.com/tigercosmos/StellarSQL/blob/bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7/src/storage/file.rs#L364-L369


This comment was generated by todo based on a TODO comment in bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

delete_rows(username: &str, db_name: &str, table_name: &str, row_id_range: &Vec<u32>, file_base_path: Option<&str>) -> Result<(), FileError>

https://github.com/tigercosmos/StellarSQL/blob/bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7/src/storage/file.rs#L366-L371


This comment was generated by todo based on a TODO comment in bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

modify_row(username: &str, db_name: &str, table_name: &str, row_id: u32, new_row: &Row, file_base_path: Option<&str>) -> Result<(), FileError>

https://github.com/tigercosmos/StellarSQL/blob/bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7/src/storage/file.rs#L368-L373


This comment was generated by todo based on a TODO comment in bb4cc790f9e84eb9d52b98da110c4e9f20c9bdb7 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

create_table(username: &str, db_name: &str, table: &TableInfo, file_base_path: Option<&str>) -> Result<(), FileError>

https://github.com/tigercosmos/StellarSQL/blob/0ca59a110dc62d2d7e10e590a2720353c93513d4/src/storage/file.rs#L357-L362


This comment was generated by todo based on a TODO comment in 0ca59a110dc62d2d7e10e590a2720353c93513d4 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

load_tables(username: &str, db_name: &str, file_base_path: Option<&str>) -> Result<Vec<TableInfo>, FileError>

https://github.com/tigercosmos/StellarSQL/blob/0ca59a110dc62d2d7e10e590a2720353c93513d4/src/storage/file.rs#L359-L364


This comment was generated by todo based on a TODO comment in 0ca59a110dc62d2d7e10e590a2720353c93513d4 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

append_rows(username: &str, db_name: &str, table_name: &str, rows: &Vec<Row>, file_base_path: Option<&str>) -> Result<Vec<u32>, FileError>

https://github.com/tigercosmos/StellarSQL/blob/0ca59a110dc62d2d7e10e590a2720353c93513d4/src/storage/file.rs#L361-L366


This comment was generated by todo based on a TODO comment in 0ca59a110dc62d2d7e10e590a2720353c93513d4 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

fetch_rows(username: &str, db_name: &str, table_name: &str, row_id_range: &Vec<u32>, file_base_path: Option<&str>) -> Result<Vec<Row>, FileError>

https://github.com/tigercosmos/StellarSQL/blob/0ca59a110dc62d2d7e10e590a2720353c93513d4/src/storage/file.rs#L363-L368


This comment was generated by todo based on a TODO comment in 0ca59a110dc62d2d7e10e590a2720353c93513d4 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

delete_rows(username: &str, db_name: &str, table_name: &str, row_id_range: &Vec<u32>, file_base_path: Option<&str>) -> Result<(), FileError>

https://github.com/tigercosmos/StellarSQL/blob/0ca59a110dc62d2d7e10e590a2720353c93513d4/src/storage/file.rs#L365-L370


This comment was generated by todo based on a TODO comment in 0ca59a110dc62d2d7e10e590a2720353c93513d4 in #2. cc @tom6311tom6311.
todo[bot] commented 5 years ago

modify_row(username: &str, db_name: &str, table_name: &str, row_id: u32, new_row: &Row, file_base_path: Option<&str>) -> Result<(), FileError>

https://github.com/tigercosmos/StellarSQL/blob/0ca59a110dc62d2d7e10e590a2720353c93513d4/src/storage/file.rs#L367-L372


This comment was generated by todo based on a TODO comment in 0ca59a110dc62d2d7e10e590a2720353c93513d4 in #2. cc @tom6311tom6311.