Support for MySQL, MariaDB, SQLite or PostgreSQL Filer providers.
The SQLProvider can be used with Filer on node.js (i.e., this won't work in
browser) like so:
// Option 1 - connecting with a connection URLvarprovider1=newSQLProvider({// The db type to use, see below for other optionstype: SQLProvider.MYSQL,// A MySQL connection stringurl: 'mysql://user:pass@example.com:9821/dbname',// A unique string to identify this user's filesystem (e.g., username)user: 'something-unique'});// Option 2 - connecting with separate db optionsvarprovider2=newSQLProvider({// The db type to use, see below for other optionstype: SQLProvider.MYSQL,// If you want SQL debug logging, pass a logging function//logging: console.log,// A unique string to identify this user's filesystem (e.g., username)user: 'something-unique',// Database optionsdb: {// Name of Database to use, defaults to 'filer'name: "name",// DB authentication info, if necessaryusername: "username",password: "password"}});varfs=newFiler.FileSystem({provider: provider2});The type of database can be one of:
- SQLProvider.MYSQL
- SQLProvider.SQLITE
- SQLProvider.POSTGRES
- SQLProvider.MARIADB
NOTE: some database types require you to pre-create your database. The default
database name is filer unless you specify something else.
If you want to pass extra options to Sequelize, add them to the options object.
See the list of valid options.
The database will have a single table, named filer_data with the following columns:
| Name | Type | Details |
|---|---|---|
| user | STRING(20) Primary Key | Unique username for this user's filesystem |
| key | STRING(36) Primary Key | Filer Node ID's of the form '00000000-0000-0000-0000-000000000000' |
| data | BLOB | binary data with JSON stored as Object->JSON->Buffer(utf8)) |