The API uses
type for Database and app for Space. See Terminology.Create Field
Primitive Field
| Field type | Example | Comments |
|---|---|---|
fibery/int | 42 | |
fibery/decimal | 0.33 | |
fibery/bool | true | |
fibery/text | Don't panic | Up to 1k characters. Can be styled using ui/type meta flag: text | email | phone | url |
~~fibery/email~~ | Deprecated. Use a fibery/text field with ui/type meta set to "email": {"ui/type": "email"} | |
fibery/emoji | 🏏 | |
fibery/date | 1979-10-12 | |
fibery/date-time | 2019-06-24T12:25:20.812Z | |
fibery/date-range | {"start": "2019-06-27", "end": "2019-06-30"} | |
fibery/date-time-range | {"start": "2019-06-18T02:40:00.000Z", "end": "2019-07-25T11:40:00.000Z"} | |
fibery/location | {"longitude": 2.349606, "latitude": 48.890764, "fullAddress": "Métro Marcadet Poissonniers, 67 boulevard Barbès, Paris, 75018, France", "addressParts": {"city": "Paris", "country": "France"}} | All address parts are optional. |
fibery/uuid | acb5ef80-9679-11e9-bc42-526af7764f64 | |
fibery/rank | 1000 | |
fibery/json-value | {"paranoid?": true} |
| Parameter (required in bold) | Description | Example |
|---|---|---|
fibery/holder-type | Holder Database name in ${space}/${name} format | Cricket/Player |
fibery/name | Field name in ${space}/${name} format. | Cricket/Salary |
fibery/type | One of the primitive Field types above or a Database for a one-way relation. | fibery/int |
meta.fibery/readonly? | If users are able to change value from UI | true |
meta.fibery/default-value | The value automatically set when a new entity is created | ”(empty)“ |
meta.fibery/unique? | Makes field values to be unique across the whole Database Only one of unique flags can be used at a time as fibery/unique? and fibery/case-insensitive-text-unique? are mutually exclusive | true |
meta.fibery/case-insensitive-text-unique? | makes field values to be unique case insensitive across whole Database | true |
Create unique case insensitive Text Field:
Create unique Int Field:
Relation (entity [collection] Field)
To create a relation between two Databases, we create a pair of entity [collection] Fields and connect them with a unique identifier. The relation is to-one by default. Set entity Field’s meta.fibery/collection? to true for to-many relation.
| Parameter (required in bold) | Description | Example |
|---|---|---|
fibery/holder-type | Holder Database name in ${space}/${name} format | Cricket/Player |
fibery/name | Field name in ${space}/${name} format. | Cricket/Current Team |
fibery/type | Related Database name in ${space}/${name} format | Cricket/Team |
meta.fibery/relation | UUID shared between the pair of Fields. | d9e9ec34-96… |
meta.fibery/collection? | true for to-many relation (entity collection Field) | true |
meta.fibery/readonly? | If users are able to change value from UI | true |
Single-select Field
A single-select Field is not what it seems to be. Actually, every single-select option is an Entity of a newly created special Database. This way unlocks ‘name on UI + value in Formula’ scenario (thinkSelf conviction → 0.01 in GIST) and enables an easy transition to a fully functional Database.
To create a single-select Field we should:
- Create a new
enumDatabase - Create a Field of the newly created
enumDatabase - Create an Entity for each single-select option
- Make the selection required and set the default value
enum Database name is built using this format: ${space}/${field}_${app}/${holder-type}.
Rich text Field
In Fibery, every rich text Field instance is, in fact, a collaborative document. It means that for each Entity with N rich text Fields Fibery automatically creates N documents. Each of these documents is stored in Document Storage and is connected to its Entity through an auxiliaryCollaboration~Documents/Document Entity:
Entity --- (magic) ---> Collab Doc/Document --- (fibery/secret) ---> Document in Storage
So to create a rich text Field we just connect our Database with the Collaboration~Documents/Document Database. This Database has a special property: the entities inside it inherit access from their Parent Entity. To indicate that Parent-Child relationship we pass fibery/entity-component? meta flag, but only for ordinary Fields (e.g. not Lookup and not Formula)
Selecting and updating a rich text Field is a two-step process:
- Get
fibery/secretof the related Document. - Work with this Document via
api/documentsStorage endpoint.
Rename Field
| Parameter (required in bold) | Description | Example |
|---|---|---|
holder-type | Holder Database name in ${space}/${name} format | Cricket/Player |
from-name | Current Field name in ${space}/${name} format | Cricket/Position |
to-name | New Field name in ${space}/${name} format | Cricket/Role |
Delete Field
Command parameters
| Parameter (required in bold) | Default | Description | Example |
|---|---|---|---|
holder-type | Holder Database name in ${space}/${name} format | Cricket/Player | |
name | Field name in ${space}/${name} format | Cricket/Role | |
delete-values? | false | See the behavior in the table below | true |
To remove a relation, delete both entity [collection] Fields within the same
fibery.schema/batch command.delete-values? parameter behavior
delete-values? | |||
|---|---|---|---|
| false | true | ||
| Field type | Empty primitive Field | Field is deleted | Field is deleted |
| Non-empty primitive Field | Error is thrown | Field and values are deleted | |
| Empty entity [collection] Field | Field is deleted | Field is deleted | |
| Non-empty entity [collection] Field | Error is thrown | Field and links (but not related Entities) are deleted | |
FAQ
Is there a way to modify the meta.fibery/readonly? value? Is there any way to convert a field away from read-only?
Use "command": "schema.field/set-meta". So, if you can set the fibery/readonly? meta value to false, that has to work.