Ferret File System/v0.1/SQL/entry

From Woozle Writes Code
< Ferret File System‎ | v0.1‎ | SQL
Revision as of 17:17, 27 February 2016 by Woozle (talk | contribs) (Created page with "==About== * '''Purpose''': base table for files, folders, and possibly other types of entries ===fields=== * '''ID_Volume''' is the volume on which the folder appe...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

  • Purpose: base table for files, folders, and possibly other types of entries

fields

  • ID_Volume is the volume on which the folder appears.
    • NULL if volume is unknown -- e.g. we might not know what volume a remote Samba share is on. Not sure if this will be used.
  • Name is not the full path, just the entry's filename (and possibly .ext). If it is the root folder of a volume (ID_Parent IS NULL), then Name should not be included when constructing a path or filespec. Name must always be non-null, so this value is filled with something meaningless like "" if it is a root folder.

history

  • 2016-02-27 started

SQL

<mysql>CREATE TABLE `dirent` (

 `ID`          INT NOT NULL AUTO_INCREMENT,
 `ID_Volume`   INT DEFAULT NULL      COMMENT "volume on which this entry appears; NULL = unknown",
 `ID_Parent`   INT DEFAULT NULL      COMMENT "parent folder; NULL = filesystem root",
 `ID_Link`     INT DEFAULT NULL      COMMENT "NOT NULL = this is a link to another entry whose ID is ID_Link",
 `Name`        VARCHAR(255) NOT NULL COMMENT "filesystem's name for the entry",
 `WhenCreated` DATETIME DEFAULT NULL COMMENT "entry's creation timestamp, where available",
 `WhenChanged` DATETIME DEFAULT NULL COMMENT "entry's modification timestamp, where available",
 `didFind`     BOOL DEFAULT FALSE    COMMENT "TRUE = was found on most recent scan",
 `didRead`     BOOL DEFAULT FALSE    COMMENT "TRUE = filesystem allowed read access on last scan attempt",
 PRIMARY KEY(`ID`)

) ENGINE = INNODB;</mysql>