You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement transient global variables for ArcadeDB SQL as requested in #3192.
Feature Summary:
- Command: SET GLOBAL varname = value;
- Storage: ConcurrentHashMap<String,Object> in LocalDatabase
- Access: Variables accessible via $varname in SQL and Cypher queries
- Scope: Database-scoped (cleared on restart, not transaction-scoped)
- Types: strings, numbers, JSON/maps, dates, datetime, booleans
- Precedence: Local query context variables take precedence over global variables
- Removal: Setting to NULL removes the variable
Usage Examples
-- Set a global variableSET GLOBAL myLock = true;
-- Access via $prefixSELECT $myLock;
-- Use in WHERE clauseSET GLOBAL minAge =18;
SELECT*FROM Users WHERE age > $minAge;
-- Remove by setting to NULLSET GLOBAL myLock =NULL;
@lvca should these global variables correspond to the Redis' module transient records? I mean: should these be the same, as either use a hash map? So, a global variable can be retrieed via the Redis commmand GET, and a transient Redis record becomes a global variable with the name of the key.
Activity
Support for database transient variables
lvca commentedon Jan 22, 2026
Implemented under the new SQL parser (26.2.1)
New SQL parser using ANTLR4 replacing of JavaCC (#3195)
gramian commentedon Jan 25, 2026
@lvca should these global variables correspond to the Redis' module transient records? I mean: should these be the same, as either use a hash map? So, a global variable can be retrieed via the Redis commmand
GET, and a transient Redis record becomes a global variable with the name of the key.lvca commentedon Jan 26, 2026
That's a great idea. Does redis have transient records?
gramian commentedon Jan 26, 2026
Yes, Redis has transient and persistent (via
h-prefixed commands) records. see (transient)setand https://docs.arcadedb.com/#redis-howworks . I think this would be a super tight integration.lvca commentedon Jan 27, 2026
It's all in the latest commits.
New SQL parser using ANTLR4 replacing of JavaCC (#3195)
New SQL parser using ANTLR4 replacing of JavaCC (ArcadeData#3195)