1 // Copyright (c) 2013 Intel Corporation. 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 #include "xwalk/application/common/application_storage_constants.h"
6 #include "base/strings/stringprintf.h"
9 namespace application_storage_constants {
11 const char kAppTableName[] = "applications";
12 const char kPermissionTableName[] = "stored_permissions";
13 const char kGarbageCollectionTableName[] = "garbage_collection";
15 const char kCreateAppTableOp[] =
16 "CREATE TABLE applications ("
17 "id TEXT NOT NULL UNIQUE PRIMARY KEY,"
18 "manifest TEXT NOT NULL,"
22 const char kCreatePermissionTableOp[] =
23 "CREATE TABLE stored_permissions ("
25 "permission_names TEXT NOT NULL,"
27 "FOREIGN KEY (id) REFERENCES applications(id)"
30 const char kGetRowFromAppTableOp[] =
31 "SELECT A.id, A.manifest, A.path, A.install_time, "
32 "C.permission_names FROM applications as A "
33 "LEFT JOIN stored_permissions as C "
34 "ON A.id = C.id WHERE A.id = ?";
36 const char kGetAllRowsFromAppTableOp[] =
37 "SELECT A.id, A.manifest, A.path, A.install_time, "
38 "C.permission_names FROM applications as A "
39 "LEFT JOIN stored_permissions as C "
42 extern const char kGetAllIDsFromAppTableOp[] =
43 "SELECT id FROM applications";
45 const char kSetApplicationWithBindOp[] =
46 "INSERT INTO applications (manifest, path, install_time, id) "
49 const char kUpdateApplicationWithBindOp[] =
50 "UPDATE applications SET manifest = ?, path = ?,"
51 "install_time = ? WHERE id = ?";
53 const char kDeleteApplicationWithBindOp[] =
54 "DELETE FROM applications WHERE id = ?";
56 const char kInsertPermissionsWithBindOp[] =
57 "INSERT INTO stored_permissions (permission_names, id) "
60 const char kUpdatePermissionsWithBindOp[] =
61 "UPDATE stored_permissions SET permission_names = ? WHERE id = ?";
63 const char kDeletePermissionsWithBindOp[] =
64 "DELETE FROM stored_permissions WHERE id = ?";
66 } // namespace application_storage_constants