OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
QueryBuilder.h
Go to the documentation of this file.
1#pragma once
2#pragma warning(disable:4996)
3/*
4* 'bsoncxx::v_noabi::types::value': was declared deprecated
5*/
6#include <iostream>
7#include <string>
8#include <map>
9#include <vector>
10#include <list>
11
12#include "bsoncxx/types/value.hpp"
13#include "bsoncxx/document/view_or_value.hpp"
14#include "OTCore/Variable.h"
15
16using BsonViewOrValue = bsoncxx::document::view_or_value;
17using BsonView = bsoncxx::document::view;
18using BsonValueType = bsoncxx::types::value;
19
20namespace DataStorageAPI
21{
22
23 class __declspec(dllexport) QueryBuilder
24 {
25 public:
26 virtual ~QueryBuilder() {};
27 BsonViewOrValue GenerateFilterQuery(std::map<std::string, bsoncxx::types::value> filterPairs);
28
29 BsonViewOrValue GenerateFilterQuery(const std::string& fieldName, const ot::Variable& variable);
30 BsonViewOrValue GenerateFilterQuery(const std::string& fieldName, const std::list<ot::Variable>& variables);
31 BsonViewOrValue GenerateFilterQuery(const std::string& fieldName, BsonViewOrValue&& queryEntry);
32 BsonViewOrValue BuildBsonArray(const std::string& fieldName, std::list<BsonViewOrValue>&& variables);
33
34 BsonViewOrValue GenerateSelectQuery(std::vector<std::string> columnNames, bool incudeId);
35
36 BsonViewOrValue AppendElementToQuery(BsonView existingQuery, std::map<std::string, BsonValueType> newKvps);
37 };
38}
39
bsoncxx::document::view_or_value BsonViewOrValue
Definition DocumentAccess.h:12
bsoncxx::document::view BsonView
Definition DocumentAccessBase.h:12
bsoncxx::types::value BsonValueType
Definition QueryBuilder.h:18
Definition Variable.h:107
Definition ArrayBinaryConverter.h:3