pub struct TablesDB { /* private fields */ }Implementations§
Source§impl TablesDB
impl TablesDB
pub fn new(client: &Client) -> Self
pub fn client(&self) -> &Client
Sourcepub async fn list(
&self,
queries: Option<Vec<String>>,
search: Option<&str>,
total: Option<bool>,
) -> Result<DatabaseList>
pub async fn list( &self, queries: Option<Vec<String>>, search: Option<&str>, total: Option<bool>, ) -> Result<DatabaseList>
Get a list of all databases from the current Appwrite project. You can use the search parameter to filter your results.
Sourcepub async fn create(
&self,
database_id: impl Into<String>,
name: impl Into<String>,
enabled: Option<bool>,
) -> Result<Database>
pub async fn create( &self, database_id: impl Into<String>, name: impl Into<String>, enabled: Option<bool>, ) -> Result<Database>
Create a new Database.
Sourcepub async fn list_transactions(
&self,
queries: Option<Vec<String>>,
) -> Result<TransactionList>
pub async fn list_transactions( &self, queries: Option<Vec<String>>, ) -> Result<TransactionList>
List transactions across all databases.
Sourcepub async fn create_transaction(&self, ttl: Option<i64>) -> Result<Transaction>
pub async fn create_transaction(&self, ttl: Option<i64>) -> Result<Transaction>
Create a new transaction.
Sourcepub async fn get_transaction(
&self,
transaction_id: impl Into<String>,
) -> Result<Transaction>
pub async fn get_transaction( &self, transaction_id: impl Into<String>, ) -> Result<Transaction>
Get a transaction by its unique ID.
Sourcepub async fn update_transaction(
&self,
transaction_id: impl Into<String>,
commit: Option<bool>,
rollback: Option<bool>,
) -> Result<Transaction>
pub async fn update_transaction( &self, transaction_id: impl Into<String>, commit: Option<bool>, rollback: Option<bool>, ) -> Result<Transaction>
Update a transaction, to either commit or roll back its operations.
Sourcepub async fn delete_transaction(
&self,
transaction_id: impl Into<String>,
) -> Result<()>
pub async fn delete_transaction( &self, transaction_id: impl Into<String>, ) -> Result<()>
Delete a transaction by its unique ID.
Sourcepub async fn create_operations(
&self,
transaction_id: impl Into<String>,
operations: Option<Vec<Value>>,
) -> Result<Transaction>
pub async fn create_operations( &self, transaction_id: impl Into<String>, operations: Option<Vec<Value>>, ) -> Result<Transaction>
Create multiple operations in a single transaction.
Sourcepub async fn get(&self, database_id: impl Into<String>) -> Result<Database>
pub async fn get(&self, database_id: impl Into<String>) -> Result<Database>
Get a database by its unique ID. This endpoint response returns a JSON object with the database metadata.
Sourcepub async fn update(
&self,
database_id: impl Into<String>,
name: Option<&str>,
enabled: Option<bool>,
) -> Result<Database>
pub async fn update( &self, database_id: impl Into<String>, name: Option<&str>, enabled: Option<bool>, ) -> Result<Database>
Update a database by its unique ID.
Sourcepub async fn delete(&self, database_id: impl Into<String>) -> Result<()>
pub async fn delete(&self, database_id: impl Into<String>) -> Result<()>
Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
Sourcepub async fn list_tables(
&self,
database_id: impl Into<String>,
queries: Option<Vec<String>>,
search: Option<&str>,
total: Option<bool>,
) -> Result<TableList>
pub async fn list_tables( &self, database_id: impl Into<String>, queries: Option<Vec<String>>, search: Option<&str>, total: Option<bool>, ) -> Result<TableList>
Get a list of all tables that belong to the provided databaseId. You can use the search parameter to filter your results.
Sourcepub async fn create_table(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
name: impl Into<String>,
permissions: Option<Vec<String>>,
row_security: Option<bool>,
enabled: Option<bool>,
columns: Option<Vec<Value>>,
indexes: Option<Vec<Value>>,
) -> Result<Table>
pub async fn create_table( &self, database_id: impl Into<String>, table_id: impl Into<String>, name: impl Into<String>, permissions: Option<Vec<String>>, row_security: Option<bool>, enabled: Option<bool>, columns: Option<Vec<Value>>, indexes: Option<Vec<Value>>, ) -> Result<Table>
Create a new Table. Before using this route, you should create a new database resource using either a server integration API or directly from your database console.
Sourcepub async fn get_table(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
) -> Result<Table>
pub async fn get_table( &self, database_id: impl Into<String>, table_id: impl Into<String>, ) -> Result<Table>
Get a table by its unique ID. This endpoint response returns a JSON object with the table metadata.
Sourcepub async fn update_table(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
name: Option<&str>,
permissions: Option<Vec<String>>,
row_security: Option<bool>,
enabled: Option<bool>,
purge: Option<bool>,
) -> Result<Table>
pub async fn update_table( &self, database_id: impl Into<String>, table_id: impl Into<String>, name: Option<&str>, permissions: Option<Vec<String>>, row_security: Option<bool>, enabled: Option<bool>, purge: Option<bool>, ) -> Result<Table>
Update a table by its unique ID.
Sourcepub async fn delete_table(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
) -> Result<()>
pub async fn delete_table( &self, database_id: impl Into<String>, table_id: impl Into<String>, ) -> Result<()>
Delete a table by its unique ID. Only users with write permissions have access to delete this resource.
Sourcepub async fn list_columns(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
queries: Option<Vec<String>>,
total: Option<bool>,
) -> Result<ColumnList>
pub async fn list_columns( &self, database_id: impl Into<String>, table_id: impl Into<String>, queries: Option<Vec<String>>, total: Option<bool>, ) -> Result<ColumnList>
List columns in the table.
Sourcepub async fn create_boolean_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<bool>,
array: Option<bool>,
) -> Result<ColumnBoolean>
pub async fn create_boolean_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<bool>, array: Option<bool>, ) -> Result<ColumnBoolean>
Create a boolean column.
Sourcepub async fn update_boolean_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<bool>,
new_key: Option<&str>,
) -> Result<ColumnBoolean>
pub async fn update_boolean_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<bool>, new_key: Option<&str>, ) -> Result<ColumnBoolean>
Update a boolean column. Changing the default value will not update
already existing rows.
Sourcepub async fn create_datetime_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
array: Option<bool>,
) -> Result<ColumnDatetime>
pub async fn create_datetime_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, array: Option<bool>, ) -> Result<ColumnDatetime>
Create a date time column according to the ISO 8601 standard.
Sourcepub async fn update_datetime_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
new_key: Option<&str>,
) -> Result<ColumnDatetime>
pub async fn update_datetime_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, new_key: Option<&str>, ) -> Result<ColumnDatetime>
Update a date time column. Changing the default value will not update
already existing rows.
Sourcepub async fn create_email_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
array: Option<bool>,
) -> Result<ColumnEmail>
pub async fn create_email_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, array: Option<bool>, ) -> Result<ColumnEmail>
Create an email column.
Sourcepub async fn update_email_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
new_key: Option<&str>,
) -> Result<ColumnEmail>
pub async fn update_email_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, new_key: Option<&str>, ) -> Result<ColumnEmail>
Update an email column. Changing the default value will not update
already existing rows.
Sourcepub async fn create_enum_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
elements: impl IntoIterator<Item = impl Into<String>>,
required: bool,
default: Option<&str>,
array: Option<bool>,
) -> Result<ColumnEnum>
pub async fn create_enum_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, elements: impl IntoIterator<Item = impl Into<String>>, required: bool, default: Option<&str>, array: Option<bool>, ) -> Result<ColumnEnum>
Create an enumeration column. The elements param acts as a white-list of
accepted values for this column.
Sourcepub async fn update_enum_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
elements: impl IntoIterator<Item = impl Into<String>>,
required: bool,
default: Option<&str>,
new_key: Option<&str>,
) -> Result<ColumnEnum>
pub async fn update_enum_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, elements: impl IntoIterator<Item = impl Into<String>>, required: bool, default: Option<&str>, new_key: Option<&str>, ) -> Result<ColumnEnum>
Update an enum column. Changing the default value will not update already
existing rows.
Sourcepub async fn create_float_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
min: Option<f64>,
max: Option<f64>,
default: Option<f64>,
array: Option<bool>,
) -> Result<ColumnFloat>
pub async fn create_float_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, min: Option<f64>, max: Option<f64>, default: Option<f64>, array: Option<bool>, ) -> Result<ColumnFloat>
Create a float column. Optionally, minimum and maximum values can be provided.
Sourcepub async fn update_float_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<f64>,
min: Option<f64>,
max: Option<f64>,
new_key: Option<&str>,
) -> Result<ColumnFloat>
pub async fn update_float_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<f64>, min: Option<f64>, max: Option<f64>, new_key: Option<&str>, ) -> Result<ColumnFloat>
Update a float column. Changing the default value will not update already
existing rows.
Sourcepub async fn create_integer_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
min: Option<i64>,
max: Option<i64>,
default: Option<i64>,
array: Option<bool>,
) -> Result<ColumnInteger>
pub async fn create_integer_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, min: Option<i64>, max: Option<i64>, default: Option<i64>, array: Option<bool>, ) -> Result<ColumnInteger>
Create an integer column. Optionally, minimum and maximum values can be provided.
Sourcepub async fn update_integer_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<i64>,
min: Option<i64>,
max: Option<i64>,
new_key: Option<&str>,
) -> Result<ColumnInteger>
pub async fn update_integer_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<i64>, min: Option<i64>, max: Option<i64>, new_key: Option<&str>, ) -> Result<ColumnInteger>
Update an integer column. Changing the default value will not update
already existing rows.
Sourcepub async fn create_ip_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
array: Option<bool>,
) -> Result<ColumnIp>
pub async fn create_ip_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, array: Option<bool>, ) -> Result<ColumnIp>
Create IP address column.
Sourcepub async fn update_ip_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
new_key: Option<&str>,
) -> Result<ColumnIp>
pub async fn update_ip_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, new_key: Option<&str>, ) -> Result<ColumnIp>
Update an ip column. Changing the default value will not update already
existing rows.
Sourcepub async fn create_line_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<Vec<String>>,
) -> Result<ColumnLine>
pub async fn create_line_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<Vec<String>>, ) -> Result<ColumnLine>
Create a geometric line column.
Sourcepub async fn update_line_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<Vec<String>>,
new_key: Option<&str>,
) -> Result<ColumnLine>
pub async fn update_line_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<Vec<String>>, new_key: Option<&str>, ) -> Result<ColumnLine>
Update a line column. Changing the default value will not update already
existing rows.
Sourcepub async fn create_longtext_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
array: Option<bool>,
encrypt: Option<bool>,
) -> Result<ColumnLongtext>
pub async fn create_longtext_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, array: Option<bool>, encrypt: Option<bool>, ) -> Result<ColumnLongtext>
Create a longtext column.
Sourcepub async fn update_longtext_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
new_key: Option<&str>,
) -> Result<ColumnLongtext>
pub async fn update_longtext_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, new_key: Option<&str>, ) -> Result<ColumnLongtext>
Update a longtext column. Changing the default value will not update
already existing rows.
Sourcepub async fn create_mediumtext_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
array: Option<bool>,
encrypt: Option<bool>,
) -> Result<ColumnMediumtext>
pub async fn create_mediumtext_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, array: Option<bool>, encrypt: Option<bool>, ) -> Result<ColumnMediumtext>
Create a mediumtext column.
Sourcepub async fn update_mediumtext_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
new_key: Option<&str>,
) -> Result<ColumnMediumtext>
pub async fn update_mediumtext_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, new_key: Option<&str>, ) -> Result<ColumnMediumtext>
Update a mediumtext column. Changing the default value will not update
already existing rows.
Sourcepub async fn create_point_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<Vec<String>>,
) -> Result<ColumnPoint>
pub async fn create_point_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<Vec<String>>, ) -> Result<ColumnPoint>
Create a geometric point column.
Sourcepub async fn update_point_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<Vec<String>>,
new_key: Option<&str>,
) -> Result<ColumnPoint>
pub async fn update_point_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<Vec<String>>, new_key: Option<&str>, ) -> Result<ColumnPoint>
Update a point column. Changing the default value will not update already
existing rows.
Sourcepub async fn create_polygon_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<Vec<String>>,
) -> Result<ColumnPolygon>
pub async fn create_polygon_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<Vec<String>>, ) -> Result<ColumnPolygon>
Create a geometric polygon column.
Sourcepub async fn update_polygon_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<Vec<String>>,
new_key: Option<&str>,
) -> Result<ColumnPolygon>
pub async fn update_polygon_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<Vec<String>>, new_key: Option<&str>, ) -> Result<ColumnPolygon>
Update a polygon column. Changing the default value will not update
already existing rows.
Sourcepub async fn create_relationship_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
related_table_id: impl Into<String>,
type: RelationshipType,
two_way: Option<bool>,
key: Option<&str>,
two_way_key: Option<&str>,
on_delete: Option<RelationMutate>,
) -> Result<ColumnRelationship>
pub async fn create_relationship_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, related_table_id: impl Into<String>, type: RelationshipType, two_way: Option<bool>, key: Option<&str>, two_way_key: Option<&str>, on_delete: Option<RelationMutate>, ) -> Result<ColumnRelationship>
Create relationship column. Learn more about relationship columns.
Sourcepub async fn create_string_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
size: i64,
required: bool,
default: Option<&str>,
array: Option<bool>,
encrypt: Option<bool>,
) -> Result<ColumnString>
pub async fn create_string_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, size: i64, required: bool, default: Option<&str>, array: Option<bool>, encrypt: Option<bool>, ) -> Result<ColumnString>
Create a string column.
Sourcepub async fn update_string_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
size: Option<i64>,
new_key: Option<&str>,
) -> Result<ColumnString>
pub async fn update_string_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, size: Option<i64>, new_key: Option<&str>, ) -> Result<ColumnString>
Update a string column. Changing the default value will not update
already existing rows.
Sourcepub async fn create_text_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
array: Option<bool>,
encrypt: Option<bool>,
) -> Result<ColumnText>
pub async fn create_text_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, array: Option<bool>, encrypt: Option<bool>, ) -> Result<ColumnText>
Create a text column.
Sourcepub async fn update_text_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
new_key: Option<&str>,
) -> Result<ColumnText>
pub async fn update_text_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, new_key: Option<&str>, ) -> Result<ColumnText>
Update a text column. Changing the default value will not update already
existing rows.
Sourcepub async fn create_url_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
array: Option<bool>,
) -> Result<ColumnUrl>
pub async fn create_url_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, array: Option<bool>, ) -> Result<ColumnUrl>
Create a URL column.
Sourcepub async fn update_url_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
new_key: Option<&str>,
) -> Result<ColumnUrl>
pub async fn update_url_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, new_key: Option<&str>, ) -> Result<ColumnUrl>
Update an url column. Changing the default value will not update already
existing rows.
Sourcepub async fn create_varchar_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
size: i64,
required: bool,
default: Option<&str>,
array: Option<bool>,
encrypt: Option<bool>,
) -> Result<ColumnVarchar>
pub async fn create_varchar_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, size: i64, required: bool, default: Option<&str>, array: Option<bool>, encrypt: Option<bool>, ) -> Result<ColumnVarchar>
Create a varchar column.
Sourcepub async fn update_varchar_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
required: bool,
default: Option<&str>,
size: Option<i64>,
new_key: Option<&str>,
) -> Result<ColumnVarchar>
pub async fn update_varchar_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, required: bool, default: Option<&str>, size: Option<i64>, new_key: Option<&str>, ) -> Result<ColumnVarchar>
Update a varchar column. Changing the default value will not update
already existing rows.
Sourcepub async fn get_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
) -> Result<Value>
pub async fn get_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, ) -> Result<Value>
Get column by ID.
Sourcepub async fn delete_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
) -> Result<()>
pub async fn delete_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, ) -> Result<()>
Deletes a column.
Sourcepub async fn update_relationship_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
on_delete: Option<RelationMutate>,
new_key: Option<&str>,
) -> Result<ColumnRelationship>
pub async fn update_relationship_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, on_delete: Option<RelationMutate>, new_key: Option<&str>, ) -> Result<ColumnRelationship>
Update relationship column. Learn more about relationship columns.
Sourcepub async fn list_indexes(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
queries: Option<Vec<String>>,
total: Option<bool>,
) -> Result<ColumnIndexList>
pub async fn list_indexes( &self, database_id: impl Into<String>, table_id: impl Into<String>, queries: Option<Vec<String>>, total: Option<bool>, ) -> Result<ColumnIndexList>
List indexes on the table.
Sourcepub async fn create_index(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
type: TablesDBIndexType,
columns: impl IntoIterator<Item = impl Into<String>>,
orders: Option<Vec<OrderBy>>,
lengths: Option<Vec<i64>>,
) -> Result<ColumnIndex>
pub async fn create_index( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, type: TablesDBIndexType, columns: impl IntoIterator<Item = impl Into<String>>, orders: Option<Vec<OrderBy>>, lengths: Option<Vec<i64>>, ) -> Result<ColumnIndex>
Creates an index on the columns listed. Your index should include all the
columns you will query in a single request.
Type can be key, fulltext, or unique.
Sourcepub async fn get_index(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
) -> Result<ColumnIndex>
pub async fn get_index( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, ) -> Result<ColumnIndex>
Get index by ID.
Sourcepub async fn delete_index(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
key: impl Into<String>,
) -> Result<()>
pub async fn delete_index( &self, database_id: impl Into<String>, table_id: impl Into<String>, key: impl Into<String>, ) -> Result<()>
Delete an index.
Sourcepub async fn list_rows(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
queries: Option<Vec<String>>,
transaction_id: Option<&str>,
total: Option<bool>,
ttl: Option<i64>,
) -> Result<RowList>
pub async fn list_rows( &self, database_id: impl Into<String>, table_id: impl Into<String>, queries: Option<Vec<String>>, transaction_id: Option<&str>, total: Option<bool>, ttl: Option<i64>, ) -> Result<RowList>
Get a list of all the user’s rows in a given table. You can use the query params to filter your results.
Sourcepub async fn create_row(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
row_id: impl Into<String>,
data: Value,
permissions: Option<Vec<String>>,
transaction_id: Option<&str>,
) -> Result<Row>
pub async fn create_row( &self, database_id: impl Into<String>, table_id: impl Into<String>, row_id: impl Into<String>, data: Value, permissions: Option<Vec<String>>, transaction_id: Option<&str>, ) -> Result<Row>
Create a new Row. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.
Sourcepub async fn create_rows(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
rows: Vec<Value>,
transaction_id: Option<&str>,
) -> Result<RowList>
pub async fn create_rows( &self, database_id: impl Into<String>, table_id: impl Into<String>, rows: Vec<Value>, transaction_id: Option<&str>, ) -> Result<RowList>
Create new Rows. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.
Sourcepub async fn upsert_rows(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
rows: Vec<Value>,
transaction_id: Option<&str>,
) -> Result<RowList>
pub async fn upsert_rows( &self, database_id: impl Into<String>, table_id: impl Into<String>, rows: Vec<Value>, transaction_id: Option<&str>, ) -> Result<RowList>
Create or update Rows. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.
Sourcepub async fn update_rows(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
data: Option<Value>,
queries: Option<Vec<String>>,
transaction_id: Option<&str>,
) -> Result<RowList>
pub async fn update_rows( &self, database_id: impl Into<String>, table_id: impl Into<String>, data: Option<Value>, queries: Option<Vec<String>>, transaction_id: Option<&str>, ) -> Result<RowList>
Update all rows that match your queries, if no queries are submitted then all rows are updated. You can pass only specific fields to be updated.
Sourcepub async fn delete_rows(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
queries: Option<Vec<String>>,
transaction_id: Option<&str>,
) -> Result<RowList>
pub async fn delete_rows( &self, database_id: impl Into<String>, table_id: impl Into<String>, queries: Option<Vec<String>>, transaction_id: Option<&str>, ) -> Result<RowList>
Bulk delete rows using queries, if no queries are passed then all rows are deleted.
Sourcepub async fn get_row(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
row_id: impl Into<String>,
queries: Option<Vec<String>>,
transaction_id: Option<&str>,
) -> Result<Row>
pub async fn get_row( &self, database_id: impl Into<String>, table_id: impl Into<String>, row_id: impl Into<String>, queries: Option<Vec<String>>, transaction_id: Option<&str>, ) -> Result<Row>
Get a row by its unique ID. This endpoint response returns a JSON object with the row data.
Sourcepub async fn upsert_row(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
row_id: impl Into<String>,
data: Option<Value>,
permissions: Option<Vec<String>>,
transaction_id: Option<&str>,
) -> Result<Row>
pub async fn upsert_row( &self, database_id: impl Into<String>, table_id: impl Into<String>, row_id: impl Into<String>, data: Option<Value>, permissions: Option<Vec<String>>, transaction_id: Option<&str>, ) -> Result<Row>
Create or update a Row. Before using this route, you should create a new table resource using either a server integration API or directly from your database console.
Sourcepub async fn update_row(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
row_id: impl Into<String>,
data: Option<Value>,
permissions: Option<Vec<String>>,
transaction_id: Option<&str>,
) -> Result<Row>
pub async fn update_row( &self, database_id: impl Into<String>, table_id: impl Into<String>, row_id: impl Into<String>, data: Option<Value>, permissions: Option<Vec<String>>, transaction_id: Option<&str>, ) -> Result<Row>
Update a row by its unique ID. Using the patch method you can pass only specific fields that will get updated.
Sourcepub async fn delete_row(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
row_id: impl Into<String>,
transaction_id: Option<&str>,
) -> Result<()>
pub async fn delete_row( &self, database_id: impl Into<String>, table_id: impl Into<String>, row_id: impl Into<String>, transaction_id: Option<&str>, ) -> Result<()>
Delete a row by its unique ID.
Sourcepub async fn decrement_row_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
row_id: impl Into<String>,
column: impl Into<String>,
value: Option<f64>,
min: Option<f64>,
transaction_id: Option<&str>,
) -> Result<Row>
pub async fn decrement_row_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, row_id: impl Into<String>, column: impl Into<String>, value: Option<f64>, min: Option<f64>, transaction_id: Option<&str>, ) -> Result<Row>
Decrement a specific column of a row by a given value.
Sourcepub async fn increment_row_column(
&self,
database_id: impl Into<String>,
table_id: impl Into<String>,
row_id: impl Into<String>,
column: impl Into<String>,
value: Option<f64>,
max: Option<f64>,
transaction_id: Option<&str>,
) -> Result<Row>
pub async fn increment_row_column( &self, database_id: impl Into<String>, table_id: impl Into<String>, row_id: impl Into<String>, column: impl Into<String>, value: Option<f64>, max: Option<f64>, transaction_id: Option<&str>, ) -> Result<Row>
Increment a specific column of a row by a given value.