Home | History | Annotate | Download | only in history

Lines Matching refs:statement

10 #include "app/sql/statement.h"
35 // Binds/reads the given file path to the given column of the given statement.
36 void BindFilePath(sql::Statement& statement, const FilePath& path, int col) {
37 statement.BindString(col, path.value());
39 FilePath ColumnFilePath(sql::Statement& statement, int col) {
40 return FilePath(statement.ColumnString(col));
46 void BindFilePath(sql::Statement& statement, const FilePath& path, int col) {
47 statement.BindString(col, UTF16ToUTF8(path.value()));
49 FilePath ColumnFilePath(sql::Statement& statement, int col) {
50 return FilePath(UTF8ToUTF16(statement.ColumnString(col)));
87 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
92 if (!statement)
95 while (statement.Step()) {
97 info.db_handle = statement.ColumnInt64(0);
99 info.path = ColumnFilePath(statement, 1);
100 info.url_chain.push_back(GURL(statement.ColumnString(2)));
101 info.start_time = base::Time::FromTimeT(statement.ColumnInt64(3));
102 info.received_bytes = statement.ColumnInt64(4);
103 info.total_bytes = statement.ColumnInt64(5);
104 info.state = statement.ColumnInt(6);
113 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
116 if (!statement)
119 statement.BindInt64(0, received_bytes);
120 statement.BindInt(1, state);
121 statement.BindInt64(2, db_handle);
122 return statement.Run();
128 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
130 if (!statement)
133 BindFilePath(statement, path, 0);
134 statement.BindInt64(1, db_handle);
135 return statement.Run();
139 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
141 if (!statement)
143 statement.BindInt(0, DownloadItem::CANCELLED);
144 statement.BindInt(1, DownloadItem::IN_PROGRESS);
145 return statement.Run();
149 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
153 if (!statement)
156 BindFilePath(statement, info.path, 0);
157 statement.BindString(1, info.url().spec());
158 statement.BindInt64(2, info.start_time.ToTimeT());
159 statement.BindInt64(3, info.received_bytes);
160 statement.BindInt64(4, info.total_bytes);
161 statement.BindInt(5, info.state);
163 if (statement.Run())
169 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
171 if (!statement)
174 statement.BindInt64(0, db_handle);
175 statement.Run();
182 sql::Statement statement(GetDB().GetCachedStatement(SQL_FROM_HERE,
185 if (!statement)
190 statement.BindInt64(0, start_time);
191 statement.BindInt64(
194 statement.BindInt(2, DownloadItem::COMPLETE);
195 statement.BindInt(3, DownloadItem::CANCELLED);
196 statement.BindInt(4, DownloadItem::INTERRUPTED);
197 statement.Run();