Skip to content

Support for database transient variables #3201

@lvca

Description

@lvca

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;

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions