ArcadeData / arcadedb

ArcadeDB Multi-Model Database, one DBMS that supports SQL, Cypher, Gremlin, HTTP/JSON, MongoDB and Redis. ArcadeDB is a conceptual fork of OrientDB, the first Multi-Model DBMS. ArcadeDB supports Vector Embeddings.
https://arcadedb.com
Apache License 2.0
486 stars 60 forks source link

Manual index parameter is non-functional #1610

Closed TimMensch closed 4 months ago

TimMensch commented 4 months ago

ArcadeDB Version:

v24.4.1 (build c714a4f5c827d742d6edd0f7788fe049bc63607b/1713579699346/main)

OS and JDK Version:

Running on Linux 5.15.146.1-microsoft-standard-WSL2 - OpenJDK 64-Bit Server VM 11.0.22 (Temurin-11.0.22+7)

Expected behavior

Examples from the manual shouldn't throw errors

Actual behavior

Pasting this code from the manual into the SQL Script field:

CREATE DOCUMENT TYPE Account;

CREATE PROPERTY Account.id LONG;
CREATE INDEX `Account[id]` ON Account (id) UNIQUE;

...throws on Account[id]. Either this should work or the examples should be updated to not have a manual index name. Error is of the form:

Cannot execute command Encountered <CREATE> "CREATE" at line 4, column 1. Was expecting one of: <WHILE> ... <IF> ... <FOREACH> ... ";" ... 

Error messages could be better as well.

gramian commented 4 months ago

This could be an error in the docs. Looking at the CREATE INDEX entry, it says custom names are only for manual indexes, but

CREATE INDEX `Account[id]` ON Account (id) UNIQUE;

is creating an automatic index. If this is so @lvca (?), I will update the docs.

gramian commented 4 months ago

Without manual index names it works as expected. I'll send a PR to the docs.

@TimMensch thanks for reporting this.

gramian commented 4 months ago

Fixed in docs by https://github.com/ArcadeData/arcadedb-docs/commit/51023aa78202c71d2e8372367587767ce99ddeb0 .