Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete And Drop Statements #21

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Delete And Drop Statements #21

wants to merge 11 commits into from

Conversation

hassanelshazly
Copy link
Contributor

No description provided.

Copy link
Contributor Author

@hassanelshazly hassanelshazly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@abdomustafafouaad Great job ya Abdo 🎉
Please add compile/ and .cache/ to .gitignore
and execute git rm --cached compile/ .cache/

Comment on lines +140 to +154
if (nftw((m_base_path + "/" + table_name).c_str(),
//its an anonymous function and i dont know how to style it in our style
[](const char *pathname, const struct stat *sbuf, int type, struct FTW *ftwb) {
if(remove(pathname) < 0)
{
util::Logger::make().err("Error writing Metadata: %d", errno);
return -1;
}
return 0;
} ,
10,
FTW_DEPTH|FTW_MOUNT|FTW_PHYS) < 0)
{
util::Logger::make().err("Error writing Metadata: %d", errno);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about this styling

auto remove_fn = [](const char *pathname, const struct stat *sbuf, int type, struct FTW *ftwb) {
                    if(remove(pathname) < 0) {
                      util::Logger::make().err("Error couldn't remove %s: %d", pathname, errno);
                      return -1;
                    }
                    return 0;
                  };
  if (nftw((m_base_path + "/" + table_name).c_str(), remove_fn, 10,
            FTW_DEPTH|FTW_MOUNT|FTW_PHYS) < 0) {
    util::Logger::make().err("Error couldn't delete table : %d", table_name.c_str(), errno);  
  }     

dynamic_cast<lang::DropTableStatement *>(statement);
dorp_table_statement != nullptr) {
auto result = dorp_table_statement->execute(db);
std::cout << dorp_table_statement->m_table << std::endl;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove this now and change data members to private

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants