Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions engine/src/main/grammar/SQLGrammar.jjt
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ TOKEN:
|
<DELETE: ("d"|"D")("e"|"E")("l"|"L")("e"|"E")("t"|"T")("e"|"E")>
|
<DESCRIBE: ("d"|"D")("e"|"E")("s"|"S")("c"|"C")("r"|"R")("i"|"I")("b"|"B")("e"|"E")>
|
<DOCUMENT: ("d"|"D")("o"|"O")("c"|"C")("u"|"U")("m"|"M")("e"|"E")("n"|"N")("t"|"T")>
|
<VERTEX: ("v"|"V")("e"|"E")("r"|"R")("t"|"T")("e"|"E")("x"|"X")>
Expand Down Expand Up @@ -1100,6 +1102,8 @@ Statement StatementInternal():
result = CheckDatabaseStatement()
|
result = AlignDatabaseStatement()
|
result = DescribeDatabaseStatement()
)
)
|
Expand Down Expand Up @@ -4293,6 +4297,13 @@ AlignDatabaseStatement AlignDatabaseStatement():
{return jjtThis; }
}

DescribeDatabaseStatement DescribeDatabaseStatement():
{ }
{
<DESCRIBE> <DATABASE>
{return jjtThis; }
}

DefineFunctionStatement DefineFunctionStatement():
{
Token token;
Expand Down
3 changes: 3 additions & 0 deletions engine/src/main/java/com/arcadedb/GlobalConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ public Object call(final Object value) {
return value;
}),

DATABASE_DESCRIPTION("arcadedb.databaseDescription", SCOPE.DATABASE, "Message returned by the DESCRIBE DATABASE command", String.class,
"Welcome"),

DATE_TIME_FORMAT("arcadedb.dateTimeFormat", SCOPE.DATABASE, "Default date time format using Java SimpleDateFormat syntax",
String.class, "yyyy-MM-dd HH:mm:ss"),

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright © 2021-present Arcade Data Ltd (info@arcadedata.com)
*
* 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.
*
* SPDX-FileCopyrightText: 2021-present Arcade Data Ltd (info@arcadedata.com)
* SPDX-License-Identifier: Apache-2.0
*/
/* Generated By:JJTree: Do not edit this line. DescribeDatabaseStatement.java Version 4.3 */
/* JavaCCOptions:MULTI=true,NODE_USES_PARSER=false,VISITOR=true,TRACK_TOKENS=true,NODE_PREFIX=O,NODE_EXTENDS=,NODE_FACTORY=,SUPPORT_USERTYPE_VISIBILITY_PUBLIC=true */
package com.arcadedb.query.sql.parser;

import com.arcadedb.GlobalConfiguration;

import com.arcadedb.GlobalConfiguration;
import com.arcadedb.database.DatabaseInternal;
import com.arcadedb.query.sql.executor.CommandContext;
import com.arcadedb.query.sql.executor.InternalResultSet;
import com.arcadedb.query.sql.executor.ResultInternal;
import com.arcadedb.query.sql.executor.ResultSet;

import java.util.*;

public class DescribeDatabaseStatement extends SimpleExecStatement {
public DescribeDatabaseStatement(final int id) {
super(id);
}

@Override
public ResultSet executeSimple(final CommandContext context) {

final GlobalConfiguration description = GlobalConfiguration.findByKey("arcadedb.databaseDescription");
final ResultInternal result = new ResultInternal();
result.setProperty("result", context.getDatabase().getConfiguration().getValue(description));

final InternalResultSet rs = new InternalResultSet();
rs.add(result);
return rs;
}

@Override
public void toString(final Map<String, Object> params, final StringBuilder builder) {
builder.append("DESCRIBE DATABASE");
}
}
Loading