Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
WebDatabase
is a representation of a Web Database database. The
proposed Web Database standard introduces support for SQL databases that web
sites can create and access on a local computer through JavaScript.
To get access to all databases defined by a security origin, use
webkit_security_origin_get_databases
. Each database has a canonical
name, as well as a user-friendly display name.
WebKit uses SQLite to create and access the local SQL databases. The location
of a WebDatabase
can be accessed wth webkit_web_database_get_filename
.
You can configure the location of all databases with
webkit_set_database_directory_path
.
For each database the web site can define an estimated size which can be
accessed with webkit_web_database_get_expected_size
. The current size of the
database in bytes is returned by webkit_web_database_get_size
.
For more information refer to the Web Database specification proposal at http://dev.w3.org/html5/webdatabase
- newtype WebDatabase = WebDatabase (ManagedPtr WebDatabase)
- class GObject o => IsWebDatabase o
- toWebDatabase :: (MonadIO m, IsWebDatabase o) => o -> m WebDatabase
- noWebDatabase :: Maybe WebDatabase
- webDatabaseGetDisplayName :: (HasCallStack, MonadIO m, IsWebDatabase a) => a -> m Text
- webDatabaseGetExpectedSize :: (HasCallStack, MonadIO m, IsWebDatabase a) => a -> m Word64
- webDatabaseGetFilename :: (HasCallStack, MonadIO m, IsWebDatabase a) => a -> m Text
- webDatabaseGetName :: (HasCallStack, MonadIO m, IsWebDatabase a) => a -> m Text
- webDatabaseGetSecurityOrigin :: (HasCallStack, MonadIO m, IsWebDatabase a) => a -> m SecurityOrigin
- webDatabaseGetSize :: (HasCallStack, MonadIO m, IsWebDatabase a) => a -> m Word64
- webDatabaseRemove :: (HasCallStack, MonadIO m, IsWebDatabase a) => a -> m ()
- getWebDatabaseDisplayName :: (MonadIO m, IsWebDatabase o) => o -> m Text
- getWebDatabaseExpectedSize :: (MonadIO m, IsWebDatabase o) => o -> m Word64
- getWebDatabaseFilename :: (MonadIO m, IsWebDatabase o) => o -> m Text
- constructWebDatabaseName :: IsWebDatabase o => Text -> IO (GValueConstruct o)
- getWebDatabaseName :: (MonadIO m, IsWebDatabase o) => o -> m Text
- constructWebDatabaseSecurityOrigin :: (IsWebDatabase o, IsSecurityOrigin a) => a -> IO (GValueConstruct o)
- getWebDatabaseSecurityOrigin :: (MonadIO m, IsWebDatabase o) => o -> m SecurityOrigin
- getWebDatabaseSize :: (MonadIO m, IsWebDatabase o) => o -> m Word64
Exported types
newtype WebDatabase Source #
class GObject o => IsWebDatabase o Source #
toWebDatabase :: (MonadIO m, IsWebDatabase o) => o -> m WebDatabase Source #
Methods
getDisplayName
webDatabaseGetDisplayName Source #
:: (HasCallStack, MonadIO m, IsWebDatabase a) | |
=> a |
|
-> m Text | Returns: the name of the database as seen by the user. |
Returns the name of the WebDatabase
as seen by the user.
Since: 1.1.14
getExpectedSize
webDatabaseGetExpectedSize Source #
:: (HasCallStack, MonadIO m, IsWebDatabase a) | |
=> a |
|
-> m Word64 | Returns: the expected size of the database in bytes |
Returns the expected size of the WebDatabase
in bytes as defined by the
web author. The Web Database standard allows web authors to specify an expected
size of the database to optimize the user experience.
Since: 1.1.14
getFilename
webDatabaseGetFilename Source #
:: (HasCallStack, MonadIO m, IsWebDatabase a) | |
=> a |
|
-> m Text | Returns: the absolute filename of the database |
Returns the absolute filename to the WebDatabase
file on disk.
Since: 1.1.14
getName
:: (HasCallStack, MonadIO m, IsWebDatabase a) | |
=> a |
|
-> m Text | Returns: the name of the database |
Returns the canonical name of the WebDatabase
.
Since: 1.1.14
getSecurityOrigin
webDatabaseGetSecurityOrigin Source #
:: (HasCallStack, MonadIO m, IsWebDatabase a) | |
=> a |
|
-> m SecurityOrigin | Returns: the security origin of the database |
Returns the security origin of the WebDatabase
.
Since: 1.1.14
getSize
:: (HasCallStack, MonadIO m, IsWebDatabase a) | |
=> a |
|
-> m Word64 | Returns: the actual size of the database in bytes |
Returns the actual size of the WebDatabase
space on disk in bytes.
Since: 1.1.14
remove
:: (HasCallStack, MonadIO m, IsWebDatabase a) | |
=> a |
|
-> m () |
Removes the WebDatabase
from its security origin and destroys all data
stored in the database.
Since: 1.1.14
Properties
displayName
getWebDatabaseDisplayName :: (MonadIO m, IsWebDatabase o) => o -> m Text Source #
expectedSize
getWebDatabaseExpectedSize :: (MonadIO m, IsWebDatabase o) => o -> m Word64 Source #
filename
getWebDatabaseFilename :: (MonadIO m, IsWebDatabase o) => o -> m Text Source #
name
constructWebDatabaseName :: IsWebDatabase o => Text -> IO (GValueConstruct o) Source #
getWebDatabaseName :: (MonadIO m, IsWebDatabase o) => o -> m Text Source #
securityOrigin
constructWebDatabaseSecurityOrigin :: (IsWebDatabase o, IsSecurityOrigin a) => a -> IO (GValueConstruct o) Source #
getWebDatabaseSecurityOrigin :: (MonadIO m, IsWebDatabase o) => o -> m SecurityOrigin Source #
size
getWebDatabaseSize :: (MonadIO m, IsWebDatabase o) => o -> m Word64 Source #