#include "components/user_notes/storage/user_note_database.h"
#include <string_view>
#include "base/files/file_util.h"
#include "base/json/values_util.h"
#include "sql/error_delegate_util.h"
#include "sql/meta_table.h"
#include "sql/statement.h"
#include "sql/transaction.h"
namespace user_notes {
namespace {
const int kCurrentVersionNumber = …;
const int kCompatibleVersionNumber = …;
}
UserNoteDatabase::UserNoteDatabase(const base::FilePath& path_to_database_dir)
: … { … }
UserNoteDatabase::~UserNoteDatabase() { … }
bool UserNoteDatabase::Init() { … }
UserNoteMetadataSnapshot UserNoteDatabase::GetNoteMetadataForUrls(
const UserNoteStorage::UrlSet& urls) { … }
std::vector<std::unique_ptr<UserNote>> UserNoteDatabase::GetNotesById(
const UserNoteStorage::IdSet& ids) { … }
std::unique_ptr<UserNote> UserNoteDatabase::GetNoteById(
const base::UnguessableToken& id) { … }
bool UserNoteDatabase::CreateNote(std::unique_ptr<UserNote> model,
std::u16string note_body_text) { … }
bool UserNoteDatabase::UpdateNote(std::unique_ptr<UserNote> model,
std::u16string note_body_text,
bool is_creation) { … }
bool UserNoteDatabase::DeleteNoteWithStringId(std::string id) { … }
bool UserNoteDatabase::DeleteNote(const base::UnguessableToken& id) { … }
bool UserNoteDatabase::DeleteAllForUrl(const GURL& url) { … }
bool UserNoteDatabase::DeleteAllForOrigin(const url::Origin& page) { … }
bool UserNoteDatabase::DeleteAllNotes() { … }
bool UserNoteDatabase::EnsureDBInit() { … }
void UserNoteDatabase::DatabaseErrorCallback(int error, sql::Statement* stmt) { … }
bool UserNoteDatabase::InitSchema() { … }
bool UserNoteDatabase::CreateSchema() { … }
}