Interface.h (1969B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include "Microsoft/Schema/ISQLiteIndex.h" 5 #include "Microsoft/Schema/1_5/Interface.h" 6 7 namespace AppInstaller::Repository::Microsoft::Schema::V1_6 8 { 9 // Interface to this schema version exposed through ISQLiteIndex. 10 struct Interface : public V1_5::Interface 11 { 12 Interface(Utility::NormalizationVersion normVersion = Utility::NormalizationVersion::Initial); 13 14 // Version 1.0 15 SQLite::Version GetVersion() const override; 16 void CreateTables(SQLite::Connection& connection, CreateOptions options) override; 17 SQLite::rowid_t AddManifest(SQLite::Connection& connection, const Manifest::Manifest& manifest, const std::optional<std::filesystem::path>& relativePath) override; 18 std::pair<bool, SQLite::rowid_t> UpdateManifest(SQLite::Connection& connection, const Manifest::Manifest& manifest, const std::optional<std::filesystem::path>& relativePath) override; 19 void RemoveManifestById(SQLite::Connection& connection, SQLite::rowid_t manifestId) override; 20 bool CheckConsistency(const SQLite::Connection& connection, bool log) const override; 21 std::vector<std::string> GetMultiPropertyByPrimaryId(const SQLite::Connection& connection, SQLite::rowid_t primaryId, PackageVersionMultiProperty property) const override; 22 23 // Version 1.7 24 void DropTables(SQLite::Connection& connection) override; 25 26 protected: 27 std::unique_ptr<V1_0::SearchResultsTable> CreateSearchResultsTable(const SQLite::Connection& connection) const override; 28 void PerformQuerySearch(V1_0::SearchResultsTable& resultsTable, const RequestMatch& query) const override; 29 ISQLiteIndex::SearchResult SearchInternal(const SQLite::Connection& connection, SearchRequest& request) const; 30 void PrepareForPackaging(SQLite::Connection& connection, bool vacuum) override; 31 }; 32 }