Interface.h (2082B)
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_1/Interface.h" 6 7 8 namespace AppInstaller::Repository::Microsoft::Schema::V1_2 9 { 10 // Interface to this schema version exposed through ISQLiteIndex. 11 struct Interface : public V1_1::Interface 12 { 13 Interface(Utility::NormalizationVersion normVersion = Utility::NormalizationVersion::Initial); 14 15 // Version 1.0 16 SQLite::Version GetVersion() const override; 17 void CreateTables(SQLite::Connection& connection, CreateOptions options) override; 18 SQLite::rowid_t AddManifest(SQLite::Connection& connection, const Manifest::Manifest& manifest, const std::optional<std::filesystem::path>& relativePath) override; 19 std::pair<bool, SQLite::rowid_t> UpdateManifest(SQLite::Connection& connection, const Manifest::Manifest& manifest, const std::optional<std::filesystem::path>& relativePath) override; 20 void RemoveManifestById(SQLite::Connection& connection, SQLite::rowid_t manifestId) override; 21 bool CheckConsistency(const SQLite::Connection& connection, bool log) const override; 22 std::vector<std::string> GetMultiPropertyByPrimaryId(const SQLite::Connection& connection, SQLite::rowid_t primaryId, PackageVersionMultiProperty property) const override; 23 24 // Version 1.2 25 Utility::NormalizedName NormalizeName(std::string_view name, std::string_view publisher) const override; 26 27 // Version 1.7 28 void DropTables(SQLite::Connection& connection) override; 29 30 protected: 31 std::unique_ptr<V1_0::SearchResultsTable> CreateSearchResultsTable(const SQLite::Connection& connection) const override; 32 SearchResult SearchInternal(const SQLite::Connection& connection, SearchRequest& request) const override; 33 void PrepareForPackaging(SQLite::Connection& connection, bool vacuum) override; 34 35 // The name normalization utility 36 Utility::NameNormalizer m_normalizer; 37 }; 38 }