UnitInfoTable.h (1354B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include "winrt/Microsoft.Management.Configuration.h" 5 #include "Database/Schema/IConfigurationDatabase.h" 6 #include <winget/SQLiteWrapper.h> 7 8 namespace winrt::Microsoft::Management::Configuration::implementation::Database::Schema::V0_1 9 { 10 struct UnitInfoTable 11 { 12 UnitInfoTable(AppInstaller::SQLite::Connection& connection); 13 14 // Creates the unit info table. 15 void Create(); 16 17 // Adds the given configuration unit to the table. 18 void Add(const Configuration::ConfigurationUnit& configurationUnit, AppInstaller::SQLite::rowid_t setRowId, hstring schemaVersion); 19 20 // Updates the units for the target set. 21 void UpdateForSet(AppInstaller::SQLite::rowid_t target, const Windows::Foundation::Collections::IVector<Configuration::ConfigurationUnit>& units, hstring schemaVersion); 22 23 // Removes the units from the target set. 24 void RemoveForSet(AppInstaller::SQLite::rowid_t target); 25 26 // Gets all of the units for the given set. 27 std::vector<IConfigurationDatabase::ConfigurationUnitPtr> GetAllUnitsForSet(AppInstaller::SQLite::rowid_t setRowId, std::string_view schemaVersion); 28 29 private: 30 AppInstaller::SQLite::Connection& m_connection; 31 }; 32 }