Ferret File System/v0.1/SQL/map: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(redesign)
m (Woozle moved page FileFerret/SQL/map to Ferret File System/v0.1/SQL/map: obsolete)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
==About==
==About==
* '''Purpose''': tracks methods of accessing folders on remote hosts, across different FileFerret clients. This is necessary because the root folder of some volumes may not be visible; we only have visibility within one or more specific folders. It is similar to the concept of "mount points"
* '''Purpose''': tracks {{l/fileferret|terms/map|methods of accessing volumes}} on local or remote hosts, across different FileFerret clients. It is similar to the concept of "mount points"
** Each FileFerret client looks itself up in the {{l/same|hosts}} table to get its host ID, then filters this table by looking only at records with a matching ID_Host.
** Each FileFerret client looks itself up in the {{l/same|clients}} table to get its client ID, then filters this table by looking only at records whose ID_Client matches.
* '''Future''':
** Although URL should be a unique key most of the time, it's possible that different removable drives might map to the same mountpoint. There's probably a good way to handle this. For now, we'll just assume the user will inform FF when the volume changes, or possibly that we can detect the UUID of the volume at any given mountpoint in order to be sure it's the one we're expecting.
* '''Fields''':
* '''Fields''':
** '''ID_Host''': host ID of the computer for which the given record applies
** '''isActive''': FALSE = this path is currently unavailable, so don't try to access it (e.g. volume might be removed, machine offline, etc.).
** '''URL''': path from the given [[../hosts|host]] to the given [[../folders|folder]] (folder record specifies volume)
** '''ID_Client''': host ID of the computer for which the given record applies
** '''ID_Folder''': folder which the given path allows us to access from the given host
** '''ID_Folder''': {{l/same|volume}}-relative folder which the given path allows us to access from the given host
*** Some volumes may have limited access from some clients, e.g. a volume physically located on client A may only expose a particular set of subfolders to machine B. (This is especially true when using Windows/[[Samba]] shares.) Also, most drives will hide some folders from any user that isn't root.
*** For now, we're just assuming that all remote access is being done via sftp, logging in as root, so this will always point to the volume's root folder.
** '''URL''': path from the given {{l/same|client}} to the given {{l/same|folder}} (folder record specifies volume)
* '''History''':
* '''History''':
** '''2013-06-30''' redesigning for Linux's more powerful remote access methods
** '''2013-06-30''' redesigning for Linux's more powerful remote access methods
** '''2016-02-27''' ID_Host -> ID_Client; added "isActive" flag; renamed from "maps" -> "map"
===Examples===
===Examples===
* '''Host''': 2 (Gonzo) '''Folder''': / on volume SesTera '''URL''': /media/woozle/SesTera
* '''Client''': Gonzo (ID=2) '''Folder''': / on volume SesTera '''URL''': /media/woozle/SesTera
* '''Host''': 2 (Gonzo) '''Folder''': / on volume BunsenMain '''URL''': sftp://root@bunsen/
* '''Client''': Gonzo (ID=2) '''Folder''': / on volume BunsenMain '''URL''': sftp://root@bunsen/
==SQL==
==SQL==
<mysql>CREATE TABLE `maps` (
<mysql>CREATE TABLE `map` (
   `ID`          INT NOT NULL AUTO_INCREMENT,
   `ID`          INT NOT NULL AUTO_INCREMENT,
   `ID_Host`     INT NOT NULL COMMENT "hosts.ID",
   `isActive`   BOOL COMMENT "FALSE = cannot connect this way right now",
   `ID_Folder`  INT NOT NULL COMMENT "folders.ID",
  `ID_Client`  INT NOT NULL COMMENT "client.ID",
   `ID_Folder`  INT NOT NULL COMMENT "folder.ID",
   `URL`        VARCHAR(255),
   `URL`        VARCHAR(255),
   PRIMARY KEY(`ID`)
   PRIMARY KEY(`ID`)
)
)
ENGINE = MYISAM;</mysql>
ENGINE = MYISAM;</mysql>
==Obsolete==
This design made more sense for a Windows-only network, where drive root folders were rarely accessible.


* '''Fields''':
Old version: [[/archive]]
** '''ID_Host''': host ID of the computer to whom each map applies
** '''FileSpec''': absolute path to the root of the map (aka mount point) being described
 
<mysql>CREATE TABLE `maps` (
  `ID`          INT NOT NULL AUTO_INCREMENT,
  `ID_Folder`  INT NOT NULL COMMENT "folders.ID",
  `ID_Host`    INT NOT NULL COMMENT "hosts.ID",
  `Name`        VARCHAR(63) NOT NULL COMMENT "short name for lists",
  `Descr`      VARCHAR(255) DEFAULT NULL COMMENT "longer description",
  `FileSpec`    VARCHAR(255) NOT NULL COMMENT "must not have terminating slash; will be used as prefix for folder chains",
  `isPrimary`  BOOL DEFAULT FALSE COMMENT "is Host primarily responsible for maintaining (scanning) this Folder?",
  `isDrive`    BOOL DEFAULT FALSE COMMENT "TRUE = can be queried for volume and capacity information; may be removable.",
  PRIMARY KEY(`ID`)
)
ENGINE = MYISAM;</mysql>

Latest revision as of 13:40, 25 February 2024

About

  • Purpose: tracks methods of accessing volumes on local or remote hosts, across different FileFerret clients. It is similar to the concept of "mount points"
    • Each FileFerret client looks itself up in the clients table to get its client ID, then filters this table by looking only at records whose ID_Client matches.
  • Future:
    • Although URL should be a unique key most of the time, it's possible that different removable drives might map to the same mountpoint. There's probably a good way to handle this. For now, we'll just assume the user will inform FF when the volume changes, or possibly that we can detect the UUID of the volume at any given mountpoint in order to be sure it's the one we're expecting.
  • Fields:
    • isActive: FALSE = this path is currently unavailable, so don't try to access it (e.g. volume might be removed, machine offline, etc.).
    • ID_Client: host ID of the computer for which the given record applies
    • ID_Folder: volume-relative folder which the given path allows us to access from the given host
      • Some volumes may have limited access from some clients, e.g. a volume physically located on client A may only expose a particular set of subfolders to machine B. (This is especially true when using Windows/Samba shares.) Also, most drives will hide some folders from any user that isn't root.
      • For now, we're just assuming that all remote access is being done via sftp, logging in as root, so this will always point to the volume's root folder.
    • URL: path from the given client to the given folder (folder record specifies volume)
  • History:
    • 2013-06-30 redesigning for Linux's more powerful remote access methods
    • 2016-02-27 ID_Host -> ID_Client; added "isActive" flag; renamed from "maps" -> "map"

Examples

  • Client: Gonzo (ID=2) Folder: / on volume SesTera URL: /media/woozle/SesTera
  • Client: Gonzo (ID=2) Folder: / on volume BunsenMain URL: sftp://root@bunsen/

SQL

<mysql>CREATE TABLE `map` (

 `ID`          INT NOT NULL AUTO_INCREMENT,
 `isActive`    BOOL COMMENT "FALSE = cannot connect this way right now",
 `ID_Client`   INT NOT NULL COMMENT "client.ID",
 `ID_Folder`   INT NOT NULL COMMENT "folder.ID",
 `URL`         VARCHAR(255),
 PRIMARY KEY(`ID`)

) ENGINE = MYISAM;</mysql>

Old version: /archive