Replies: 3 comments 6 replies
-
|
I really like this idea. They could be stored in RAM in a |
Beta Was this translation helpful? Give feedback.
-
|
Ok, few details for the implementation. This will be supported in the "sqlscript" only. Variables are not persistent and will be saved in a new property "variables" of type ConcurrentHashMap<String,Object> inside the LocalDatabase class. At closing of the database, the map is cleared. The variables must be reachable from the context, so the SQL and Cypher can access to them by using the $ prefix. Example: SET age = 34;
SELECT $ageShould return 34. There is no need for a get variable statement, you can return it with just a SELECT. Variables can be strings, numbers (saved as long), json/maps |
Beta Was this translation helpful? Give feedback.
-
|
Implemented: #3201 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Dear All,
I would like to suggest an addition to the SQL language, allowing to set global variables which are non-persistent.
I propose a like command:
which stores a variable
myvarin memory and is accessible by all SQL queries (maybe restricted to the same database?). To avoid collisions withLET-variable these need to be prefixed with something different than$, like@. After a restart, these variables are gone as they transient, just like the transiently stored key-value pairs in theRedismodule.Specifically, my purpose for those global variables is a locking mechanism preventing the same SQL script to be started multiple times concurrently without making this state persistent, in particularly being part of a database backup.
Notes:
RESETcommand is not necessary as one could justSETthe variable toNULL.SETmay collide with the console'sSETcommand.Beta Was this translation helpful? Give feedback.
All reactions