Ferret File System/v0.1/SQL/map

From Woozle Writes Code
< Ferret File System‎ | v0.1‎ | SQL(Redirected from FileFerret/SQL/map)
Jump to navigation Jump to search

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