Appwrite C++ SDK
Auto-generated API documentation for the Appwrite C++ SDK
|
Provides CRUD operations for databases, collections, documents, attributes, and indexes. More...
#include <Databases.hpp>
Public Member Functions | |
std::string | create (const std::string &databaseId, const std::string &name, bool enabled) |
Create a new database. | |
std::string | createBooleanAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool defaultValue, bool required) |
Create a boolean attribute. | |
std::string | createCollection (const std::string &databaseId, const std::string &collectionId, const std::string &name, bool enabled) |
Create a new collection. | |
std::string | createDocument (const std::string &databaseId, const std::string &collectionId, const std::string &documentId, const std::string &rawData) |
Create a document in a collection. | |
std::string | createEmailAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, const std::string &defaultValue) |
Create an email attribute. | |
std::string | createEnumAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, const std::string &defaultValue, const std::vector< std::string > &elements) |
Create an enum attribute. | |
std::string | createFloatAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, double min, double max, const std::string &defaultValue) |
Create a float attribute. | |
std::string | createIndexes (const std::string &databaseId, const std::string &collectionId, const std::string &key, const std::string &type, const std::vector< std::string > &attributes) |
Create a new index. | |
std::string | createIntegerAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, int min, int max, const std::string &defaultValue) |
Create an integer attribute. | |
std::string | createIPaddressAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, const std::string &defaultValue) |
Create an IP address attribute. | |
std::string | createStringAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, const std::string &defaultValue, const std::vector< std::string > &elements, int size) |
Create a string attribute. | |
Databases (const std::string &projectId, const std::string &apiKey) | |
Constructor for Databases class. | |
std::string | deleteCollection (const std::string &databaseId, const std::string &collectionId) |
Delete a collection by ID. | |
std::string | deleteDocument (const std::string &databaseId, const std::string &collectionId, const std::string &documentId) |
Delete a document by ID. | |
std::string | deleteIndexes (const std::string &databaseId, const std::string &collectionId, const std::string &key) |
Delete an index. | |
std::string | get (const std::string &databaseId) |
Get a database by ID. | |
std::string | getCollection (const std::string &databaseId, const std::string &collectionId) |
Get a collection by ID. | |
std::string | getCollectionUsage (const std::string &databaseId, const std::string &collectionId, const std::string &range) |
Get usage stats of a collection. | |
std::string | getDatabaseUsage (const std::string &databaseId, const std::string &range) |
Get usage statistics of a database. | |
std::string | getDocument (const std::string &databaseId, const std::string &collectionId, const std::string &documentId) |
Get a document by ID. | |
std::string | getIndexes (const std::string &databaseId, const std::string &collectionId, const std::string &key) |
Get details of an index. | |
std::string | list () |
List all databases. | |
std::string | listAttributes (const std::string &databaseId, const std::string &collectionId) |
List all attributes in a collection. | |
std::string | listCollection (const std::string &databaseId) |
List all collections in a database. | |
std::string | listDocument (const std::string &databaseId, const std::string &collectionId, Queries &queries) |
List documents using queries. | |
std::string | listIndexes (const std::string &databaseId, const std::string &collectionId) |
List all indexes in a collection. | |
std::string | update (const std::string &databaseId, const std::string &name, bool enabled) |
Update an existing database. | |
std::string | updateBooleanAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool defaultValue, bool required, const std::string &new_key) |
Update a boolean attribute. | |
std::string | updateCollection (const std::string &databaseId, const std::string &collectionId, const std::string &name, bool enabled) |
Update collection metadata. | |
std::string | updateEmailAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, const std::string &defaultValue, std::string &new_key) |
Update an email attribute. | |
std::string | updateEnumAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, const std::string &defaultValue, const std::vector< std::string > &elements, std::string &new_key) |
Update an enum attribute. | |
std::string | updateFloatAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, double min, double max, const std::string &defaultValue, std::string &new_key) |
Update a float attribute. | |
std::string | updateIntegerAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, int min, int max, const std::string &defaultValue, std::string &new_key) |
Update an integer attribute. | |
std::string | updateIPaddressAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, const std::string &defaultValue, const std::string &new_key) |
Update an IP address attribute. | |
std::string | updateStringAttribute (const std::string &databaseId, const std::string &collectionId, const std::string &attributeId, bool required, const std::string &defaultValue, const std::vector< std::string > &elements, int size, std::string &new_key) |
Update a string attribute. | |
Provides CRUD operations for databases, collections, documents, attributes, and indexes.
Definition at line 19 of file Databases.hpp.
std::string Databases::create | ( | const std::string & | databaseId, |
const std::string & | name, | ||
bool | enabled | ||
) |
Create a new database.
databaseId | Unique ID for the new database. |
name | Name of the database. |
enabled | Whether the database is active. |
std::string Databases::createBooleanAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | defaultValue, | ||
bool | required | ||
) |
Create a boolean attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Unique ID for the attribute. |
defaultValue | Default value of the attribute. |
required | Whether this field is required. |
std::string Databases::createCollection | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | name, | ||
bool | enabled | ||
) |
Create a new collection.
databaseId | ID of the database. |
collectionId | Unique ID for the collection. |
name | Name of the collection. |
enabled | Whether the collection is enabled. |
std::string Databases::createDocument | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | documentId, | ||
const std::string & | rawData | ||
) |
Create a document in a collection.
databaseId | Database ID. |
collectionId | Collection ID. |
documentId | Document ID. |
rawData | JSON string of document data. |
std::string Databases::createEmailAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
const std::string & | defaultValue | ||
) |
Create an email attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
defaultValue | Default email. |
std::string Databases::createEnumAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
const std::string & | defaultValue, | ||
const std::vector< std::string > & | elements | ||
) |
Create an enum attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
defaultValue | Default value. |
elements | Valid enum values. |
std::string Databases::createFloatAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
double | min, | ||
double | max, | ||
const std::string & | defaultValue | ||
) |
Create a float attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
min | Minimum value. |
max | Maximum value. |
defaultValue | Default float value. |
std::string Databases::createIndexes | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | key, | ||
const std::string & | type, | ||
const std::vector< std::string > & | attributes | ||
) |
Create a new index.
databaseId | Database ID. |
collectionId | Collection ID. |
key | Index key name. |
type | Index type. |
attributes | Fields to index. |
std::string Databases::createIntegerAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
int | min, | ||
int | max, | ||
const std::string & | defaultValue | ||
) |
Create an integer attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
min | Minimum value. |
max | Maximum value. |
defaultValue | Default integer value. |
std::string Databases::createIPaddressAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
const std::string & | defaultValue | ||
) |
Create an IP address attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
defaultValue | Default IP address. |
std::string Databases::createStringAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
const std::string & | defaultValue, | ||
const std::vector< std::string > & | elements, | ||
int | size | ||
) |
Create a string attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
defaultValue | Default string value. |
elements | Allowed string values (for enum-like behavior). |
size | Maximum length of the string. |
std::string Databases::deleteCollection | ( | const std::string & | databaseId, |
const std::string & | collectionId | ||
) |
Delete a collection by ID.
databaseId | ID of the database. |
collectionId | ID of the collection. |
std::string Databases::deleteDocument | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | documentId | ||
) |
Delete a document by ID.
databaseId | Database ID. |
collectionId | Collection ID. |
documentId | Document ID. |
std::string Databases::deleteIndexes | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | key | ||
) |
Delete an index.
databaseId | Database ID. |
collectionId | Collection ID. |
key | Index key. |
std::string Databases::get | ( | const std::string & | databaseId | ) |
Get a database by ID.
databaseId | Unique ID of the database. |
std::string Databases::getCollection | ( | const std::string & | databaseId, |
const std::string & | collectionId | ||
) |
Get a collection by ID.
databaseId | ID of the database. |
collectionId | ID of the collection. |
std::string Databases::getCollectionUsage | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | range | ||
) |
Get usage stats of a collection.
databaseId | ID of the database. |
collectionId | ID of the collection. |
range | Time range for usage. |
std::string Databases::getDatabaseUsage | ( | const std::string & | databaseId, |
const std::string & | range | ||
) |
Get usage statistics of a database.
databaseId | ID of the database. |
range | Time range for usage stats. |
std::string Databases::getDocument | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | documentId | ||
) |
Get a document by ID.
databaseId | Database ID. |
collectionId | Collection ID. |
documentId | Document ID. |
std::string Databases::getIndexes | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | key | ||
) |
Get details of an index.
databaseId | Database ID. |
collectionId | Collection ID. |
key | Index key. |
std::string Databases::list | ( | ) |
List all databases.
std::string Databases::listAttributes | ( | const std::string & | databaseId, |
const std::string & | collectionId | ||
) |
List all attributes in a collection.
databaseId | ID of the database. |
collectionId | ID of the collection. |
std::string Databases::listCollection | ( | const std::string & | databaseId | ) |
List all collections in a database.
databaseId | ID of the database. |
std::string Databases::listDocument | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
Queries & | queries | ||
) |
List documents using queries.
databaseId | Database ID. |
collectionId | Collection ID. |
queries | Filter and sort queries. |
std::string Databases::listIndexes | ( | const std::string & | databaseId, |
const std::string & | collectionId | ||
) |
List all indexes in a collection.
databaseId | Database ID. |
collectionId | Collection ID. |
std::string Databases::update | ( | const std::string & | databaseId, |
const std::string & | name, | ||
bool | enabled | ||
) |
Update an existing database.
databaseId | ID of the database to update. |
name | New name of the database. |
enabled | Enable or disable the database. |
std::string Databases::updateBooleanAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | defaultValue, | ||
bool | required, | ||
const std::string & | new_key | ||
) |
Update a boolean attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
defaultValue | New default value. |
required | Required field. |
new_key | New key for the attribute. |
std::string Databases::updateCollection | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | name, | ||
bool | enabled | ||
) |
Update collection metadata.
databaseId | ID of the database. |
collectionId | ID of the collection. |
name | New name of the collection. |
enabled | New status of the collection. |
std::string Databases::updateEmailAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
const std::string & | defaultValue, | ||
std::string & | new_key | ||
) |
Update an email attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
defaultValue | New default email. |
new_key | New key for the attribute. |
std::string Databases::updateEnumAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
const std::string & | defaultValue, | ||
const std::vector< std::string > & | elements, | ||
std::string & | new_key | ||
) |
Update an enum attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
defaultValue | New default value. |
elements | Allowed values. |
new_key | New key for the attribute. |
std::string Databases::updateFloatAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
double | min, | ||
double | max, | ||
const std::string & | defaultValue, | ||
std::string & | new_key | ||
) |
Update a float attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
min | Minimum value. |
max | Maximum value. |
defaultValue | New default value. |
new_key | New key for the attribute. |
std::string Databases::updateIntegerAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
int | min, | ||
int | max, | ||
const std::string & | defaultValue, | ||
std::string & | new_key | ||
) |
Update an integer attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
min | Minimum value. |
max | Maximum value. |
defaultValue | New default value. |
new_key | New key for the attribute. |
std::string Databases::updateIPaddressAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
const std::string & | defaultValue, | ||
const std::string & | new_key | ||
) |
Update an IP address attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
defaultValue | New default IP address. |
new_key | New key for the attribute. |
std::string Databases::updateStringAttribute | ( | const std::string & | databaseId, |
const std::string & | collectionId, | ||
const std::string & | attributeId, | ||
bool | required, | ||
const std::string & | defaultValue, | ||
const std::vector< std::string > & | elements, | ||
int | size, | ||
std::string & | new_key | ||
) |
Update a string attribute.
databaseId | Database ID. |
collectionId | Collection ID. |
attributeId | Attribute ID. |
required | Required field. |
defaultValue | New default value. |
elements | Allowed string values. |
size | Maximum length. |
new_key | New key for the attribute. |