Skip to content
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

Documentation for OQL #8431

Open
wants to merge 70 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
8786adf
Documentation for OQL clauses
dahfjkg Oct 4, 2024
c1c38c6
Move to new OQL section of Domain Model
MarkvanMents Oct 14, 2024
3df814d
Proofread
MarkvanMents Oct 14, 2024
7369d45
Proofread
MarkvanMents Oct 14, 2024
239aebd
Proofread
MarkvanMents Oct 15, 2024
5b87de2
Proofread
MarkvanMents Oct 17, 2024
1dc3853
Resolve review comments
dahfjkg Oct 21, 2024
778804a
Proofread to Subqueries section.
MarkvanMents Oct 21, 2024
7f32144
Update content/en/docs/refguide/modeling/domain-model/oql/oql-clauses.md
dahfjkg Oct 21, 2024
63990a7
Better examples for GROUP BY and HAVING
dahfjkg Oct 21, 2024
f421fa9
Update content/en/docs/refguide/modeling/domain-model/oql/oql-clauses.md
dahfjkg Oct 25, 2024
578850c
Describe OQL v2 behavior changes
dahfjkg Oct 25, 2024
4d41982
review comments
dahfjkg Oct 25, 2024
7915620
More review comments and more OQL v2 changes
dahfjkg Oct 30, 2024
3752329
Spellcheck and Lint
MarkvanMents Nov 5, 2024
9afddc3
Proofread oql/_index
MarkvanMents Nov 5, 2024
04aec8a
Proofread oql-clauses
MarkvanMents Nov 5, 2024
2954bd3
Proofread OQL V2
MarkvanMents Nov 6, 2024
db0ae27
Address review comments
dahfjkg Nov 13, 2024
02ea327
Update content/en/docs/refguide/modeling/domain-model/oql/oql-clauses.md
dahfjkg Nov 13, 2024
a659675
Combine existing content into oql-expressions doc
pijuskri Oct 1, 2024
3272da6
Parameter example improvements
pijuskri Oct 1, 2024
8266592
Aggregate documentation
pijuskri Oct 2, 2024
2c3bcff
Aggregate documentation, examples
pijuskri Oct 3, 2024
b5ed1ff
Correct parameter examples, remove bad examples
pijuskri Oct 10, 2024
99756a5
Move oql-expressions to domain-model/oql
MarkvanMents Oct 16, 2024
0f48af2
Proofread oql-expressions
MarkvanMents Oct 16, 2024
0971e3a
Improve wording, change example order
pijuskri Oct 17, 2024
6b361e0
Add reference tag to aggregates section
pijuskri Oct 21, 2024
ef8215b
Align definition of expressions with oql clauses doc
pijuskri Oct 21, 2024
769e32c
Handle review comments
pijuskri Oct 31, 2024
0156528
Proofread and confirm review changes
MarkvanMents Nov 5, 2024
e4f7605
Combine functions and operators into a single file
pijuskri Oct 4, 2024
a1a5b6b
Operator structure, Plus, Minus
pijuskri Oct 7, 2024
a75a123
Binary operator examples, null handling, precedence, string coercion
pijuskri Oct 10, 2024
dcddfa0
Complete other binary operators
pijuskri Oct 11, 2024
e462d7c
Add literals, update COALESCE
pijuskri Oct 15, 2024
90f6118
Add section on system variables
pijuskri Oct 21, 2024
fdbeec6
Add function examples
pijuskri Oct 21, 2024
687d47d
Add range, cast examples
pijuskri Oct 22, 2024
f27592b
Move file to correct location
pijuskri Oct 22, 2024
9c2a09f
Handle review comments
pijuskri Oct 30, 2024
26f4c0c
Spelling and Markdown Review
MarkvanMents Nov 11, 2024
5921b2e
Proofread to 5.4
MarkvanMents Nov 11, 2024
32659c5
Proofread to COALESCE
MarkvanMents Nov 11, 2024
bb45d27
Finish Proofread of oql-expression-syntax
MarkvanMents Nov 12, 2024
5d45760
Address review comments for Expressions Syntax
dahfjkg Nov 13, 2024
981a82e
Address more review comments for Expressions Syntax
dahfjkg Nov 13, 2024
a43dfd1
Document data type validations of expressions in OQL v2
dahfjkg Nov 13, 2024
9c30053
Add links to OQL v2 validations to corresponding functions
dahfjkg Nov 13, 2024
dcb1cea
Correct examples with missing attribute aliases
pijuskri Nov 19, 2024
0a4d137
Add oql UNION clause documentation section
pijuskri Nov 20, 2024
4e2a5ea
Improve oql-v2 docs on alias requirements
pijuskri Nov 21, 2024
841634a
Typo
MarkvanMents Nov 26, 2024
689cf90
Merge branch 'development' into pr/dahfjkg/8431
MarkvanMents Nov 26, 2024
3dc9a9c
Merge branch 'dat/oql-clauses' of https://github.com/dahfjkg/docs int…
MarkvanMents Nov 26, 2024
eb6cb7c
Proofread
MarkvanMents Nov 26, 2024
f692c0e
Add example about UNION of associations
pijuskri Nov 26, 2024
d542cc6
Delete old OQL Clauses
MarkvanMents Nov 27, 2024
34bac48
Remove old OQL Expressions documentation
MarkvanMents Nov 27, 2024
e2acf96
rename data-sets document
MarkvanMents Nov 27, 2024
d74afff
Move Datasets into Data/Entities section
MarkvanMents Nov 27, 2024
6181931
Rename Domain Model section to Data
MarkvanMents Nov 27, 2024
a118e63
Move OQL in navigation.
MarkvanMents Nov 27, 2024
09f2483
Reorganize reserved words
MarkvanMents Nov 27, 2024
0d8ccec
Proofread
MarkvanMents Nov 27, 2024
fa52d8d
Mention that FLOAT is not to be used in OQL
dahfjkg Dec 5, 2024
833492b
More details on system variables in OQL
dahfjkg Dec 18, 2024
7200ba2
Change link to setting that enables OQL v2
dahfjkg Dec 18, 2024
edeaf73
Add more information on tokens in OQL
dahfjkg Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ invoice.location = { x: 400, y: 100 };

*Studio Pro Guide*

* [Domain Model](/refguide/domain-model/)
* [Data in the Domain Model](/refguide/domain-model/)
* [Entities](/refguide/entities/)

Metamodel reference guide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ To help you work with signature version 4 headers, the following sections of thi

#### Domain Model {#domain-model}

The domain model is a data model that describes the information in your application domain in an abstract way. For more information, see [Domain Model](/refguide/domain-model/).
The domain model is a data model that describes the information in your application domain in an abstract way. For more information, see [Data in the Domain Model](/refguide/domain-model/).

You can view the domain model in the **App Explorer** in the **AWS Authentication** > **Domain model** section. The following entities are relevant for signature version 4 headers authentication:

Expand Down Expand Up @@ -311,7 +311,7 @@ It takes the following parameters as input:
* A `Credentials` object
* A `ENUM_Region` enumeration value

The output is a boolean indicating whether the credentials are valid.
The output is a Boolean indicating whether the credentials are valid.

## Read More

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The technical purpose of GenAI Commons module is to define a common domain model

### Domain Model {#domain-model}

The domain model in Mendix is a data model that describes the information in your application domain in an abstract way. For more general information, see the [Domain Model](/refguide/domain-model/) documentation. To learn about where the entities from the domain model are used and relevant during implementation, see the [Microflows](#microflows) section below.
The domain model in Mendix is a data model that describes the information in your application domain in an abstract way. For more general information, see the [Data in the Domain Model](/refguide/domain-model/) documentation. To learn about where the entities from the domain model are used and relevant during implementation, see the [Microflows](#microflows) section below.

{{< figure src="/attachments/appstore/platform-supported-content/modules/genai/genaicommons/genai-commons-domain-model.png" alt="" >}}

Expand Down Expand Up @@ -250,7 +250,7 @@ An optional input object for the image generations operations to set optional re
| `Height` | This determines the height of the image. |
| `Width` | This determines the width of the image. |
| `NumberOfImages` | This determines the number of images to be generated. |
| `Seed` | This can be used to influence the randomness of the generation. Ensures the reproducability and consistency in the generated images by controlling the initial state of the random number generator. |
| `Seed` | This can be used to influence the randomness of the generation. Ensures the reproducibility and consistency in the generated images by controlling the initial state of the random number generator. |
| `CfgScale` | This can be used to influence the randomness of the generation. Adjusts the balance between adherence to the prompt and creative randomness in the image generation process. |
| `ImageGenerationType` | This describes the type of image generation. Currently only text to image is supported. For more information, see [ENUM_ImageGenerationType](#enum-imagegenerationtype). |

Expand Down Expand Up @@ -655,7 +655,7 @@ This Java action adds a new [KnowledgeBaseChunk](#knowledgebasechunk-entity) to
| `InputText` | String | mandatory | Input text to generate an embedding vector for. |
| `HumanReadableID` | String | mandatory | This is a front-end identifier that can be used for showing or retrieving sources in a custom way. If it is not relevant, "empty" must be passed explicitly here. |
| `MxObject` | Type parameter | optional | This parameter is used to capture the Mendix object to which the chunk refers. This can be used for finding back the record in the Mendix database later on after the retrieval step. |
| `MetadataCollection` | [MetadataCollection](#metadatacollection-entity) | optional | This is an optional MetadataCollection that contains extra information about the KnowledgeBaaseChunk. Any key-value pairs can be stored. In the retrieval operations it is possible to filter on one or multiple metadata key-value pairs. |
| `MetadataCollection` | [MetadataCollection](#metadatacollection-entity) | optional | This is an optional MetadataCollection that contains extra information about the KnowledgeBaseChunk. Any key-value pairs can be stored. In the retrieval operations it is possible to filter on one or multiple metadata key-value pairs. |

###### Return Value

Expand Down Expand Up @@ -703,7 +703,7 @@ This microflow creates a new [MetadataCollection](#metadatacollection-entity) an

| Name | Type | Mandatory | Description |
|--- |--- |--- |--- |
| `Key` | String | madatory | This is the name of the metadata and typically tells how the value should be interpreted. |
| `Key` | String | mandatory | This is the name of the metadata and typically tells how the value should be interpreted. |
| `Value` | String | mandatory | This is the value of the metadata that provides additional information about the chunk in the context of the given key. |

###### Return Value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ To help you work with the SAP Event Mesh connector, the following sections of th

### Domain Model {#domain-model}

The domain model is a data model that describes the information in your application domain in an abstract way. For more information, see [Domain Model](/refguide/domain-model/).
The domain model is a data model that describes the information in your application domain in an abstract way. For more information, see [Data in the Domain Model](/refguide/domain-model/).

The entities in the table below describe all generalizations. These are reused by the different models for the specific microflow activities or for storing connection details.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ This documentation describes two different domain models.

2. The OData Connector for SAP solutions Domain Model – this contains entities which are used by the OData Connector for SAP solutions itself: for example, to construct the request which needs to be sent to the OData service. A description of this domain model is included for completeness in the section [OData Connector for SAP Solutions Domain Model](#ConnectorDM)

For more information on domain models, see [Domain Model](/refguide/domain-model/).
For more information on domain models, see [Data in the Domain Model](/refguide/domain-model/).

#### SAP Service Domain Model

Expand Down Expand Up @@ -868,7 +868,7 @@ This domain model is part of the OData Connector for SAP solutions module and ca

* [Attributes](/refguide/attributes/)
* [Data Types](/refguide/data-types/)
* [Domain Model](/refguide/domain-model/)
* [Data in the Domain Model](/refguide/domain-model/)
* [Entities](/refguide/entities/)
* [SAP Cloud Connector](/developerportal/deploy/sap-cloud-platform/sap-cloud-connector/)
* [SAP Help Portal](https://help.sap.com)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ To help you work with the Snowflake REST SQL connector, the following sections o

### Domain Model {#domain-model}

The domain model is a data model that describes the information in your application domain in an abstract way. For more information, see [Domain Model](/refguide/domain-model/).
The domain model is a data model that describes the information in your application domain in an abstract way. For more information, see [Data in the Domain Model](/refguide/domain-model/).

#### ConnectionDetails {#connection-details}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ The Data Model module contains up to four resources which help to consume the OD

#### Domain Model

Each Mendix SAP data model has a domain model that describes the information in the OData service. The domain model consists of entities and their relations represented by associations. For more information, see [Domain Model](/refguide/domain-model/).
Each Mendix SAP data model has a domain model that describes the information in the OData service. The domain model consists of entities and their relations represented by associations. For more information, see [Domain Model].

{{< figure src="/attachments/appstore/platform-supported-content/services/sap-model-creator/sap-service-example.png" class="no-border" >}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ weight: 35
---
## Introduction

Kubernetes allows to update an app without downtime by [performing a rolling update](https://kubernetes.io/docs/tutorials/kubernetes-basics/update/update-intro/). Instead of stopping an app and then starting it with an updated version or configuration, Kubernetes can replace pods (replicas) one by one with an updated version. Existing pods handle requests until the newer version is fully started. Any changes in the [domain model](/refguide/domain-model/) need a database (schema) update. While the update process runs, you cannot modify any persistent entities.
Kubernetes allows to update an app without downtime by [performing a rolling update](https://kubernetes.io/docs/tutorials/kubernetes-basics/update/update-intro/). Instead of stopping an app and then starting it with an updated version or configuration, Kubernetes can replace pods (replicas) one by one with an updated version. Existing pods handle requests until the newer version is fully started. Any changes in the [Data in the Domain Model](/refguide/domain-model/) need a database (schema) update. While the update process runs, you cannot modify any persistent entities.

The Private Cloud Operator uses a [recreate](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#recreate-deployment) strategy by default. That is, the current version (configuration) of an app stops, and then the new version starts. Alternatively, the Private Cloud Operator can use a **PreferRolling** strategy. That is, the Operator tries to perform a rolling update whenever possible. If the Operator detects that a database schema update is needed, it switches to a Recreate strategy to perform a full restart. If the new version of the app has model changes, deploying it requires a schema update. In this case, the Private Cloud Operator automatically stops all replicas of the app, causing downtime.

Expand Down Expand Up @@ -44,9 +44,9 @@ The following changes in the UI can be done without downtime, but as soon as the

* Page changes, including layout or CSS changes
* Changes in nanoflows or microflow parameters, if the microflow is used on a page
* Changes in Javascript actions
* Changes in JavaScript actions

Thes following changes will be deployed with downtime, because the model must be updated:
The following changes will be deployed with downtime, because the model must be updated:

* Adding Marketplace modules that have persistent entities
* Updating the object model in the app itself, or its Marketplace modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Errors need to be solved before your app can be deployed. A consistency error ca
* [Navigation](/refguide/consistency-errors-navigation/)
* [Microflows](/refguide/microflows/)
* [Workflows](/refguide/workflows/)
* [Domain Model](/refguide/domain-model/)
* [Data in the Domain Model](/refguide/domain-model/)
* [Integration](/refguide/integration/)
* [Security](/refguide/security/)

Expand Down
4 changes: 2 additions & 2 deletions content/en/docs/refguide/modeling/domain-model/_index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "Domain Model"
linktitle: "Domain Model (Data)"
title: "Data in the Domain Model"
linktitle: "Data (Domain Model)"
url: /refguide/domain-model/
weight: 30
description: "Introduces the domain model in Studio Pro."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Datasets"
url: /refguide/data-sets/
weight: 50
weight: 80
#If moving or renaming this doc file, implement a temporary redirect and let the respective team know they should update the URL in the product. See Mapping to Products for more details.
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Indexes are ordered, which means that when you create an index on two or more at

### Indexes on System Members

If you choose to store an entity's `owner` and `changedBy` system members, an index is created. This is not so for the `createdDate` and `changedDate` system members. In addition, an index is created for the automatically generated attribute `id`. See [Domain Model](/refguide/domain-model/) for more information about the implementation of these attributes.
If you choose to store an entity's `owner` and `changedBy` system members, an index is created. This is not so for the `createdDate` and `changedDate` system members. In addition, an index is created for the automatically generated attribute `id`. See [Data in the Domain Model](/refguide/domain-model/) for more information about the implementation of these attributes.

### Indexes on Non-Persistable Entities

Expand Down
77 changes: 77 additions & 0 deletions content/en/docs/refguide/modeling/domain-model/oql/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: "OQL"
url: /refguide/oql/
weight: 90
---

## Introduction

The Mendix Object Query Language (OQL) is a relational query language inspired by [SQL](https://en.wikipedia.org/wiki/Sql). The major advantage of OQL is that it uses Mendix entity and association names instead of actual database table names. In that way, it is possible to create queries that use names from the data model of your Mendix app without thinking about how that data model is represented in the database.

In addition, OQL can use predefined relations (associations) to easily join objects without having to calculate which columns should be coupled. Despite these differences, many SQL keywords also work in OQL.

Some examples of OQL queries are:

* `SELECT LastName FROM Sales.Customer` – retrieves the family names of all customers
* `SELECT FirstName FROM Sales.Customer WHERE LastName = 'Jansen'` – retrieves the given name of all customers with family name "Jansen"
* `SELECT SUM(TotalAmount) FROM Sales."Order" WHERE IsPaid = true` – retrieves the sum of the total amount on all paid orders (`Order` needs to be wrapped in quotes, see the [Reserved Words](#reserved-oql-words) section below)

{{% alert color="info" %}}
OQL queries do not take security into account out-of-the-box. This means that you can use OQL to manually define custom security expressions. In some cases, handling security yourself using OQL—instead of using the out-of-the-box security of XPath—may result in faster queries.
{{% /alert %}}

{{% alert color="info" %}}
You can try your OQL example online in the [OQL Playground](https://service.mendixcloud.com/p/OQL) demo app.
{{% /alert %}}

## Reserved Words {#reserved-oql-words}

Words with a specific purpose in OQL are reserved. If you use reserved words for entity, variable, or attribute names in an OQL query, they must be wrapped in double quotes `" "`. For example, in the OQL query `SELECT AVG(TotalPrice) FROM Sales."Order" WHERE IsPaid = 1`, `Order` needs to be wrapped in quotes because it is a reserved word, as it can be used to `ORDER BY`.

Here is a list of all OQL reserved words:
dahfjkg marked this conversation as resolved.
Show resolved Hide resolved

`ALL`, `AND`, `AS`, `ASC`, `AVG`

`BOOLEAN`, `BY`

`CASE`, `CAST`, `COUNT`

`DATEDIFF`, `DATEPART`, `DATETIME`, `DAY`, `DAYOFYEAR`, `DECIMAL`, `DESC`, `DISTINCT`

`ELSE`, `END`, `EXISTS`

`FALSE`, `FLOAT`, `FROM`, `FULL`

`GROUP`

`HAVING`, `HOUR`

`IN`, `INNER`, `INTEGER`, `IS`

`JOIN`

`LEFT`, `LIKE`, `LIMIT`, `LONG`

`MAX`, `MILLISECOND`, `MIN`, `MINUTE`, `MONTH`

`NOT`, `NULL`

`OFFSET`, `ON`, `OR`, `ORDER`, `OUTER`

`QUARTER`

`RIGHT`

`SECOND`, `SELECT`, `STRING`, `SUM`

`THEN`, `TRUE`

`UNION`

`WEEK`, `WEEKDAY`, `WHEN`, `WHERE`

`YEAR`

{{% alert color="info" %}}
Mendix does not support Float data type since version 8. In OQL, `FLOAT` is a reserved word for legacy reasons. It should not be used.
{{% /alert %}}
Loading