chromium/components/affiliations/core/browser/sql_table_builder.cc

// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/affiliations/core/browser/sql_table_builder.h"

#include <set>
#include <string_view>
#include <utility>

#include "base/containers/adapters.h"
#include "base/containers/contains.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "base/ranges/algorithm.h"
#include "base/strings/strcat.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "sql/database.h"
#include "sql/statement.h"
#include "sql/transaction.h"

namespace affiliations {

namespace {

// Appends |name| to |list_of_names|, separating items with ", ".
void Append(const std::string& name, std::string* list_of_names) {}

// Returns true iff the foreign keys can be safely re-enabled on the database.
bool CheckForeignKeyConstraints(sql::Database& db) {}

std::string ComputeColumnSuffix(bool is_primary_key,
                                const std::string& parent_table) {}

}  // namespace

// static
unsigned constexpr SQLTableBuilder::kInvalidVersion;

struct SQLTableBuilder::Column {};

struct SQLTableBuilder::Index {};

SQLTableBuilder::SQLTableBuilder(const std::string& table_name)
    :{}

SQLTableBuilder::~SQLTableBuilder() = default;

void SQLTableBuilder::AddColumn(std::string name, std::string type) {}

void SQLTableBuilder::AddPrimaryKeyColumn(std::string name) {}

void SQLTableBuilder::AddColumnToUniqueKey(std::string name, std::string type) {}

void SQLTableBuilder::AddColumnToUniqueKey(std::string name,
                                           std::string type,
                                           std::string parent_table,
                                           std::string index_name) {}

void SQLTableBuilder::RenameColumn(const std::string& old_name,
                                   const std::string& new_name) {}

// Removes column |name|. |name| must have been added in the past.
void SQLTableBuilder::DropColumn(const std::string& name) {}

void SQLTableBuilder::AddIndex(std::string name,
                               std::vector<std::string> columns) {}

std::string SQLTableBuilder::ComputeConstraints(unsigned version) const {}

unsigned SQLTableBuilder::SealVersion() {}

bool SQLTableBuilder::MigrateFrom(
    unsigned old_version,
    sql::Database* db,
    const base::RepeatingCallback<bool(sql::Database*, unsigned)>&
        post_migration_step_callback) const {}

bool SQLTableBuilder::CreateTable(sql::Database* db) const {}

std::string SQLTableBuilder::ListAllColumnNames() const {}

std::string SQLTableBuilder::ListAllNonuniqueKeyNames() const {}

std::string SQLTableBuilder::ListAllUniqueKeyNames() const {}

std::vector<std::string_view> SQLTableBuilder::AllPrimaryKeyNames() const {}

size_t SQLTableBuilder::NumberOfColumns() const {}

std::string SQLTableBuilder::TableName() const {}

bool SQLTableBuilder::MigrateToNextFrom(unsigned old_version,
                                        sql::Database* db) const {}

bool SQLTableBuilder::MigrateIndicesToNextFrom(unsigned old_version,
                                               sql::Database* db) const {}

std::vector<SQLTableBuilder::Column>::reverse_iterator
SQLTableBuilder::FindLastColumnByName(const std::string& name) {}

std::vector<SQLTableBuilder::Index>::reverse_iterator
SQLTableBuilder::FindLastIndexByName(const std::string& name) {}

bool SQLTableBuilder::IsVersionLastAndSealed(unsigned version) const {}

bool SQLTableBuilder::IsColumnInLastVersion(const Column& column) const {}

bool SQLTableBuilder::IsIndexInLastVersion(const Index& index) const {}

}  // namespace affiliations