Skip to content

Database Transaction Feature #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
Aug 2, 2025

Conversation

esmaeelghasemi
Copy link

🛠️ Added Database Transaction Feature

This PR introduces a database transaction system that provides complete control over transactions with a flow similar to synchronous execution.

📋 Changes Overview

  • Added a Transaction clause to manage transactional operations.
  • Introduced a beginTransaction() method to start a new transaction context.
  • Added support for adding queries to the transaction using a unique name and query type (SELECT, INSERT, UPDATE, or DELETE).
  • Each query can also include a callback (closure) to handle the result.
  • After all queries are added, the compile() method executes them in sequence and handles their results.
  • If all queries execute successfully, the transaction is automatically committed, and the result of the last query is returned.
  • Queries are executed synchronously to ensure proper transaction control.

📦 Query Result Access

  • Query results are stored in a QueryResultCollection class.
  • The collection is injected into each query’s callback, allowing access to the results of all previous queries within the transaction.

@hasanparasteh hasanparasteh merged commit c3b9323 into SarafApp:main Aug 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy