-
-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Milestone
Description
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 variable
SET GLOBAL myLock = true;
-- Access via $prefix
SELECT $myLock;
-- Use in WHERE clause
SET GLOBAL minAge = 18;
SELECT * FROM Users WHERE age > $minAge;
-- Remove by setting to NULL
SET GLOBAL myLock = NULL;Reactions are currently unavailable