#include "formatdetach.h"
#include "parser/ast/sqlitedetach.h"
#include "parser/ast/sqliteexpr.h"

FormatDetach::FormatDetach(SqliteDetach* detach) :
    FormatStatement(detach), detach(detach)
{
}

void FormatDetach::formatInternal()
{
    handleExplainQuery(detach);
    withKeyword("DETACH");

    if (detach->databaseKw)
        withKeyword("DATABASE");

    withStatement(detach->name).withSemicolon();
}
