Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.29 KB

functional.md

File metadata and controls

48 lines (35 loc) · 1.29 KB
Queried Logo

@Queried/Core Documentations

GitHub package.json version


Documentation > Usage > Functional


Explain

executeQuery function exported by Queried Serialize input before executing the query with provided executer and deserializes the result before return:

function executeQuery<InputDataType, StorageQueryType, StorageDataType>(
	executer: QueryExecuter<StorageQueryType, StorageDataType>,
	query: StorageQueryType,
	serializer: DataTransformer<InputDataType, StorageDataType>,
	deserializer: DataTransformer<StorageDataType, InputDataType>,
	...data: InputDataType[]
): Promise<StorageQueryType[]>;

If no transformers provided, a fallback echo transformer will be used instead:

const echoTransformer: DataTransformer<Input, Output> = (input: Input) =>
	input as any;

Examples

No tricks:

import { executeQuery } from '@queried/core';

await executeQuery(executer, query, serializer, deserializer, ...data);