1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
/******************************************************************************
*
* Project: GDAL
* Purpose: "sql" step of "vector pipeline"
* Author: Even Rouault <even dot rouault at spatialys.com>
*
******************************************************************************
* Copyright (c) 2025, Even Rouault <even dot rouault at spatialys.com>
*
* SPDX-License-Identifier: MIT
****************************************************************************/
#ifndef GDALALG_VECTOR_SQL_INCLUDED
#define GDALALG_VECTOR_SQL_INCLUDED
#include "gdalalg_vector_pipeline.h"
//! @cond Doxygen_Suppress
/************************************************************************/
/* GDALVectorSQLAlgorithm */
/************************************************************************/
class GDALVectorSQLAlgorithm /* non final */
: public GDALVectorPipelineStepAlgorithm
{
public:
static constexpr const char *NAME = "sql";
static constexpr const char *DESCRIPTION =
"Apply SQL statement(s) to a dataset.";
static constexpr const char *HELP_URL = "/programs/gdal_vector_sql.html";
explicit GDALVectorSQLAlgorithm(bool standaloneStep = false);
private:
static ConstructorOptions GetConstructorOptions(bool standaloneStep);
bool RunStep(GDALPipelineStepRunContext &ctxt) override;
std::vector<std::string> m_sql{};
std::vector<std::string> m_outputLayer{};
std::string m_dialect{};
};
/************************************************************************/
/* GDALVectorSQLAlgorithmStandalone */
/************************************************************************/
class GDALVectorSQLAlgorithmStandalone final : public GDALVectorSQLAlgorithm
{
public:
GDALVectorSQLAlgorithmStandalone()
: GDALVectorSQLAlgorithm(/* standaloneStep = */ true)
{
}
~GDALVectorSQLAlgorithmStandalone() override;
};
//! @endcond
#endif /* GDALALG_VECTOR_SQL_INCLUDED */
|