summaryrefslogtreecommitdiff
path: root/src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc')
-rw-r--r--src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc b/src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc
index 423d266b4..7d698a6dd 100644
--- a/src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc
+++ b/src/components/policy/src/policy/sqlite_wrapper/src/sql_database.cc
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2013, Ford Motor Company
* All rights reserved.
*
@@ -60,6 +60,11 @@ bool SQLDatabase::Open() {
return error_ == SQLITE_OK;
}
+bool SQLDatabase::IsReadWrite() {
+ const char* schema = "main";
+ return sqlite3_db_readonly(conn_, schema) == 0;
+}
+
void SQLDatabase::Close() {
sync_primitives::AutoLock auto_lock(conn_lock_);
error_ = sqlite3_close(conn_);