winget-cli

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

Interface.h (2707B)


      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_0/Interface.h"
      6 
      7 
      8 namespace AppInstaller::Repository::Microsoft::Schema::V1_1
      9 {
     10     // Interface to this schema version exposed through ISQLiteIndex.
     11     struct Interface : public V1_0::Interface
     12     {
     13         // Version 1.0
     14         SQLite::Version GetVersion() const override;
     15         void CreateTables(SQLite::Connection& connection, CreateOptions options) override;
     16         SQLite::rowid_t AddManifest(SQLite::Connection& connection, const Manifest::Manifest& manifest, const std::optional<std::filesystem::path>& relativePath) override;
     17         std::pair<bool, SQLite::rowid_t> UpdateManifest(SQLite::Connection& connection, const Manifest::Manifest& manifest, const std::optional<std::filesystem::path>& relativePath) override;
     18         void RemoveManifestById(SQLite::Connection& connection, SQLite::rowid_t manifestId) override;
     19         void PrepareForPackaging(SQLite::Connection& connection) override;
     20         bool CheckConsistency(const SQLite::Connection& connection, bool log) const override;
     21         SearchResult Search(const SQLite::Connection& connection, const SearchRequest& request) const override;
     22         std::vector<std::string> GetMultiPropertyByPrimaryId(const SQLite::Connection& connection, SQLite::rowid_t primaryId, PackageVersionMultiProperty property) const override;
     23 
     24         // Version 1.1
     25         MetadataResult GetMetadataByManifestId(const SQLite::Connection& connection, SQLite::rowid_t manifestId) const override;
     26         void SetMetadataByManifestId(SQLite::Connection& connection, SQLite::rowid_t manifestId, PackageVersionMetadata metadata, std::string_view value) override;
     27 
     28         // Version 1.7
     29         void DropTables(SQLite::Connection& connection) override;
     30 
     31     protected:
     32         std::unique_ptr<V1_0::SearchResultsTable> CreateSearchResultsTable(const SQLite::Connection& connection) const override;
     33         void PerformQuerySearch(V1_0::SearchResultsTable& resultsTable, const RequestMatch& query) const override;
     34         V1_0::OneToManyTableSchema GetOneToManyTableSchema() const override;
     35 
     36         virtual SearchResult SearchInternal(const SQLite::Connection& connection, SearchRequest& request) const;
     37         virtual void PrepareForPackaging(SQLite::Connection& connection, bool vacuum);
     38 
     39         // Gets a property already knowing that the manifest id is valid.
     40         virtual std::optional<std::string> GetPropertyByManifestIdInternal(const SQLite::Connection& connection, SQLite::rowid_t manifestId, PackageVersionProperty property) const;
     41     };
     42 }