# Database Access from Microflow

In **Database Access Management**, **Database Access from Microflow** refers to accessing and manipulating database data through **Microflows acting as services**.

ONEWEB provides **Database Nodes** within Microflows that allow data access to be exposed as **controlled, reusable micro‑services**, rather than direct database interactions.

This approach enables applications to centralize data access logic, enforce business rules, and maintain clear separation between **UI**, **process logic**, and **database layers**.

***

#### **Why Use Microflow for Database Access**

Accessing databases through Microflow provides several advantages:

* Data access logic is centralized and reusable
* Database operations are abstracted as services
* Business rules and validations are enforced consistently
* UI components remain decoupled from database queries
* Data access can be securely exposed to multiple channels

Microflow becomes the **gateway** through which data is accessed by Pages, Smart Forms, mobile apps, or external systems.

***

#### **Database Node in Microflow**

ONEWEB Microflow includes a **Database Node** that allows interaction with databases using standard operations:

* `SELECT` – retrieve data
* `INSERT` – create records
* `UPDATE` – modify records
* `DELETE` – remove records

The Database Node can be configured with:

* Database connection type
* SQL command or query definition
* Input and output parameters
* Business Objects for data mapping

This configuration enables Microflows to act as well‑defined database services.

***

#### **Typical Microflow Data Access Pattern**

A common pattern for database access using Microflow is:

1. A Page, Smart Form, or mobile app invokes a Microflow
2. The Microflow executes business logic
3. The **Database Node** performs the required database operation
4. Results are mapped to Business Objects
5. The Microflow returns data to the caller

This pattern supports **service‑oriented data access** across the application.

***

#### **Governance and Control**

From a **Data & Content Management** perspective, Microflow‑based database access ensures that:

* Data is accessed only through approved service paths
* All database interactions are traceable and auditable
* Security rules and access policies are enforced in one place
* Changes to data logic do not require UI modifications

This governance model reduces risk and improves maintainability as applications scale.

***

#### **When to Use Database Access from Microflow**

Using Microflow for database access is recommended when:

* Data access must be reused across multiple Pages or Apps
* Business logic must be enforced consistently
* Database operations are complex or multi‑step
* Integration with external systems is required
* Data should be exposed as a service

Microflow‑based access is the preferred approach for **enterprise‑grade applications**.

***

#### **Summary**

**Database Access from Microflow** enables ONEWEB applications to treat database operations as **structured services** rather than direct queries.

By leveraging Microflows and Database Nodes, applications can:

* Centralize and standardize data access
* Enforce business rules and governance
* Decouple UI from database implementation
* Support scalable and reusable service‑oriented architecture

This makes Microflow a cornerstone of effective **Database Access Management** and **Data & Content Management** in ONEWEB.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onewebstack.com/oneweb-platform-th/building-apps/data-and-content-management/database-access-management/database-access-from-microflow.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
