aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/SqlEnterpriseFormatter/formatdropview.cpp
blob: a8160e90c7ddf0569e0e9605ca3062188b62d064 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "formatdropview.h"
#include "parser/ast/sqlitedropview.h"

FormatDropView::FormatDropView(SqliteDropView* dropView) :
    dropView(dropView)
{
}

void FormatDropView::formatInternal()
{
    handleExplainQuery(dropView);
    withKeyword("DROP").withKeyword("VIEW");

    if (dropView->ifExistsKw)
        withKeyword("IF").withKeyword("EXISTS");

    if (!dropView->database.isNull())
        withId(dropView->database).withIdDot();

    withId(dropView->view).withSemicolon();
}