Skip to content

Latest commit

 

History

History
216 lines (140 loc) · 9.81 KB

File metadata and controls

216 lines (140 loc) · 9.81 KB

@onzag/itemize / Modules / base/Root/Module/ItemDefinition/Include/sql

Module: 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

Table of contents

Functions

Functions

buildElasticQueryForInclude

buildElasticQueryForInclude(serverData, appData, itemDefinition, include, args, elasticQueryBuilder, language, dictionary, fullHighlights): void

Builds a sql query for an include

Parameters

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 -

Returns

void

Defined in

base/Root/Module/ItemDefinition/Include/sql.ts:369


buildSQLQueryForInclude

buildSQLQueryForInclude(serverData, appData, itemDefinition, include, args, whereBuilder, language, dictionary): void

Builds a sql query for an include

Parameters

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

Returns

void

Defined in

base/Root/Module/ItemDefinition/Include/sql.ts:302


convertRQValueToSQLValueForInclude

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

Parameters

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

Returns

ISQLStreamComposedTableRowValue

the partial sql result to be added into the table

Defined in

base/Root/Module/ItemDefinition/Include/sql.ts:222


convertSQLValueToElasticSQLValueForInclude

convertSQLValueToElasticSQLValueForInclude(serverData, appData, itemDefinition, include, row): IRQValue

Parameters

Name Type
serverData any
appData IAppDataType
itemDefinition default
include default
row ISQLTableRowValue

Returns

IRQValue

Defined in

base/Root/Module/ItemDefinition/Include/sql.ts:172


convertSQLValueToRQValueForInclude

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

Parameters

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: {}}

Returns

IRQValue

a partial rq value

Defined in

base/Root/Module/ItemDefinition/Include/sql.ts:127


getElasticSchemaForInclude

getElasticSchemaForInclude(itemDefinition, include, serverData, appData): IElasticIndexDefinitionType

Parameters

Name Type
itemDefinition default
include default
serverData any
appData IAppDataType

Returns

IElasticIndexDefinitionType

Defined in

base/Root/Module/ItemDefinition/Include/sql.ts:28


getSQLTableDefinitionForInclude

getSQLTableDefinitionForInclude(itemDefinition, include): ISQLTableDefinitionType

Provides the table bit that is necessary to store include data for this include when included from the parent definition

Parameters

Name Type Description
itemDefinition default the item definition that contains the include (not the referred)
include default the include in question

Returns

ISQLTableDefinitionType

the partial table definition schema for the include, prefixed and with the exclusion state

Defined in

base/Root/Module/ItemDefinition/Include/sql.ts:82