![]() |
![]() |
![]() |
Reference Manual for CouchDB GLib Bindings | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
CouchdbSession; CouchdbSessionClass; CouchdbSession * couchdb_session_new (const char *uri
); const char * couchdb_session_get_uri (CouchdbSession *session
); GSList * couchdb_session_list_databases (CouchdbSession *session
,GError **error
); void couchdb_session_free_database_list (GSList *dblist
); CouchdbDatabaseInfo * couchdb_session_get_database_info (CouchdbSession *session
,const char *dbname
,GError **error
); CouchdbDatabase * couchdb_session_get_database (CouchdbSession *session
,const char *dbname
,GError **error
); gboolean couchdb_session_create_database (CouchdbSession *session
,const char *dbname
,GError **error
); gboolean couchdb_session_delete_database (CouchdbSession *session
,const char *dbname
,GError **error
); gboolean couchdb_session_compact_database (CouchdbSession *session
,const char *dbname
,GError **error
); void couchdb_session_enable_authentication (CouchdbSession *session
,CouchdbCredentials *credentials
); void couchdb_session_disable_authentication (CouchdbSession *session
); gboolean couchdb_session_is_authentication_enabled (CouchdbSession *session
); gboolean couchdb_session_replicate (CouchdbSession *session
,const gchar *source
,const gchar *target
,gboolean continous
,GError **error
); CouchdbDatabase; CouchdbSessionPrivate;
"authentication-failed" :Run Last
"database-created" :Run Last
"database-deleted" :Run Last
typedef struct { GObjectClass parent_class; /* Signals */ void (* authentication_failed) (CouchdbSession *session); void (* database_created) (CouchdbSession *session, const char *dbname); void (* database_deleted) (CouchdbSession *session, const char *dbname); } CouchdbSessionClass;
CouchdbSession * couchdb_session_new (const char *uri
);
Create a new CouchdbSession object, which is the entry point for operations on a CouchDB instance.
|
URI of the CouchDB instance to connect to |
Returns : |
A newly-created CouchdbSession object. |
const char * couchdb_session_get_uri (CouchdbSession *session
);
Retrieve the URI of the CouchDB instance a CouchdbSession object is bound to.
|
A CouchdbSession object |
Returns : |
the URI of the CouchDB instance used by this CouchdbSession object. |
GSList * couchdb_session_list_databases (CouchdbSession *session
,GError **error
);
Retrieve the list of databases that exist in the CouchDB instance being used.
|
A CouchdbSession object |
|
Placeholder for error information |
Returns : |
A list of strings containing the names of all the databases that exist in the CouchDB instance connected to. Once no longer needed, this list can be freed by calling couchdb_session_free_database_list. |
void couchdb_session_free_database_list (GSList *dblist
);
Free the list of databases returned by couchdb_session_list_databases.
|
A list of databases, as returned by couchdb_session_list_databases |
CouchdbDatabaseInfo * couchdb_session_get_database_info (CouchdbSession *session
,const char *dbname
,GError **error
);
Retrieve information about a given database.
|
A CouchdbSession object |
|
Name of the database for which to retrieve the information |
|
Placeholder for error information |
Returns : |
A CouchdbDatabaseInfo object, whose API can be used to retrieve all the information returned by CouchDB about this database. |
CouchdbDatabase * couchdb_session_get_database (CouchdbSession *session
,const char *dbname
,GError **error
);
Get a CouchdbDatabase object reference for an existing database.
|
A CouchdbSession object |
|
Name of the database to retrieve |
|
Placeholder for error information |
Returns : |
A CouchdbDatabase object if the database exists on the specified CouchdbSession object, or NULL if the database does not exist. |
gboolean couchdb_session_create_database (CouchdbSession *session
,const char *dbname
,GError **error
);
Create a new database on a CouchDB instance.
|
A CouchdbSession object |
|
Name of the database to be created |
|
Placeholder for error information |
Returns : |
TRUE if successful, FALSE otherwise. |
gboolean couchdb_session_delete_database (CouchdbSession *session
,const char *dbname
,GError **error
);
Delete an existing database on a CouchDB instance.
|
A CouchdbSession object |
|
Name of the database to be deleted |
|
Placeholder for error information |
Returns : |
TRUE if successful, FALSE otherwise. |
gboolean couchdb_session_compact_database (CouchdbSession *session
,const char *dbname
,GError **error
);
Compact the given database, which means removing outdated document revisions and deleted documents.
|
A CouchdbSession object |
|
Name of the database to be compacted |
|
Placeholder for error information |
Returns : |
TRUE if successful, FALSE otherwise. |
void couchdb_session_enable_authentication (CouchdbSession *session
,CouchdbCredentials *credentials
);
Enables authentication for the given CouchdbSession object. The authentication mechanism should be specificied when creating the CouchdbCredentials object.
|
A CouchdbSession object |
|
A CouchdbCredentials object |
void couchdb_session_disable_authentication
(CouchdbSession *session
);
Disables authentication for the given CouchdbSession object.
|
A CouchdbSession object |
gboolean couchdb_session_is_authentication_enabled
(CouchdbSession *session
);
Gets whether the given CouchdbSession object has authentication enabled.
|
A CouchdbSession object |
Returns : |
TRUE if authentication is enabled, FALSE otherwise. |
gboolean couchdb_session_replicate (CouchdbSession *session
,const gchar *source
,const gchar *target
,gboolean continous
,GError **error
);
Replicates a source database to another database, on the same CouchDB instance or on a remote instance.
If continous
is FALSE, the replication will happen once, but if set to TRUE,
CouchDB will listen to all changes made to the source database, and automatically
replicate over any new docs as the come into the source to the target.
|
A CouchdbSession object |
|
Source database |
|
Target database |
|
Whether to replicate once or keep replicating |
|
Placeholder for error information |
Returns : |
TRUE if successful, FALSE otherwise, in which case the error
parameter will be set to contain information about the error. |
"uri"
property"uri" gchar* : Read / Write / Construct
Uri pointing to the host to connect to.
Default value: NULL
"authentication-failed"
signalvoid user_function (CouchdbSession *couchdbsession,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"database-created"
signalvoid user_function (CouchdbSession *couchdbsession,
gchar *arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"database-deleted"
signalvoid user_function (CouchdbSession *couchdbsession,
gchar *arg1,
gpointer user_data) : Run Last
|
the object which received the signal. |
|
user data set when the signal handler was connected. |