FAQ of Client

About Select

In versions above 3.55.0, the syntax of select is SQL-like, where statements support various Filter Conditions, and clients can analyze conditional expressions and make decisions to select different requests for query:

  • Match the primary key preferentially. That is, when the conditional expression contains the primary key, use the primary key to query
  • Match the local index second-first
  • If the table is configured with a global index, match the global index
  • If none of the above matches, consider the whole table traversal. At this time, select and dump are equivalent

String Escape

The string supports C-like character escape, such as \\, \t, \" and so on.

About the Data Modification of TDR Table

In the SDK of TDR table, Record data writing supports two methods

  • SetData supports the writing of the entire record in packages. TcaplusDB storage depends on the tdr table definition and can parse and interpret the contents in Data
  • SetValue supports setting the primary fields one by one and writing them in packages. TcaplusDB does not interpret the nested contents in the first-level fields, such as box.title

SetData is used with GetData, and SetValue is used with GetValue.

By default, the client's insert, replace, and update use SetValue to write data, and the corresponding select uses GetValue to output the data of each first-level field, while statements with the using tdr keyword can use SetData and GetData.

About Conditional Filtering

In versions above 3.55.0, select, update, and delete all support conditional filtering. See Detailed Syntax for details.The conditional expression must contain a primary key.

Note: For TDR tables, conditional filtering depends on the format resolution of TDR. When the conditional expression contains nested fields, such as WHERE key1=1 AND box.title="tcaplus", the data must be written by SetData, and the data written by SetValue cannot be parsed.

About Full Table Traversal

Full table traversal (dump) is inefficient and has adverse impact on online apps. Full table traversal must be used with caution for online apps with a large amount of data.

Full table traversal is performed on the slave copy by default.

About Data Export and Export

Currently, the supported data format is csv. For TDR tables, when the using tdr keyword is used in the statement, the tdr file in xml format will be exported

If the table has fields of complex type (array, structure)

  • TDR table, represented by hexadecimal prefixed with 0x in csv file
  • PB table, represented by json string in csv file

When using select into to export data, the export file may contain more than one record (because it is not necessarily a full primary key query). At present, insert into and replace into only support importing one record, and multiple records need to be imported using the corresponding load command.

results matching ""

    No results matching ""