/* * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "third_party/blink/renderer/modules/webdatabase/sqlite/sqlite_statement.h" #include <memory> #include "base/notreached.h" #include "third_party/blink/renderer/modules/webdatabase/sqlite/sql_log.h" #include "third_party/blink/renderer/modules/webdatabase/sqlite/sql_value.h" #include "third_party/sqlite/sqlite3.h" // SQLite 3.6.16 makes sqlite3_prepare_v2 automatically retry preparing the // statement once if the database scheme has changed. We rely on this behavior. #if SQLITE_VERSION_NUMBER < 3006016 #error SQLite version 3.6.16 or newer is required #endif namespace { // Only return error codes consistent with 3.7.6.3. int restrictError(int error) { … } } // namespace namespace blink { SQLiteStatement::SQLiteStatement(SQLiteDatabase& db, const String& sql) : … { … } SQLiteStatement::~SQLiteStatement() { … } int SQLiteStatement::Prepare() { … } int SQLiteStatement::Step() { … } int SQLiteStatement::Finalize() { … } bool SQLiteStatement::ExecuteCommand() { … } int SQLiteStatement::BindText(int index, const String& text) { … } int SQLiteStatement::BindDouble(int index, double number) { … } int SQLiteStatement::BindNull(int index) { … } int SQLiteStatement::BindValue(int index, const SQLValue& value) { … } unsigned SQLiteStatement::BindParameterCount() const { … } int SQLiteStatement::ColumnCount() { … } String SQLiteStatement::GetColumnName(int col) { … } SQLValue SQLiteStatement::GetColumnValue(int col) { … } String SQLiteStatement::GetColumnText(int col) { … } int SQLiteStatement::GetColumnInt(int col) { … } int64_t SQLiteStatement::GetColumnInt64(int col) { … } } // namespace blink