2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
28 Create = SQLITE_OPEN_CREATE,
29 ReadWrite = SQLITE_OPEN_READWRITE,
30 MultiThread = SQLITE_OPEN_NOMUTEX,
31 Serialized = SQLITE_OPEN_FULLMUTEX
34 Connection(const std::string &name, const int flags);
35 virtual ~Connection();
37 int exec(const std::string &query);
39 inline long long getLastInsertRowId() const noexcept
41 return sqlite3_last_insert_rowid(m_handle);
44 inline const std::string &getName() const noexcept
49 inline int getErrorCode() const
51 return sqlite3_errcode(m_handle);
54 inline int getExtendedErrorCode() const
56 return sqlite3_extended_errcode(m_handle);
59 inline std::string getErrorMessage() const
61 return sqlite3_errmsg(m_handle);
64 inline sqlite3 *get() const noexcept
71 std::string m_filename;