Ferreteria/archive/v0.5/sql/node leaf

From Woozle Writes Code
< Ferreteria‎ | archive
Revision as of 17:14, 6 March 2022 by htyp>Woozle (Created page with "==About== * '''Purpose''': Values for nodes ==Concept== Every '''leaf''': * has ** a data type ** a name (unique within the node) ** a value * is like a single field in a sing...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

  • Purpose: Values for nodes

Concept

Every leaf:

  • has
    • a data type
    • a name (unique within the node)
    • a value
  • is like a single field in a single record

Fields

  • Type: name of type; caller code will maintain an index of leaf-handler classes (array[Type] => class_name)

History

SQL

CREATE TABLE `node_leaf` (
  `ID`      BIGINT        NOT NULL AUTO_INCREMENT,
  `ID_Node` BIGINT        NOT NULL COMMENT "ID of node to which this value belongs",
  `Name`    VARCHAR(255)  NOT NULL COMMENT "field name of this value",
  `Value`   LONGBLOB  DEFAULT NULL COMMENT "value",
  PRIMARY KEY(`ID`),
  UNIQUE KEY(`ID_Node`,`Name`)
) ENGINE=InnoDB;