This provider is a folder with a list of other folders that each folder represents a item
And normaly the properties of the item are saved in a index.(md|json)
| name | Type | Description |
|---|---|---|
| path | string |
Folder path, an absolute path or relative to the db.config.yml file |
| format | markdown | json | yaml | yml |
Format to save index file |
| id_strategy | incremental | uuid |
Id strategy to generate ids for the items in the database |
This are properties that are defined after the items are loaded and they are hidden by default, to show them you need to explicitly ask for them in include option or pass a empty array to exclude option to show all properties.
| name | Type | Description |
|---|---|---|
| id | string |
folder basename treated as id |
| folder | string |
Folder absolute path |
| raw | string |
Content of the index file |
name: medias
provider:
name: folder
config:
path: data
format: markdown
id_strategy: incrementThere are some custom methods that you can use to interact with the provider.
This method will open the file in the default editor of the system, it uses a where statement to find the file to open.
db open -w id=01To set which editor to use you can set the EDITOR environment variable.
# windows
$env:EDITOR = "notepad"
# linux
export EDITOR=nvimOr you pass the editor as a flag.
db open -w id=01 --editor nvim[!INFO] Some editors may need the full path to be set in the
EDITORenvironment variable to work properly.