Skip to content

sails-disk does not support .transaction() method #7365

@DominusKelvin

Description

@DominusKelvin

Problem

The sails-disk adapter does not support the .transaction() method, which creates issues when developing applications that need transaction support.

Current Behavior

When attempting to use .transaction() with sails-disk:

await sails.getDatastore().transaction(async (db) => {
  // Transaction logic here
});

This fails because sails-disk lacks the .transaction() method implementation.

Expected Behavior

sails-disk should support the .transaction() method with pseudo transaction behavior, allowing the same transaction API to work consistently across development (sails-disk) and production (sails-postgresql, sails-mysql) environments.

Impact

  • Cannot test transaction-dependent code during development with sails-disk
  • Forces developers to use production adapters even for local development
  • Creates development/production parity issues

Proposed Solution

Implement a pseudo transaction method in sails-disk that:

  • Provides the same .transaction() API interface
  • Uses in-memory state management for rollback capability
  • Maintains transaction isolation within the adapter context

This would enable consistent development workflow while preserving sails-disk's lightweight nature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions