# Introduction

GoooQo is a database access framework implemented in Go, based on OQM techniques. It relies entirely on objects to construct various database query statements, eliminating boilerplate code associated with traditional ORM frameworks, and assists developers in achieving automated database access operations.

The first three Os in the name GoooQo stands for the three major object concepts in OQM:

* `Entity Object` is used to map the static part in the SQL statements, such as the table name and column names;
* `Query Object` is used to map the dynamic part of the SQL statements, such as filter conditions, pagination, and sorting;
* `View Object` is used to map the static part in complex query statements, such as table names, column names, nested views, and the GROUP BY clause.

### The Dynamic Combination of Query Conditions ​&#x20;

A query interface with *n* query conditions can generate 2^n unique query requests by combining different parameter values to construct corresponding query statements.&#x20;

Similarly, an object with *n* fields has 2^n different assignment combinations.&#x20;

The 2^n assignment combinations of object instances are mapped exactly to 2^n combinations of query conditions.

OQM technology leverages this relationship and introduces the query object mapping method, where each field of the query object corresponds to a query condition, and query clauses are constructed based on field assignments.&#x20;

In this way, the logic of building query clauses can be separated from the logic of constructing query parameters and encapsulated as common functions in a framework, allowing developers to focus solely on the definition and assignment of query objects.

### The Definition of the Query​ Object

A basic query condition consists of a column name, a comparison operator, and a value. The fields in the entity correspond to the column names. When we use aliases to represent comparison operators and combine them with the fields in an entity object as suffixes, we get the fields of the query object. Therefore, we have the following formula:

$$
Entity + Suffix = Query
$$

Here is an example:

<figure><picture><source srcset="https://2953169758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcaxovyAjMzGHxhZgzo8F%2Fuploads%2Fr3OOJOtECfLkMdjOSORF%2Fimage.png?alt=media&#x26;token=bd070144-b366-4ec7-a0d4-c114b0d629ee" media="(prefers-color-scheme: dark)"><img src="https://2953169758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcaxovyAjMzGHxhZgzo8F%2Fuploads%2FYdPgvanlGOUBWvdn4L3R%2Fimage.png?alt=media&#x26;token=b996061d-d974-48fc-8202-45998b7545ef" alt=""></picture><figcaption><p>Entity + Suffix = Query</p></figcaption></figure>

### Community

Gitter: <https://gitter.im/doytowin/goooqo>

Discussion: <https://github.com/doytowin/goooqo/discussions>


---

# 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://goooqo.docs.doyto.win/readme.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.
