Skip to content

Support for database transient variables #3201

Closed
Closed

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;

Activity

  1. self-assigned this
    on Jan 22, 2026
  2. added theissue type on Jan 22, 2026
  3. added this to the 26.2.1 milestone on Jan 22, 2026
  4. added a commit that references this issue on Jan 22, 2026
  5. lvca commented on Jan 22, 2026

    @lvca
    MemberAuthor

    Implemented under the new SQL parser (26.2.1)

  6. gramian commented on Jan 25, 2026

    @gramian
    Collaborator

    @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.

  7. lvca commented on Jan 26, 2026

    @lvca
    MemberAuthor

    That's a great idea. Does redis have transient records?

  8. gramian commented on Jan 26, 2026

    @gramian
    Collaborator

    Yes, Redis has transient and persistent (via h-prefixed commands) records. see (transient) set and https://docs.arcadedb.com/#redis-howworks . I think this would be a super tight integration.

  9. lvca commented on Jan 27, 2026

    @lvca
    MemberAuthor

    It's all in the latest commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions