From 4cc61b741b7e7c47368ec341fbcad8c248f26218 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Thu, 4 Jan 2024 17:04:09 +0100 Subject: [PATCH 1/8] Add header row and column to API overview table --- src/main/asciidoc/api/chapter.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/asciidoc/api/chapter.adoc b/src/main/asciidoc/api/chapter.adoc index 09acae6d..da37b9f7 100644 --- a/src/main/asciidoc/api/chapter.adoc +++ b/src/main/asciidoc/api/chapter.adoc @@ -4,7 +4,7 @@ The power of a Multi-Model database is also in the way you can interact with it. ArcadeDB supports multiple languages, so it's easier to use it coming from other DBMS. -[cols=8] +[cols="h,1,1,1,1,1,1,1",options="header"] |=== | |<> From 1ed89b18ae8a7b8977ef6c065bf2a840400f8032 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Thu, 4 Jan 2024 17:05:49 +0100 Subject: [PATCH 2/8] Improve intro text of HTTP API Section --- src/main/asciidoc/api/http.adoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/asciidoc/api/http.adoc b/src/main/asciidoc/api/http.adoc index 21d5d4e3..d2b522f1 100644 --- a/src/main/asciidoc/api/http.adoc +++ b/src/main/asciidoc/api/http.adoc @@ -53,14 +53,14 @@ This is for example the case in the data argument (`-d`) of POST requests. ==== Server-Side Transactions ArcadeDB implements server-side transaction over HTTP stateless protocol by using sessions. -A session is created with the <> command and returns a session id in the response header (example `arcadedb-session-id: AS-ee056170-dc9b-4956-8d71-d7cfa01900d4`). -Use the session id in the request header of further commands you want to execute in the same transaction and execute <> to commit the server side transaction or <> to rollback the changes. +A session is created with the <> request and returns a session id in the response header (example `arcadedb-session-id: AS-ee056170-dc9b-4956-8d71-d7cfa01900d4`). +Use the session id in the request header of further commands you want to execute in the same transaction and request <> to commit the server side transaction or <> to rollback the changes. After a period of inactivity (default is 30 seconds, see <>), the server automatically rolls back and purges expired transactions. [discrete] ==== Transaction Scripts -In case <> (`sql`) is supposed to be used as language for a transactions, the language variant "SQL script" (`sqlscript`) is also available. +In case <> (`sql`) is supposed to be used as language for a transactions, the language variant <> (`sqlscript`) is also available. A `sqlscript` can consist of one or multiple SQL statements, which is collectively treated as a transaction. Hence, for such a batch of SQL statements, no `begin` and `commit` commands are necessary, since `begin` and `commit` implicitly enclose any `sqlscript` command. From bd0bc7f11fc364d868475bb070839dee0988f801 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Thu, 4 Jan 2024 17:06:50 +0100 Subject: [PATCH 3/8] Fix inline code in SQL comment description --- src/main/asciidoc/appendix/sql-syntax.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/asciidoc/appendix/sql-syntax.adoc b/src/main/asciidoc/appendix/sql-syntax.adoc index 4c480aa8..b621677a 100644 --- a/src/main/asciidoc/appendix/sql-syntax.adoc +++ b/src/main/asciidoc/appendix/sql-syntax.adoc @@ -9,7 +9,7 @@ This page lists all the details about its syntax. [[SQL-Comments]] **Comments** -Comments in the ArcadeDB SQL scripts can be C-Style block comments, which are enclosed by `/*` and `*/`, +Comments in the ArcadeDB SQL scripts can be C-Style block comments, which are enclosed by `+/*+` and `+*/+`, ```SQL /* This is a single-line comment */ @@ -18,7 +18,7 @@ Comments in the ArcadeDB SQL scripts can be C-Style block comments, which are en line comment */ ``` -as well as classic SQL end of line comments, started by ``-- `` (note the space after the two dashes), +as well as classic SQL end of line comments, started by ``--{nbsp}`` (note the space after the two dashes), ```SQL SELECT true; -- This is an end of line comment From ef800c4cb7191037ebdd39b51267b01b523c1150 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Thu, 4 Jan 2024 17:07:47 +0100 Subject: [PATCH 4/8] Add group argument to create user help --- src/main/asciidoc/tools/console.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/asciidoc/tools/console.adoc b/src/main/asciidoc/tools/console.adoc index 76437040..10a99b14 100644 --- a/src/main/asciidoc/tools/console.adoc +++ b/src/main/asciidoc/tools/console.adoc @@ -24,7 +24,7 @@ The console supports these direct commands (not evaluated by the query engine): | Database | CREATE DATABASE | DROP DATABASE | CHECK DATABASE | Schema | INFO TYPES | INFO TYPE | INFO TRANSACTION | Transaction | BEGIN | COMMIT | ROLLBACK -| Scripting | SET LANGUAGE | LOAD | `--` (COMMENT) +| Scripting | SET LANGUAGE | LOAD | `--` (Comment) |=== for which you can retrieve the following help by typing `HELP` or just `?`: @@ -37,7 +37,7 @@ close ||remote: -> closes the dat commit -> commits current transaction connect |local:|remote: -> connects to a database create database |remote: -> creates a new database -create user identified by [grant connect to *] -> creates a user +create user identified by [grant connect to [:]*] -> creates a user drop database |remote: -> deletes a database drop user -> deletes a user help|? -> ask for this help From 6d393564848c6a4d76414382f3766b77a87dabf3 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Thu, 4 Jan 2024 17:08:23 +0100 Subject: [PATCH 5/8] Fix link in Upgrade Section --- src/main/asciidoc/tools/upgrade.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/asciidoc/tools/upgrade.adoc b/src/main/asciidoc/tools/upgrade.adoc index 2d2dd926..3dc51006 100644 --- a/src/main/asciidoc/tools/upgrade.adoc +++ b/src/main/asciidoc/tools/upgrade.adoc @@ -9,7 +9,7 @@ The migration is completely automatic and transparent. ==== Steps 1. Download and extract a newer version of ArcadeDB in the local file system -2. Stop any ArcadeDB running servers (or close manually the database by using the HTTP command <>). +2. Stop any ArcadeDB running servers (or close manually the database by using the HTTP command "<>"). 3. Copy the databases directory from the old server to the new one 4. Start the new server From f7604f57c246c766e9bcfd9e29f7d94286002475 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Thu, 4 Jan 2024 17:08:54 +0100 Subject: [PATCH 6/8] Update version variable to 23.12.1 --- src/main/asciidoc/version.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/asciidoc/version.adoc b/src/main/asciidoc/version.adoc index 3c735ac4..81f0858e 100644 --- a/src/main/asciidoc/version.adoc +++ b/src/main/asciidoc/version.adoc @@ -1 +1 @@ -:revnumber: 23.11.1 \ No newline at end of file +:revnumber: 23.12.1 \ No newline at end of file From 1be0fc32b0701422771dbd7c6cfe6cbfa8b162ec Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Thu, 4 Jan 2024 17:10:00 +0100 Subject: [PATCH 7/8] Fix and improve inline code and code examples in filtering tables --- src/main/asciidoc/sql/SQL-Where.adoc | 80 ++++++++++++++-------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/src/main/asciidoc/sql/SQL-Where.adoc b/src/main/asciidoc/sql/SQL-Where.adoc index 4ae033e2..12b2712e 100644 --- a/src/main/asciidoc/sql/SQL-Where.adoc +++ b/src/main/asciidoc/sql/SQL-Where.adoc @@ -20,13 +20,13 @@ And `item` can be: [%header,cols=3] |=== |**What**|**Description**|**Example** -|field|Document field|where _price_ > 1000000 -|field<indexes>|Document field part. To know more about field part look at the full syntax: <>|where tags[name='Hi'] or tags[0...3] IN ('Hello') and employees IS NOT NULL -|record attribute|Record attribute name with @ as prefix|where _@type_ = 'Profile' +|field|Document field|`+WHERE price > 1000000+` +|field<indexes>|Document field part. To know more about field part look at the full syntax: <>|`+WHERE tags[name='Hi'] OR tags[0...3] IN ('Hello') AND employees IS NOT NULL+` +|record attribute|Record attribute name with `+@+` as prefix|`+WHERE @type = 'Profile'+` // |any()|Represents any field of the Document. The condition is true if ANY of the fields matches the condition|where _any()_ like 'L%' // |all()|Represents all the fields of the Document. The condition is true if ALL the fields match the condition|where _all()_ is null -| <> |Any <> between the defined ones|where distance(x, y, 52.20472, 0.14056 ) <= 30 -|<>|Context variable prefixed with $|where $depth <= 3 +| <> |Any <> between the defined ones|`+WHERE distance(x, y, 52.20, 0.14) <= 30+` +|<>|Context variable prefixed with `+$+`|`+WHERE $depth <= 3+` |=== [discrete] @@ -36,10 +36,10 @@ And `item` can be: [%header,cols=3] |=== |Name|Description|Example -|`@this`|returns the record itself|select *@this.toJSON()* from Account -|`@rid`|returns the <> in the form <bucket:position>. It's null for embedded records. _NOTE: using @rid in where condition slow down queries. Much better to use the <> as target. Example: change this: select from Profile where @rid = #10:44 with this: select from #10:44 |**@rid** = #11:0 -|`@size`|returns the record size in bytes|**@size** > 1024 -|`@type`|returns the record type between: 'document', 'column', 'flat', 'bytes'|**@type** = 'flat' +|`+@this+`|returns the record itself|`+SELECT @this.toJSON() FROM Account+` +|`+@rid+`|returns the <> in the form <bucket:position>. It's null for embedded records. _NOTE: using `+@rid+` in a where condition slows down queries. Much better to use the <> as target. Example: change `+SELECT FORM Profile WHERE @rid = #10:44+` to `+SELECT FROM #10:44+` |`+@rid = #11:0+` +|`+@size+`|returns the record size in bytes|`+@size > 1024+` +|`+@type+`|returns the record type between: 'document', 'column', 'flat', 'bytes'|`+@type = 'flat'+` |=== [discrete] @@ -53,26 +53,26 @@ And `item` can be: [%header,cols=4] |=== |Apply to|Operator|Description|Example -|any|`=` or `==`|Equal to|name *=* 'Luke' -|any|`+<=>+`|Null-safe equal to, is also true if left and right operands are `null`|name *+<=>+* word -|string|LIKE|Similar to equals, but allows the wildcards '%' that means "any characters" and '?' that means "any single character". LIKE is case sensitive.|name _LIKE_ 'Luk%' -|string|ILIKE|Similar to LIKE, but ILIKE is case insensitive.|name _ILIKE_ 'lUk%' -|any|`<`|Less than|age *<* 40 -|any|`<=`|Less or equal to|age *<=* 40 -|any|`>`|Greater than|age *>* 40 -|any|`>=`|Greater or equal to|age *>=* 40 -|any|`<>` or `!=`|Not equal to|age *<>* 40 -|any|BETWEEN|The value is between a range. It's equivalent to <field> >= <from-value> AND <field> <= <to-value>|price _BETWEEN_ 10 and 30 -|any|IS|Used to test if a value is NULL|children _IS_ null -|record, string (as type name)|INSTANCEOF|Used to check if the record extends a type|@this _INSTANCEOF_ 'Customer' or @type _INSTANCEOF_ 'Provider' -|collection|IN|contains any of the elements listed|name _IN_ ['European','Asiatic'] -|collection|CONTAINS|true if the collection contains at least one element that satisfy the next condition. Condition can be a single item: in this case the behaviour is like the IN operator|children _CONTAINS_ (name = 'Luke') - map.values() _CONTAINS_ (name = 'Luke') -|collection|CONTAINSALL|true if all the elements of the collection satisfy the next condition|children _CONTAINSALL_ (name = 'Luke') -|collection|CONTAINSANY|true if any the elements of the collection satisfy the next condition|children _CONTAINSANY_ (name = 'Luke') -|map|CONTAINSKEY|true if the map contains at least one key equals to the requested. You can also use map.keys() CONTAINS in place of it|connections _CONTAINSKEY_ 'Luke' -|map|CONTAINSVALUE|true if the map contains at least one value equals to the requested. You can also use map.values() CONTAINS in place of it|connections _CONTAINSVALUE_ 10:3 -|string|CONTAINSTEXT| When used against an indexed field, a lookup in the index will be performed with the text specified as key. When there is no index a simple Java indexOf will be performed. So the result set could be different if you have an index or not on that field |text _CONTAINSTEXT_ 'jay' -|string|MATCHES|Matches the string using a http://www.regular-expressions.info/[Regular Expression]|text _MATCHES_ `\b[A-Z0-9.%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b` +|any|`+=+` or `+==+`|Equal to|`+name = 'Luke'+` +|any|`+<=>+`|Null-safe equal to, is also true if left and right operands are `+NULL+`|`+name <=> word+` +|string|`+LIKE+`|Similar to equals, but allows the wildcards '`+%+`' that means "any characters" and '`+?+`' that means "any single character". `+LIKE+` is case sensitive.|`+name LIKE 'Luk%'+` +|string|`+ILIKE+`|Similar to `+LIKE+`, but `+ILIKE+` is case insensitive.|`+name ILIKE 'lUk%'+` +|any|`+<+`|Less than|`+age < 40+` +|any|`+<=+`|Less or equal to|`+age <= 40+` +|any|`+>+`|Greater than|`+age > 40+` +|any|`+>=+`|Greater or equal to|`+age >= 40+` +|any|`+<>+` or `+!=+`|Not equal to|`+age <> 40+` +|any|`+BETWEEN+`|The value is between a range. It's equivalent to `+ >= AND <= +`|`+price BETWEEN 10 AND 30+` +|any|`+IS+`|Used to test if a value is `+NULL+`|`+children IS NULL+` +|record, string (as type name)|`+INSTANCEOF+`|Used to check if the record extends a type|`+@this INSTANCEOF 'Customer' OR @type INSTANCEOF 'Provider'+` +|collection|`+IN+`|contains any of the elements listed|`+name IN ['European','Asiatic']+` +|collection|`+CONTAINS+`|true if the collection contains at least one element that satisfy the next condition. Condition can be a single item: in this case the behaviour is like the `+IN+` operator|`+children CONTAINS (name = 'Luke') - map.values() CONTAINS (name = 'Luke')+` +|collection|`+CONTAINSALL+`|true if all the elements of the collection satisfy the next condition|`+children CONTAINSALL (name = 'Luke')+` +|collection|`+CONTAINSANY+`|true if any the elements of the collection satisfy the next condition|children CONTAINSANY (name = 'Luke')+` +|map|`+CONTAINSKEY+`|true if the map contains at least one key equals to the requested. You can also use `+map.keys() CONTAINS+` in place of it|`+connections CONTAINSKEY 'Luke'+` +|map|`+CONTAINSVALUE+`|true if the map contains at least one value equals to the requested. You can also use `+map.values() CONTAINS+` in place of it|`+connections CONTAINSVALUE 10:3+` +|string|`+CONTAINSTEXT+`| When used against an indexed field, a lookup in the index will be performed with the text specified as key. When there is no index a simple Java `+indexOf+` will be performed. So the result set could be different if you have an index or not on that field |`+text CONTAINSTEXT 'jay'+` +|string|`+MATCHES+`|Matches the string using a http://www.regular-expressions.info/[Regular Expression]|`+text MATCHES `\b[A-Z0-9.%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b`+` |=== [discrete] @@ -82,9 +82,9 @@ And `item` can be: [%header,cols=3] |=== |Operator|Description|Example -|AND|true if both the conditions are true|name = 'Luke' *and* surname like 'Sky%' -|OR|true if at least one of the condition is true|name = 'Luke' *or* surname like 'Sky%' -|NOT|true if the condition is false. NOT needs parenthesis on the right with the condition to negate|**not** ( name = 'Luke') +|AND|true if both the conditions are true|`+name = 'Luke' AND surname LIKE 'Sky%'+` +|OR|true if at least one of the condition is true|`+name = 'Luke' OR surname LIKE 'Sky%'+` +|NOT|true if the condition is false. `+NOT+` needs parenthesis on the right with the condition to negate|`+NOT (name = 'Luke')+` |=== [discrete] @@ -116,12 +116,12 @@ ArcadeDB supports variables managed in the context of the command/query. By defa [%header,cols=3] |=== |Name |Description |Command(s) -|`$parent`|Get the parent context from a sub-query. Example: `select from V let $type = ( traverse * from $parent.$current.children )`|<> and <> -|`$current`|Current record to use in sub-queries to refer from the parent's variable|<> and <> -|`$depth`|The current depth of nesting|<> -|`$path`|The string representation of the current path. Example: `#6:0.in.#5:0#.out`. You can also display it with `select $path from (traverse * from V)`|<> -|`$stack`|The List of operation in the stack. Use it to access to the history of the traversal|<> -|`$history`|The set of all the records traversed as a `Set<RID>`|<> +|`+$parent+`|Get the parent context from a sub-query. Example: `+SELECT FROM V LET $type = (TRAVERSE * FROM $parent.$current.children)+`|<> and <> +|`+$current+`|Current record to use in sub-queries to refer from the parent's variable|<> and <> +|`+$depth+`|The current depth of nesting|<> +|`+$path+`|The string representation of the current path. Example: `+#6:0.in.#5:0#.out+`. You can also display it with `+SELECT $path FROM (TRAVERSE * FROM V)+`|<> +|`+$stack+`|The List of operation in the stack. Use it to access to the history of the traversal|<> +|`+$history+`|The set of all the records traversed as a `+Set+`|<> |=== To set custom variable use the <> keyword. @@ -133,8 +133,8 @@ To set custom variable use the <> keyword. [%header,cols=3] |=== |Symbol |Description |Example -|`%` |Matches all strings that contain an unknown substring of any length at the position of `%` |"%DB" "A%DB" "Arcade%" all match "ArcadeDB" -|`?` |Matches all strings that contain an unknown character at the position of `?` |"N?SQL" matches "NoSQL" but not "NewSQL" +|`+%+` |Matches all strings that contain an unknown substring of any length at the position of `+%+` |"%DB" "A%DB" "Arcade%" all match "ArcadeDB" +|`+?+` |Matches all strings that contain an unknown character at the position of `+?+` |"N?SQL" matches "NoSQL" but not "NewSQL" |=== Filtering for strings containing wildcards characters can be done by escaping with backslash, i.e. `\%`, `\?`. \ No newline at end of file From ea7b1b9ab1ac102d43739f7d43351236d1ceae72 Mon Sep 17 00:00:00 2001 From: Christian Himpe Date: Thu, 4 Jan 2024 17:23:49 +0100 Subject: [PATCH 8/8] More SQL Filtering literal fixes --- src/main/asciidoc/sql/SQL-Where.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/asciidoc/sql/SQL-Where.adoc b/src/main/asciidoc/sql/SQL-Where.adoc index 12b2712e..5b259d58 100644 --- a/src/main/asciidoc/sql/SQL-Where.adoc +++ b/src/main/asciidoc/sql/SQL-Where.adoc @@ -37,7 +37,7 @@ And `item` can be: |=== |Name|Description|Example |`+@this+`|returns the record itself|`+SELECT @this.toJSON() FROM Account+` -|`+@rid+`|returns the <> in the form <bucket:position>. It's null for embedded records. _NOTE: using `+@rid+` in a where condition slows down queries. Much better to use the <> as target. Example: change `+SELECT FORM Profile WHERE @rid = #10:44+` to `+SELECT FROM #10:44+` |`+@rid = #11:0+` +|`+@rid+`|returns the <> in the form `+bucket:position>+`. It is null for embedded records. _NOTE:_ using `+@rid+` in a where condition slows down queries. Much better to use the <> as target. Example: change `+SELECT FROM Profile WHERE @rid = #10:44+` to `+SELECT FROM #10:44+` |`+@rid = #11:0+` |`+@size+`|returns the record size in bytes|`+@size > 1024+` |`+@type+`|returns the record type between: 'document', 'column', 'flat', 'bytes'|`+@type = 'flat'+` |=== @@ -72,7 +72,7 @@ And `item` can be: |map|`+CONTAINSKEY+`|true if the map contains at least one key equals to the requested. You can also use `+map.keys() CONTAINS+` in place of it|`+connections CONTAINSKEY 'Luke'+` |map|`+CONTAINSVALUE+`|true if the map contains at least one value equals to the requested. You can also use `+map.values() CONTAINS+` in place of it|`+connections CONTAINSVALUE 10:3+` |string|`+CONTAINSTEXT+`| When used against an indexed field, a lookup in the index will be performed with the text specified as key. When there is no index a simple Java `+indexOf+` will be performed. So the result set could be different if you have an index or not on that field |`+text CONTAINSTEXT 'jay'+` -|string|`+MATCHES+`|Matches the string using a http://www.regular-expressions.info/[Regular Expression]|`+text MATCHES `\b[A-Z0-9.%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b`+` +|string|`+MATCHES+`|Matches the string using a http://www.regular-expressions.info/[Regular Expression]|`pass:[text MATCHES `\b[A-Z0-9.%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b`]` |=== [discrete]