-
Notifications
You must be signed in to change notification settings - Fork 2
/
README
52 lines (42 loc) · 2.19 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FUSE-Db connector design document
==================================
This is the design document for MySQL connector to the filesystem
written using the FUSE (Filesystem-in-UserSpace-Environment)
library. MySQL FUSE connector is the standard Linux application
that's has been both tested and developed on Fedora-13 i386 box
by Michal Novotny in order to provide facility to access the
data in MySQL database like they were standard directories or
files.
The connector is creating 4 levels on the mountpoint where
3 levels are directory levels (levels 1 to 3) and one level
is the file level (level 4). Both databases and tables are
presented using directory entries as well as primary key
value is being presented on 3rd level. If there's no primary
key in the table this 3rd level directory is not having the
executable bit set which means entering such a directory is
disabled.
On the 4th level the database table columns are being shown
as files. On a new file creation a new field named the same
as the file name is being created in the database. Be aware
of the fact that deleting the files just sets the particular
column in the table to NULL value *not deleting it at all*.
There's a short summary of functionality.
Levels and their meaning are as follows:
.../DBNames/Table/PKValue/column (path)
0 1 2 3 4 (level)
Read implementation for supported levels with corresponding queries:
- level 1 -> SHOW DATABASES
- level 2 -> SHOW TABLES
- level 3 -> SELECT ${PRIMARY_KEY} FROM ${TABLE}
- level 4 -> SHOW FIELDS FROM ${TABLE}
Write implementation for supported levels with corresponding queries:
- level 1 -> CREATE DATABASE
- level 2 -> CREATE TABLE WITH VARCHAR(255) PRIMARY KEY
- level 3 -> INSERT INTO ${TABLE}(${PK}) ...
- level 4 -> UPDATE TABLE
Supported operations are getattr, readdir, read, open, mkdir, rmdir, create, write, unlink and truncate.
Level 1-3 entries are *always* directories, returning -ENOTDIR/-EPERM on level 4 actions.
Level 4 entries are *always* files, return -EISDIR/-EPERM on level 1 -- level 3 actions
Thoughts for consideration:
- Read enhancement -> don't show NULL columns for particular record?
- Support for more DB systems, like e.g. PostgreSQL etc.