MySQL NDB 集群 8.1 手册
MySQL NDB 集群 8.0 手册
NDB 集群内部手册
一个 TableMetadata
对象代表一个表。这是在 getTable()
回调中返回的对象。 indexes[0]
代表表的内在主键。
Press CTRL+C to copyTableMetadata = { database : "" , // Database name name : "" , // Table Name columns : {} , // ordered array of ColumnMetadata objects indexes : {} , // array of IndexMetadata objects partitionKey : {} , // ordered array of column numbers in the partition key };
ColumnMetadata
对象代表一个表列。
Press CTRL+C to copyColumnMetadata = { /* Required Properties */ name : "" , // column name columnNumber : -1 , // position of column in table, and in columns array columnType : "" , // a ColumnTypes value isIntegral : false , // true if column is some variety of INTEGER type isNullable : false , // true if NULLABLE isInPrimaryKey : false , // true if column is part of PK isInPartitionKey : false , // true if column is part of partition key columnSpace : 0 , // buffer space required for encoded stored value defaultValue : null , // default value for column: null for default NULL; // undefined for no default; or a type-appropriate // value for column /* Optional Properties, depending on columnType */ /* Group A: Numeric */ isUnsigned : false , // true for UNSIGNED intSize : null , // 1,2,3,4, or 8 if column type is INT scale : 0 , // DECIMAL scale precision : 0 , // DECIMAL precision isAutoincrement : false , // true for AUTO_INCREMENT columns /* Group B: Non-numeric */ length : 0 , // CHAR or VARCHAR length in characters isBinary : false , // true for BLOB/BINARY/VARBINARY charsetNumber : 0 , // internal number of charset charsetName : "" , // name of charset };
一个 IndexMetadata
对象代表一个表索引。 TableMetadata
的 indexes
数组包含每个表索引的一个 IndexMetadata
对象。
NDB
将主键实现为有序索引和唯一索引,并且可能通过 NDB API 适配器被视为两个索引,但通过 MySQL 适配器被视为一个同时是唯一索引和有序索引的索引。我们容忍这种差异,并注意到 Adapter/api
中的实现必须将这两个描述视为等效的。
Press CTRL+C to copyIndexMetadata = { name : "" , // Index name; undefined for PK isPrimaryKey : true , // true for PK; otherwise undefined isUnique : true , // true or false isOrdered : true , // true or false; can scan if true columns : null , // an ordered array of column numbers };
ColumnMetaData
对象的 columnType
必须是一个有效的 ColumnTypes
值,如本对象的定义所示。
Press CTRL+C to copyColumnTypes = [ "TINYINT", "SMALLINT", "MEDIUMINT", "INT", "BIGINT", "FLOAT", "DOUBLE", "DECIMAL", "CHAR", "VARCHAR", "BLOB", "TEXT", "DATE", "TIME", "DATETIME", "YEAR", "TIMESTAMP", "BIT", "BINARY", "VARBINARY" ];