The content of this page has been automatically translated by AI. If you encounter any problems while reading, you can view the corresponding content in Chinese.

dump

Last updated: 2024-10-15 17:41:08

Introduction

Full export of table data provides two methods: print to console or output to file.

Syntax

## Export specific fields
dump key1, key2, value1, value2 [into result.csv] from table limit 10;

## Export in XML format
dump * [into filename] from table limit 10 using tdr;

## Export in CSV format
dump * [into filename] from table limit 10;

Parameters

Parameters
Protobuf
TDR
Required
table
Table name
Table name
Yes
key
Primary key column name. All key values must be filled in
Primary key column name. All key values must be filled in
Yes
value
Non-primary key field name
Non-primary key field name
No
limit
LIST table: Export the number of keys, with one key corresponding to multiple records
GENERIC table: Export the number of records, with one key corresponding to one record
LIST table: Export the number of keys, with one key corresponding to multiple records
GENERIC table: Export the number of records, with one key corresponding to one record
No
using
Not supported.
Export data in XML format. The file structure must strictly adhere to XML syntax. This operation requires providing a TDR file when starting the client
No
into
Export data to a file
Export data to a file
No

Errors

Please refer to the error code list.

Example

tcaplus> dump * from table_list limit 0;
uin,name,key1,level,count,array_count,items,c_int8,c_uint8,c_int16,c_uint16,c_int32,c_uint32,c_int64,c_uint64,c_float,c_double,c_string,c_string_128K,c_string_256K,c_binary,binary,selector,single_struct,simple_struct,single_union_selector,single_union,array,c_union,union_array,c_struct,struct_array
99,"99",99,1,0,1,0x,-1,2,-3,4,-5,6,-7,0,1.234568,9.876543,"","123456789","123456789",0x,0,0,0x,0x,0,0x,0x,0x,0x,0x,0x
99,"99",99,1,0,1,0x,-1,2,-3,4,-5,6,-7,0,1.234568,9.876543,"","123456789","123456789",0x,0,0,0x,0x,0,0x,0x,0x,0x,0x,0x
99,"99",99,1,0,1,0x,-1,2,-3,4,-5,6,-7,0,1.234568,9.876543,"","123456789","123456789",0x,0,0,0x,0x,0,0x,0x,0x,0x,0x,0x
99,"99",99,1,0,1,0x,-1,2,-3,4,-5,6,-7,0,1.234568,9.876543,"","123456789","123456789",0x,0,0,0x,0x,0,0x,0x,0x,0x,0x,0x

dump 4 records successful

dump time: 121671 us

tcaplus> dump * into table_list.txt from table_list limit 0;

dumped 4 records successful

tcaplus> dump * into table_list.xml from table_list limit 0 using tdr;

dumped 4 records successful