aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/SqlEnterpriseFormatter/formatdetach.cpp
blob: 412ecb522c5935bdd39b8689e2b7604ebbf76b5e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "formatdetach.h"
#include "parser/ast/sqlitedetach.h"
#include "parser/ast/sqliteexpr.h"

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

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

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

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