winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

SQLiteTempTable.h (1002B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #pragma once
      4 #include <winget/SQLiteWrapper.h>
      5 #include <winget/SQLiteStatementBuilder.h>
      6 
      7 
      8 namespace AppInstaller::SQLite
      9 {
     10     // The base for a class that represents a temp table.
     11     struct TempTable
     12     {
     13         TempTable();
     14 
     15         ~TempTable();
     16 
     17         TempTable(const TempTable&) = delete;
     18         TempTable& operator=(const TempTable&) = delete;
     19 
     20         TempTable(TempTable&&) = default;
     21         TempTable& operator=(TempTable&&) = default;
     22 
     23     protected:
     24         // Gets the qualified name of the temp table.
     25         Builder::QualifiedTable GetQualifiedName() const;
     26 
     27         // Prepares the drop table statement for use in destructor.
     28         // It needs to be run by the derived class after the table is actually created.
     29         void InitDropStatement(const Connection& connection);
     30 
     31     private:
     32         std::string m_name;
     33         Statement m_dropTableStatement;
     34     };
     35 }