GeezerVison is showing github.com — Unable to add property with constraint · Issue #507 · ArcadeData/arcadedb
Unable to add property with constraint #507DescriptionArcadeDB Version: 22.8.1 (build b63f040/1659468151386/main)
JDK Version: Docker image - Open JDK JAVA_VERSION=jdk-11.0.13+8
OS: Docker image arcadedata/arcadedb:22.8.1
Expected behavior
Add property with constraint.
Actual behavior
The following error is raised when a constraint is included, including mandatory, notnull, and readonly.
<ArcadeDB_0> Error on command execution (PostCommandHandler)
com.arcadedb.exception.CommandSQLParsingException: com.arcadedb.query.sql.parser.ParseException: Encountered " <CREATE> "CREATE "" at line 2, column 1.
Was expecting one of:
<WHILE> ...
<IF> ...
<FOREACH> ...
";" ...
at com.arcadedb.query.sql.executor.SQLEngine.parseScript(SQLEngine.java:112)
at com.arcadedb.query.sql.executor.SQLEngine.parseScript(SQLEngine.java:104)
at com.arcadedb.database.EmbeddedDatabase.execute(EmbeddedDatabase.java:1237)
at com.arcadedb.server.ServerDatabase.execute(ServerDatabase.java:415)
at com.arcadedb.server.http.handler.PostCommandHandler.executeScript(PostCommandHandler.java:100)
at com.arcadedb.server.http.handler.PostCommandHandler.execute(PostCommandHandler.java:71)
at com.arcadedb.server.http.handler.DatabaseAbstractHandler.execute(DatabaseAbstractHandler.java:85)
at com.arcadedb.server.http.handler.AbstractHandler.handleRequest(AbstractHandler.java:109)
at io.undertow.server.RoutingHandler.handleRequest(RoutingHandler.java:93)
at io.undertow.server.handlers.PathHandler.handleRequest(PathHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:387)
at io.undertow.server.protocol.http.HttpReadListener.handleEventWithNoRunningRequest(HttpReadListener.java:256)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:136)
at io.undertow.server.protocol.http.HttpReadListener.handleEvent(HttpReadListener.java:59)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92)
at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.readReady(ReadReadyHandler.java:66)
at org.xnio.nio.NioSocketConduit.handleReady(NioSocketConduit.java:89)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:591)
Caused by: com.arcadedb.query.sql.parser.ParseException: Encountered " <CREATE> "CREATE "" at line 2, column 1.
Was expecting one of:
<WHILE> ...
<IF> ...
<FOREACH> ...
";" ...
at com.arcadedb.query.sql.parser.SqlParser.generateParseException(SqlParser.java:26767)
at com.arcadedb.query.sql.parser.SqlParser.jj_consume_token(SqlParser.java:26603)
at com.arcadedb.query.sql.parser.SqlParser.ParseScript(SqlParser.java:337)
at com.arcadedb.query.sql.executor.SQLEngine.parseScript(SQLEngine.java:110)
... 17 more
Steps to reproduce
Create new database and run the following in Studio using SQL Script mode.
CREATE VERTEX TYPE Thing;
CREATE PROPERTY Thing.text STRING mandatory = true;
Activitylvca commented on Sep 7, 2022 The right syntax is:
CREATE PROPERTY Thing.text STRING (mandatory true)
Did you see that syntax in some docs? forsakendaemon commented on Sep 7, 2022 Ah excellent, thank you! Yes, that's the syntax in the manual, I even copied the example directly from there (a DATE in that case). lvca commented on Sep 7, 2022 Found in the docs. Fixing the docs. I guess we modified that statement from OrientDB, no sure why. I'm wondering if it's better to update the docs or to change the syntax to be more compatible with OrientDB... lvca commented on Sep 7, 2022 @forsakendaemon I've double-checked OrientDB docs and it doesn't allow setting constraints in te create property SQL statement, but only with the alter property. In that case, the equals are not in the syntax, so I'm leaving everything like it is and just updating the docs. lvca commented on Sep 7, 2022 Ok, docs updated, the CI will publish them in max 10 minutes. @forsakendaemon thanks for reporting the issue.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|