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

FormatLimit::FormatLimit(SqliteLimit *limit) :
    limit(limit)
{
}

void FormatLimit::formatInternal()
{
    if (limit->limit)
        withStatement(limit->limit);

    if (limit->offset)
    {
        if (limit->offsetKw)
            withKeyword("OFFSET");
        else
            withCommaOper();

        withStatement(limit->offset);
    }
}