1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef STORAGE_BROWSER_DATABASE_DATABASES_TABLE_H_
6 #define STORAGE_BROWSER_DATABASE_DATABASES_TABLE_H_
10 #include "base/strings/string16.h"
11 #include "storage/browser/storage_browser_export.h"
19 struct STORAGE_EXPORT_PRIVATE DatabaseDetails
{
23 std::string origin_identifier
;
24 base::string16 database_name
;
25 base::string16 description
;
29 class STORAGE_EXPORT_PRIVATE DatabasesTable
{
31 explicit DatabasesTable(sql::Connection
* db
) : db_(db
) { }
34 int64
GetDatabaseID(const std::string
& origin_identifier
,
35 const base::string16
& database_name
);
36 bool GetDatabaseDetails(const std::string
& origin_identifier
,
37 const base::string16
& database_name
,
38 DatabaseDetails
* details
);
39 bool InsertDatabaseDetails(const DatabaseDetails
& details
);
40 bool UpdateDatabaseDetails(const DatabaseDetails
& details
);
41 bool DeleteDatabaseDetails(const std::string
& origin_identifier
,
42 const base::string16
& database_name
);
43 bool GetAllOriginIdentifiers(std::vector
<std::string
>* origin_identifiers
);
44 bool GetAllDatabaseDetailsForOriginIdentifier(
45 const std::string
& origin_identifier
,
46 std::vector
<DatabaseDetails
>* details
);
47 bool DeleteOriginIdentifier(const std::string
& origin_identifier
);
52 } // namespace storage
54 #endif // STORAGE_BROWSER_DATABASE_DATABASES_TABLE_H_