OLD | NEW |
1 /** | 1 /** |
2 * An API for storing data in the browser that can be queried with SQL. | 2 * An API for storing data in the browser that can be queried with SQL. |
3 * | 3 * |
4 * **Caution:** this specification is no longer actively maintained by the Web | 4 * **Caution:** this specification is no longer actively maintained by the Web |
5 * Applications Working Group and may be removed at any time. | 5 * Applications Working Group and may be removed at any time. |
6 * See [the W3C Web SQL Database specification](http://www.w3.org/TR/webdatabase
/) | 6 * See [the W3C Web SQL Database specification](http://www.w3.org/TR/webdatabase
/) |
7 * for more information. | 7 * for more information. |
8 * | 8 * |
9 * The [dart:indexed_db] APIs is a recommended alternatives. | 9 * The [dart:indexed_db] APIs is a recommended alternatives. |
10 */ | 10 */ |
11 library dart.dom.web_sql; | 11 library dart.dom.web_sql; |
12 | 12 |
13 import 'dart:async'; | 13 import 'dart:async'; |
14 import 'dart:collection'; | 14 import 'dart:collection'; |
15 import 'dart:_internal' hide deprecated; | 15 import 'dart:_internal' hide deprecated; |
16 import 'dart:html'; | 16 import 'dart:html'; |
17 import 'dart:html_common'; | 17 import 'dart:html_common'; |
18 import 'dart:_js_helper' show convertDartClosureToJS, Creates, JSName, Native; | 18 import 'dart:_js_helper' show convertDartClosureToJS, Creates, JSName; |
19 import 'dart:_foreign_helper' show JS; | 19 import 'dart:_foreign_helper' show JS; |
20 import 'dart:_interceptors' show Interceptor; | 20 import 'dart:_interceptors' show Interceptor; |
21 // DO NOT EDIT - unless you are editing documentation as per: | 21 // DO NOT EDIT - unless you are editing documentation as per: |
22 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation | 22 // https://code.google.com/p/dart/wiki/ContributingHTMLDocumentation |
23 // Auto-generated dart:audio library. | 23 // Auto-generated dart:audio library. |
24 | 24 |
25 | 25 |
26 | 26 |
27 | 27 |
28 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 28 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // BSD-style license that can be found in the LICENSE file. | 74 // BSD-style license that can be found in the LICENSE file. |
75 | 75 |
76 | 76 |
77 @DocsEditable() | 77 @DocsEditable() |
78 @DomName('Database') | 78 @DomName('Database') |
79 @SupportedBrowser(SupportedBrowser.CHROME) | 79 @SupportedBrowser(SupportedBrowser.CHROME) |
80 @SupportedBrowser(SupportedBrowser.SAFARI) | 80 @SupportedBrowser(SupportedBrowser.SAFARI) |
81 @Experimental() | 81 @Experimental() |
82 // http://www.w3.org/TR/webdatabase/#asynchronous-database-api | 82 // http://www.w3.org/TR/webdatabase/#asynchronous-database-api |
83 @Experimental() // deprecated | 83 @Experimental() // deprecated |
84 @Native("Database") | 84 class SqlDatabase extends Interceptor native "Database" { |
85 class SqlDatabase extends Interceptor { | |
86 // To suppress missing implicit constructor warnings. | 85 // To suppress missing implicit constructor warnings. |
87 factory SqlDatabase._() { throw new UnsupportedError("Not supported"); } | 86 factory SqlDatabase._() { throw new UnsupportedError("Not supported"); } |
88 | 87 |
89 /// Checks if this type is supported on the current platform. | 88 /// Checks if this type is supported on the current platform. |
90 static bool get supported => JS('bool', '!!(window.openDatabase)'); | 89 static bool get supported => JS('bool', '!!(window.openDatabase)'); |
91 | 90 |
92 @DomName('Database.version') | 91 @DomName('Database.version') |
93 @DocsEditable() | 92 @DocsEditable() |
94 final String version; | 93 final String version; |
95 | 94 |
(...skipping 23 matching lines...) Expand all Loading... |
119 } | 118 } |
120 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 119 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
121 // for details. All rights reserved. Use of this source code is governed by a | 120 // for details. All rights reserved. Use of this source code is governed by a |
122 // BSD-style license that can be found in the LICENSE file. | 121 // BSD-style license that can be found in the LICENSE file. |
123 | 122 |
124 | 123 |
125 @DocsEditable() | 124 @DocsEditable() |
126 @DomName('SQLError') | 125 @DomName('SQLError') |
127 // http://www.w3.org/TR/webdatabase/#sqlerror | 126 // http://www.w3.org/TR/webdatabase/#sqlerror |
128 @Experimental() // deprecated | 127 @Experimental() // deprecated |
129 @Native("SQLError") | 128 class SqlError extends Interceptor native "SQLError" { |
130 class SqlError extends Interceptor { | |
131 // To suppress missing implicit constructor warnings. | 129 // To suppress missing implicit constructor warnings. |
132 factory SqlError._() { throw new UnsupportedError("Not supported"); } | 130 factory SqlError._() { throw new UnsupportedError("Not supported"); } |
133 | 131 |
134 @DomName('SQLError.CONSTRAINT_ERR') | 132 @DomName('SQLError.CONSTRAINT_ERR') |
135 @DocsEditable() | 133 @DocsEditable() |
136 static const int CONSTRAINT_ERR = 6; | 134 static const int CONSTRAINT_ERR = 6; |
137 | 135 |
138 @DomName('SQLError.DATABASE_ERR') | 136 @DomName('SQLError.DATABASE_ERR') |
139 @DocsEditable() | 137 @DocsEditable() |
140 static const int DATABASE_ERR = 1; | 138 static const int DATABASE_ERR = 1; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 } | 171 } |
174 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 172 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
175 // for details. All rights reserved. Use of this source code is governed by a | 173 // for details. All rights reserved. Use of this source code is governed by a |
176 // BSD-style license that can be found in the LICENSE file. | 174 // BSD-style license that can be found in the LICENSE file. |
177 | 175 |
178 | 176 |
179 @DocsEditable() | 177 @DocsEditable() |
180 @DomName('SQLResultSet') | 178 @DomName('SQLResultSet') |
181 // http://www.w3.org/TR/webdatabase/#sqlresultset | 179 // http://www.w3.org/TR/webdatabase/#sqlresultset |
182 @Experimental() // deprecated | 180 @Experimental() // deprecated |
183 @Native("SQLResultSet") | 181 class SqlResultSet extends Interceptor native "SQLResultSet" { |
184 class SqlResultSet extends Interceptor { | |
185 // To suppress missing implicit constructor warnings. | 182 // To suppress missing implicit constructor warnings. |
186 factory SqlResultSet._() { throw new UnsupportedError("Not supported"); } | 183 factory SqlResultSet._() { throw new UnsupportedError("Not supported"); } |
187 | 184 |
188 @DomName('SQLResultSet.insertId') | 185 @DomName('SQLResultSet.insertId') |
189 @DocsEditable() | 186 @DocsEditable() |
190 final int insertId; | 187 final int insertId; |
191 | 188 |
192 @DomName('SQLResultSet.rows') | 189 @DomName('SQLResultSet.rows') |
193 @DocsEditable() | 190 @DocsEditable() |
194 final SqlResultSetRowList rows; | 191 final SqlResultSetRowList rows; |
195 | 192 |
196 @DomName('SQLResultSet.rowsAffected') | 193 @DomName('SQLResultSet.rowsAffected') |
197 @DocsEditable() | 194 @DocsEditable() |
198 final int rowsAffected; | 195 final int rowsAffected; |
199 } | 196 } |
200 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 197 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
201 // for details. All rights reserved. Use of this source code is governed by a | 198 // for details. All rights reserved. Use of this source code is governed by a |
202 // BSD-style license that can be found in the LICENSE file. | 199 // BSD-style license that can be found in the LICENSE file. |
203 | 200 |
204 | 201 |
205 @DocsEditable() | 202 @DocsEditable() |
206 @DomName('SQLResultSetRowList') | 203 @DomName('SQLResultSetRowList') |
207 // http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist | 204 // http://www.w3.org/TR/webdatabase/#sqlresultsetrowlist |
208 @Experimental() // deprecated | 205 @Experimental() // deprecated |
209 @Native("SQLResultSetRowList") | 206 class SqlResultSetRowList extends Interceptor with ListMixin<Map>, ImmutableList
Mixin<Map> implements List<Map> native "SQLResultSetRowList" { |
210 class SqlResultSetRowList extends Interceptor with ListMixin<Map>, ImmutableList
Mixin<Map> implements List<Map> { | |
211 // To suppress missing implicit constructor warnings. | 207 // To suppress missing implicit constructor warnings. |
212 factory SqlResultSetRowList._() { throw new UnsupportedError("Not supported");
} | 208 factory SqlResultSetRowList._() { throw new UnsupportedError("Not supported");
} |
213 | 209 |
214 @DomName('SQLResultSetRowList.length') | 210 @DomName('SQLResultSetRowList.length') |
215 @DocsEditable() | 211 @DocsEditable() |
216 int get length => JS("int", "#.length", this); | 212 int get length => JS("int", "#.length", this); |
217 | 213 |
218 Map operator[](int index) { | 214 Map operator[](int index) { |
219 if (JS("bool", "# >>> 0 !== # || # >= #", index, | 215 if (JS("bool", "# >>> 0 !== # || # >= #", index, |
220 index, index, length)) | 216 index, index, length)) |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 // BSD-style license that can be found in the LICENSE file. | 272 // BSD-style license that can be found in the LICENSE file. |
277 | 273 |
278 | 274 |
279 @DocsEditable() | 275 @DocsEditable() |
280 @DomName('SQLTransaction') | 276 @DomName('SQLTransaction') |
281 @SupportedBrowser(SupportedBrowser.CHROME) | 277 @SupportedBrowser(SupportedBrowser.CHROME) |
282 @SupportedBrowser(SupportedBrowser.SAFARI) | 278 @SupportedBrowser(SupportedBrowser.SAFARI) |
283 @Experimental() | 279 @Experimental() |
284 // http://www.w3.org/TR/webdatabase/#sqltransaction | 280 // http://www.w3.org/TR/webdatabase/#sqltransaction |
285 @deprecated // deprecated | 281 @deprecated // deprecated |
286 @Native("SQLTransaction") | 282 class SqlTransaction extends Interceptor native "SQLTransaction" { |
287 class SqlTransaction extends Interceptor { | |
288 // To suppress missing implicit constructor warnings. | 283 // To suppress missing implicit constructor warnings. |
289 factory SqlTransaction._() { throw new UnsupportedError("Not supported"); } | 284 factory SqlTransaction._() { throw new UnsupportedError("Not supported"); } |
290 | 285 |
291 @DomName('SQLTransaction.executeSql') | 286 @DomName('SQLTransaction.executeSql') |
292 @DocsEditable() | 287 @DocsEditable() |
293 void executeSql(String sqlStatement, List<Object> arguments, [SqlStatementCall
back callback, SqlStatementErrorCallback errorCallback]) native; | 288 void executeSql(String sqlStatement, List<Object> arguments, [SqlStatementCall
back callback, SqlStatementErrorCallback errorCallback]) native; |
294 } | 289 } |
295 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 290 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
296 // for details. All rights reserved. Use of this source code is governed by a | 291 // for details. All rights reserved. Use of this source code is governed by a |
297 // BSD-style license that can be found in the LICENSE file. | 292 // BSD-style license that can be found in the LICENSE file. |
298 | 293 |
299 | 294 |
300 @DocsEditable() | 295 @DocsEditable() |
301 @DomName('SQLTransactionSync') | 296 @DomName('SQLTransactionSync') |
302 @SupportedBrowser(SupportedBrowser.CHROME) | 297 @SupportedBrowser(SupportedBrowser.CHROME) |
303 @SupportedBrowser(SupportedBrowser.SAFARI) | 298 @SupportedBrowser(SupportedBrowser.SAFARI) |
304 @Experimental() | 299 @Experimental() |
305 // http://www.w3.org/TR/webdatabase/#sqltransactionsync | 300 // http://www.w3.org/TR/webdatabase/#sqltransactionsync |
306 @Experimental() // deprecated | 301 @Experimental() // deprecated |
307 @Native("SQLTransactionSync") | 302 abstract class _SQLTransactionSync extends Interceptor native "SQLTransactionSyn
c" { |
308 abstract class _SQLTransactionSync extends Interceptor { | |
309 // To suppress missing implicit constructor warnings. | 303 // To suppress missing implicit constructor warnings. |
310 factory _SQLTransactionSync._() { throw new UnsupportedError("Not supported");
} | 304 factory _SQLTransactionSync._() { throw new UnsupportedError("Not supported");
} |
311 } | 305 } |
OLD | NEW |