[#6475] Added T-SQL support

This commit is contained in:
lukaseder 2019-01-11 09:41:35 +01:00
parent fb48bfa0c7
commit e40d4c9649
18 changed files with 205 additions and 71 deletions

View File

@ -51,10 +51,10 @@ proceduralStatement = [ label ]
query
| declareStatement
| assignmentStatement
| ifStatement
| loopStatement
| forStatement
| whileStatement
| ifStatement [ labelReference ]
| loopStatement [ labelReference ]
| forStatement [ labelReference ]
| whileStatement [ labelReference ]
| gotoStatement
| continueStatement
| exitStatement
@ -65,6 +65,9 @@ proceduralStatement = [ label ]
label = '<<' identifier '>>'
;
labelReference = identifier
;
blockStatement =
[ 'EXECUTE BLOCK AS' | 'DECLARE' ( declarationStatement ';' )+ ]
'BEGIN' proceduralStatements 'END'

View File

@ -1,64 +0,0 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Other licenses:
* -----------------------------------------------------------------------------
* Commercial licenses for this work are available. These replace the above
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
* database integrations.
*
* For more information, please visit: http://www.jooq.org/licenses
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package org.jooq;

View File

@ -44,6 +44,21 @@ package org.jooq;

View File

@ -61,6 +61,8 @@ package org.jooq;

View File

@ -85,6 +85,8 @@ package org.jooq;

View File

@ -42,6 +42,21 @@ package org.jooq;

View File

@ -227,9 +227,6 @@ final class BlockImpl extends AbstractQuery implements Block {

View File

@ -67,6 +67,23 @@ package org.jooq.impl;

View File

@ -9962,6 +9962,8 @@ public class DSL {

View File

@ -91,6 +91,15 @@ import static org.jooq.impl.DSL.field;

View File

@ -37,6 +37,25 @@
*/
package org.jooq.impl;
// ...

View File

@ -124,6 +124,40 @@ package org.jooq.impl;

View File

@ -68,6 +68,7 @@ final class Keywords {
static final Keyword K_BETWEEN = keyword("between");
static final Keyword K_BLOB = keyword("blob");
static final Keyword K_BOOLEAN = keyword("boolean");
static final Keyword K_BREAK = keyword("break");
static final Keyword K_BULK_COLLECT_INTO = keyword("bulk collect into");
static final Keyword K_BY = keyword("by");
static final Keyword K_CACHE = keyword("cache");

View File

@ -62,6 +62,15 @@ package org.jooq.impl;

View File

@ -56,6 +56,20 @@ package org.jooq.impl;

View File

@ -100,6 +100,51 @@ package org.jooq.impl;

View File

@ -2211,6 +2211,9 @@ final class ParserImpl implements Parser {
parseKeyword(ctx, "BEGIN");
statements.addAll(parseStatements(ctx, "END"));
parseKeyword(ctx, "END");
parse(ctx, ';');
return ctx.dsl.begin(statements);
}
@ -2569,6 +2572,8 @@ final class ParserImpl implements Parser {

View File

@ -72,6 +72,15 @@ package org.jooq.impl;