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

From Woozle Writes Code
Jump to navigation Jump to search
m (Woozle moved page FileFerret/SQL/maps to FileFerret/SQL/map: singularizing)
m (Woozle moved page FileFerret/SQL/map to Ferret File System/v0.1/SQL/map: obsolete)
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
** '''isActive''': FALSE = this path is currently unavailable, so don't try to access it (e.g. volume might be removed, machine offline, etc.).
** '''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_Client''': host ID of the computer for which the given record applies
** '''ID_Folder''': {{l/fileferret|terms/volume|volume}}-relative 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.
*** 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.
*** 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 [[../hosts|host]] to the given [[../folders|folder]] (folder record specifies volume)
** '''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
** '''2016-02-27''' ID_Host -> ID_Client; added "isActive" flag; renamed from "maps" -> "map"
===Examples===
===Examples===
* '''Client''': Gonzo (ID=2) '''Folder''': / on volume SesTera '''URL''': /media/woozle/SesTera
* '''Client''': Gonzo (ID=2) '''Folder''': / on volume SesTera '''URL''': /media/woozle/SesTera
* '''Client''': Gonzo (ID=2) '''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,
   `isActive`    BOOL COMMENT "FALSE = cannot connect this way right now",
   `isActive`    BOOL COMMENT "FALSE = cannot connect this way right now",
   `ID_Client`  INT NOT NULL COMMENT "clients.ID",
   `ID_Client`  INT NOT NULL COMMENT "client.ID",
   `ID_Folder`  INT NOT NULL COMMENT "folders.ID",
   `ID_Folder`  INT NOT NULL COMMENT "folder.ID",
   `URL`        VARCHAR(255),
   `URL`        VARCHAR(255),
   PRIMARY KEY(`ID`)
   PRIMARY KEY(`ID`)

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