[View] [Edit] [Lock] [References] [Attachments] [History] [Home] [Changes] [Search] [Help]
api[www,IndexedDB] code
NativeObject subclass: #IDBEnvironment category: #IndexedDB!
IDBEnvironment comment: '
Defines APIs for a database of records holding simple values
and hierarchical objects. Each record consists of a key and some value.
Moreover, the database maintains indexes over records it stores. An
application developer directly uses an API to locate records either by
their key or by using an index. A query language can be layered on this
API. An indexed database can be implemented using a persistent B-tree data
structure.
http://www.w3.org/TR/IndexedDB/
@2012 Alejandro Reimondo [email protected]
'!
NativeObject subclass: #IDBKeyRange category: #IndexedDB!
DOM subclass: #IDBDatabase category: #IndexedDB!
DOM subclass: #IDBRequest category: #IndexedDB!
DOM subclass: #IDBTransaction category: #IndexedDB!
IDBRequest subclass: #IDBOpenDBRequest category: #IndexedDB!
DOMEvent subclass: #IDBVersionChangeEvent category: #IndexedDB!
NativeObject subclass: #IDBFactory category: #IndexedDB!
NativeObject subclass: #IDBObjectStore category: #IndexedDB!
NativeObject subclass: #IDBIndex category: #IndexedDB!
NativeObject subclass: #IDBCursor category: #IndexedDB!
IDBCursor subclass: #IDBCursorWithValue category: #IndexedDB!
NativeObject subclass: #IDBEnvironmentSync category: #IndexedDB!
NativeObject subclass: #IDBFactorySync category: #IndexedDB!
NativeObject subclass: #IDBDatabaseSync category: #IndexedDB!
NativeObject subclass: #IDBTransactionCallback category: #IndexedDB!
NativeObject subclass: #IDBVersionChangeCallback category: #IndexedDB!
NativeObject subclass: #IDBObjectStoreSync category: #IndexedDB!
NativeObject subclass: #IDBIndexSync category: #IndexedDB!
NativeObject subclass: #IDBCursorSync category: #IndexedDB!
IDBCursorSync subclass: #IDBCursorWithValueSync category: #IndexedDB!
NativeObject subclass: #IDBTransactionSync category: #IndexedDB!
! BrowserWindow methodsFor: 'Indexed Database API-converting' !
asIDBEnvironment
" Return the receiver adapted to IDBEnvironment interface. "
^IDBEnvironment @ self handle! !
IDBKeyRange buildBooleanGetters: #( #lowerOpen #upperOpen )!
IDBKeyRange buildGetters: #( #lower #upper )!
IDBKeyRange buildFunctions: #(
#( #only: #( #value ) )
#( #lowerBound:open: #( #lower #open ) )
#( #upperBound:open: #( #upper #open ) )
#( #bound:upper:lowerOpen:upperOpen: #( #lower #upper #lowerOpen #upperOpen ) )
)!
IDBRequest buildAccessors: #( #onsuccess #onerror )!
IDBRequest buildGetters: #( #result #error #source #transaction #readyState )!
IDBOpenDBRequest buildAccessors: #( #onblocked #onupgradeneeded )!
IDBVersionChangeEvent buildGetters: #( #oldVersion #newVersion )!
IDBEnvironment buildGetters: #( #indexedDB )!
IDBFactory buildFunctions: #(
#( #open:version: #( #name #version ) )
#( #deleteDatabase: #( #name ) )
#( #cmp:second: #( #first #second ) )
)!
IDBDatabase buildAccessors: #( #onabort #onerror #onversionchange )!
IDBDatabase buildGetters: #( #name #version #objectStoreNames )!
IDBDatabase buildFunctions: #(
#( #createObjectStore:optionalParameters: #( #name #optionalParameters ) )
#( #deleteObjectStore: #( #name ) )
#( #transaction:mode: #( #storeNames #mode ) )
#close
)!
IDBObjectStore buildBooleanGetters: #( #autoIncremenent )!
IDBObjectStore buildGetters: #( #name #keyPath #indexNames #transaction )!
IDBObjectStore buildFunctions: #(
#( #put:key: #( #value #key ) )
#( #add:key: #( #value #key ) )
#( #delete: #( #key ) )
#( #get: #( #key ) )
#clear
#( #openCursor:direction: #( #range #direction ) )
#( #createIndex:keyPath:optionalParameters: #( #name #keyPath #optionalParameters ) )
#( #index: #( #name ) )
#( #deleteIndex: #( #indexName ) )
#( #count: #( #key ) )
)!
IDBIndex buildBooleanGetters: #( #multiEntry #unique )!
IDBIndex buildGetters: #( #name #objectStore #keyPath )!
IDBIndex buildFunctions: #(
#( #openCursor:direction: #( #range #direction ) )
#( #openKeyCursor:direction: #( #range #direction ) )
#( #get: #( #key ) )
#( #getKey: #( #key ) )
#( #count: #( #key ) )
)!
IDBCursor buildGetters: #( #source #direction #key #primaryKey )!
IDBCursor buildFunctions: #(
#( #update: #( #value ) )
#( #advance: #( #count ) )
#( #continue: #( #key ) )
#delete
)!
IDBCursorWithValue buildGetters: #( #value )!
IDBTransaction buildAccessors: #( #onabort #oncomplete #onerror )!
IDBTransaction buildGetters: #( #mode #db #error )!
IDBTransaction buildFunctions: #(
#( #objectStore: #( #name ) )
#abort
)!
IDBEnvironmentSync buildGetters: #( #indexedDBSync )!
IDBFactorySync buildFunctions: #(
#( #open:version:upgradeCallback:timeout: #( #name #version #upgradeCallback #timeout ) )
#( #deleteDatabase: #( #name ) )
#( #cmp:second: #( #first #second ) )
)!
IDBDatabaseSync buildGetters: #( #name #version #objectStoreNames )!
IDBDatabaseSync buildFunctions: #(
#( #createObjectStore:optionalParameters: #( #name #optionalParameters ) )
#( #deleteObjectStore: #( #name ) )
#( #transaction:callback:mode:timeout: #( #storeNames #callback #mode #timeout ) )
#close
)!
IDBTransactionCallback buildFunctions: #(
#( #transactionStarted: #( #transaction ) )
)!
IDBVersionChangeCallback buildFunctions: #(
#( #transactionStarted:oldVersion: #( #transaction #oldVersion ) )
)!
IDBObjectStoreSync buildBooleanGetters: #( #autoIncremenent )!
IDBObjectStoreSync buildGetters: #( #name #keyPath #indexNames #transaction )!
IDBObjectStoreSync buildFunctions: #(
#( #put:key: #( #value #key ) )
#( #add:key: #( #value #key ) )
#( #delete: #( #key ) )
#( #get: #( #key ) )
#clear
#( #createIndex:keyPath:optionalParameters: #( #name #keyPath #optionalParameters ) )
#( #index: #( #name ) )
#( #deleteIndex: #( #indexName ) )
#( #openCursor:direction: #( #range #direction ) )
#( #count: #( #key ) )
)!
IDBIndexSync buildBooleanGetters: #( #multiEntry #unique )!
IDBIndexSync buildGetters: #( #name #objectStore #keyPath )!
IDBIndexSync buildFunctions: #(
#( #openCursor:direction: #( #range #direction ) )
#( #openKeyCursor:direction: #( #range #direction ) )
#( #get: #( #key ) )
#( #getKey: #( #key ) )
#( #count: #( #key ) )
)!
IDBCursorSync buildGetters: #( #source #direction #primaryKey )!
IDBCursorSync buildFunctions: #(
#( #update: #( #value ) )
#( #advance: #( #count ) )
#( #continue: #( #key ) )
#delete
)!
IDBCursorWithValueSync buildAccessors: #( #value )!
IDBTransactionSync buildAccessors: #( #db )!
IDBTransactionSync buildGetters: #( #mode #error )!
IDBTransactionSync buildFunctions: #(
#( #objectStore: #( #name ) )
#abort
)!