Tablestore SDK for Go supports operations on the Wide Column model, TimeSeries model, and Timeline model.
Features
Before you use the SDK features, you must initialize a client. For more information about the features supported by the Go SDK, see the following table.
For more information about the Timeline model, see Timeline model.
Wide Column model
Feature type | Operation | Description |
You can create a data table to store data. You can configure data encryption and an auto-increment primary key column when you create a data table. | ||
You can update the configuration information of a table, such as the time to live (TTL) and max versions. | ||
You can query the names of all tables in an instance. | ||
You can query the configurations of a table. | ||
You can delete a table. | ||
You can write data to a data table in Tablestore. For example, you can write a single row of data, update a single row of data, and write multiple rows of data at the same time. | ||
You can read data from a data table in Tablestore. For example, you can read a single row of data, read multiple rows of data at the same time, and read data whose primary key values are within a specific range. | ||
You can delete data from a data table in Tablestore. For example, you can delete a single row of data or delete multiple rows of data at the same time. | ||
After you configure a filter, query results are filtered on the server side based on the filter conditions. Only rows of data that meet the filter conditions are returned. | ||
If you use conditional update, data in a table can be updated only when the conditions are met. Otherwise, the update fails and an error message is returned. | ||
The atomic counter feature allows you to specify a column as an atomic counter and perform atomic counter operations on the column. | ||
After you enable local transaction for a data table, you can create a local transaction based on a partition key value. You can read and write data in the local transaction and then commit or discard the local transaction based on your business requirements. | ||
You can create a search index for a data table. | ||
Query search indexes that are created for a table. | ||
Update the time to live (TTL) of a search index. | ||
Query the description of a search index, including the information about the fields in the search index and configurations of the search index. | ||
You can delete a search index that you no longer need. | ||
Delete historical data or extend the retention period of data in a search index based on business requirements. | ||
Basic query types include match all query, term query, terms query, prefix query, wildcard query, range query, exists query, collapse (distinct), geo query, and nested query. | ||
Query conditions can contain one or more subconditions. Tablestore determines whether data meets the query conditions based on the subconditions. | ||
When you use a search index to query data, you can specify a sorting method for the returned data. When many rows are returned, you can use offset-based paging or token-based paging to quickly locate the required data. | ||
You can perform aggregation operations to obtain the minimum value, maximum value, sum, average value, and count and distinct count of rows. You can also perform aggregation operations to group results by field value, range, geographical location, or filter. You can perform multiple aggregation operations for complex queries. | ||
Tablestore provides match query and match phrase query to implement full-text search. When you perform a query, data is matched based on tokenization. You can also use the highlight feature to highlight query strings. | ||
You can use the k-nearest neighbor (KNN) vector query feature to perform an approximate nearest neighbor search based on vectors. This way, you can find data items that have the highest similarity to the vector that you want to query in a large-scale dataset. | ||
If you do not want to sort the entire result set, you can use the parallel scan feature to return all matched data at a faster speed. | ||
You can create a secondary index for a data table. | ||
You can query data in a secondary index by reading a single row of data or reading data whose primary key values are within a specific range. If the required attribute columns are included in the secondary index, data can be directly read from the secondary index. Otherwise, data must be read from the data table. | ||
You can delete a specified secondary index from a data table. | ||
You can create a tunnel for a data table for real-time data consumption. | ||
You can list the information about all tunnels in a data table, such as the tunnel name, tunnel type, tunnel ID, tunnel stage, and whether the data is expired. | ||
You can obtain specific information about a tunnel, such as tunnel information and channel information in the tunnel. | ||
You can delete a tunnel from a data table. | ||
You can create a mapping table for an existing table or index. | ||
Add or remove attribute columns in an existing mapping table. | ||
Delete one or more mapping tables. | ||
You can list the mapping tables in the current database. | ||
You can query the description of a table, such as field names and field types. | ||
You can query the index description of a table. | ||
Query data in a table. | ||
After you query time type data (including Datetime, Date, and Time) by using SQL statements, you can obtain specific data based on your requirements. | ||
You can create a delivery task to ship data from a Tablestore data table to an OSS bucket for storage. | ||
You can list all delivery task information for a data table, such as the table name, delivery task name, and delivery task type. | ||
Query the descriptive information of a delivery task. | ||
Delete a delivery task. |
TimeSeries model
Feature type | Operation | Description |
Create a time series table to store time series data. | ||
You can update configurations of a time series table or time series metadata. | ||
You can view the names and configuration information of all time series tables in an instance. | ||
Query the information about a time series table, such as the TTL configuration. | ||
Delete a time series table. | ||
You can write time series data to a time series table in a batch. | ||
Query the time series data that meets the specified conditions in a specific time series. | ||
You can specify multiple conditions to retrieve time series information, such as the metric name and data source information. | ||
You can update time series metadata in a batch. | ||
You can delete time series metadata in a batch. | ||
You can create an analytical store for an existing time series table. | ||
Update the time to live (TTL) configuration for the data in an analytical store. After you update the TTL of an analytical store, Tablestore automatically cleans up data whose retention period exceeds the TTL of the analytical store asynchronously. | ||
You can query the description of an analytical store, such as the TTL configuration, data synchronization options, data synchronization status, and data storage size. | ||
You can delete an analytical store from a time series table. | ||
You can create a Lastpoint index for a time series table to quickly retrieve the latest time point data of each time series. | ||
You can query data in a Lastpoint index. | ||
You can use a search index that is created for a Lastpoint index to retrieve data in the Lastpoint index. Search indexes can be used to accelerate data retrieval for Lastpoint indexes and provide multi-dimensional query and statistical analysis capabilities. | ||
You can delete a Lastpoint index that you no longer require. | ||
You can create a mapping table for an existing table or index. | ||
Add or remove attribute columns in an existing mapping table. | ||
Delete one or more mapping tables. | ||
You can list the mapping tables in the current database. | ||
You can query the description of a table, such as field names and field types. | ||
You can query the index description of a table. | ||
Query data in a table. |
Version compatibility
The latest version is 1.17.x, which is compatible with all previous versions.
For more information about SDK version iterations, see Version history of Tablestore SDK for Go.
References
For more information about how to handle errors in Tablestore, see Error handling.