@onzag/itemize / Modules / base/Root/Module/ItemDefinition/Include/sql
This file contains utility functionality that is necessary in order to setup includes into and out of the postgresql database as well as how to build the definition for the tables
- buildElasticQueryForInclude
- buildSQLQueryForInclude
- convertRQValueToSQLValueForInclude
- convertSQLValueToElasticSQLValueForInclude
- convertSQLValueToRQValueForInclude
- getElasticSchemaForInclude
- getSQLTableDefinitionForInclude
▸ buildElasticQueryForInclude(serverData, appData, itemDefinition, include, args, elasticQueryBuilder, language, dictionary, fullHighlights): void
Builds a sql query for an include
| Name | Type | Description |
|---|---|---|
serverData |
any |
the server data information |
appData |
IAppDataType |
- |
itemDefinition |
default |
the item definition that contains the include |
include |
default |
the include in question |
args |
IRQArgs |
the args as they come from the search module, specific for this item (not nested) |
elasticQueryBuilder |
ElasticQueryBuilder |
- |
language |
string |
- |
dictionary |
string |
the dictionary to use to build the search |
fullHighlights |
number |
- |
void
base/Root/Module/ItemDefinition/Include/sql.ts:369
▸ buildSQLQueryForInclude(serverData, appData, itemDefinition, include, args, whereBuilder, language, dictionary): void
Builds a sql query for an include
| Name | Type | Description |
|---|---|---|
serverData |
any |
the server data information |
appData |
IAppDataType |
- |
itemDefinition |
default |
the item definition that contains the include |
include |
default |
the include in question |
args |
IRQArgs |
the args as they come from the search module, specific for this item (not nested) |
whereBuilder |
WhereBuilder |
- |
language |
string |
- |
dictionary |
string |
the dictionary to use to build the search |
void
base/Root/Module/ItemDefinition/Include/sql.ts:302
▸ convertRQValueToSQLValueForInclude(serverData, appData, itemDefinition, include, data, oldData, uploadsClient, domain, language, dictionary, partialFields?): ISQLStreamComposedTableRowValue
Converts a rq value into a SQL row data, it takes apart a complex rq value and converts it into a serializable sql form
| Name | Type | Description |
|---|---|---|
serverData |
any |
the server data |
appData |
IAppDataType |
- |
itemDefinition |
default |
the item definition in question |
include |
default |
the include in question |
data |
IRQArgs |
the rq data value |
oldData |
IRQValue |
the old rq data value that used to be stored for that include |
uploadsClient |
default<any> |
the uploads client |
domain |
string |
- |
language |
string | ISQLTableRowValue |
- |
dictionary |
string | ISQLTableRowValue |
the dictionary to use in full text search mode |
partialFields? |
any |
fields to make a partial value rather than a total value, note that we don't recommend using partial fields in order to create because some properties might treat nulls in a fancy way, when creating all the table rows should be set, only when updating you should use partial fields; for example, if you have a field that has a property that is nullable but it's forced into some value it will be ignored in a partial field value, don't use partial fields to create |
ISQLStreamComposedTableRowValue
the partial sql result to be added into the table
base/Root/Module/ItemDefinition/Include/sql.ts:222
▸ convertSQLValueToElasticSQLValueForInclude(serverData, appData, itemDefinition, include, row): IRQValue
| Name | Type |
|---|---|
serverData |
any |
appData |
IAppDataType |
itemDefinition |
default |
include |
default |
row |
ISQLTableRowValue |
base/Root/Module/ItemDefinition/Include/sql.ts:172
▸ convertSQLValueToRQValueForInclude(serverData, appData, itemDefinition, include, row, rqFields?): IRQValue
Given a SQL row it converts the value of the data contained within that row into the valid rq output
| Name | Type | Description |
|---|---|---|
serverData |
any |
the server data that is currently in use |
appData |
IAppDataType |
- |
itemDefinition |
default |
- |
include |
default |
the include in question |
row |
ISQLTableRowValue |
the row sql data |
rqFields? |
any |
(optional) contains the only properties that are required in the request provided by grapql fields, eg {id: {}, name: {}} |
a partial rq value
base/Root/Module/ItemDefinition/Include/sql.ts:127
▸ getElasticSchemaForInclude(itemDefinition, include, serverData, appData): IElasticIndexDefinitionType
| Name | Type |
|---|---|
itemDefinition |
default |
include |
default |
serverData |
any |
appData |
IAppDataType |
base/Root/Module/ItemDefinition/Include/sql.ts:28
▸ getSQLTableDefinitionForInclude(itemDefinition, include): ISQLTableDefinitionType
Provides the table bit that is necessary to store include data for this include when included from the parent definition
| Name | Type | Description |
|---|---|---|
itemDefinition |
default |
the item definition that contains the include (not the referred) |
include |
default |
the include in question |
the partial table definition schema for the include, prefixed and with the exclusion state