Class Transaction

Class used to handle CubicWeb's transactions. A transaction allows to execute several RQL requests without altering the database until all changes are committed.

You should never have to create this object yourself. Instead, retrieve this object from the methods in the Client class.

Hierarchy

  • Transaction

Constructors

Accessors

Methods

Constructors

  • Class used to handle CubicWeb's transactions. A transaction allows to execute several RQL requests without altering the database until all changes are committed.

    You should never have to create this object yourself. Instead, retrieve this object from the methods in the Client class.

    Parameters

    • api: default

      The API object used to communicate with the CubicWeb backend.

    Returns Transaction

Accessors

  • get uuid(): null | string
  • This transaction unique identifier.

    Returns null | string

Methods

  • Begins a new transaction an retrieves the associated uuid.

    Returns Promise<void>

  • Commits the transaction to apply all the RQL queries sent with execute.

    Returns Promise<void>

  • Executes the given query and waits for the response. Make sure you called begin before using this method. As this is a transaction changes will only be applied when you call the commit method.

    Returns

    A promise with the request's result set

    Parameters

    • query: string

      The RQL query to send

    • params: RQLParams = {}

      The additional parameters for the request

    Returns Promise<null | ResultSet>

  • Returns

    True if the connection is closed.

    Returns boolean

  • Rollbacks all the queries sent with execute and closes the transaction.

    Returns Promise<void>

Generated using TypeDoc