Skip to main content
A Field is a part of a Database. Learn more about it in the Schema guide.
The API uses type for Database and app for Space. See Terminology.

Create Field

Primitive Field

Response:
Primitive Field types Command parameters

Create unique case insensitive Text Field:

Response:

Create unique Int Field:

Response:

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.
Response:
Command parameters

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 (think Self conviction0.01 in GIST) and enables an easy transition to a fully functional Database. To create a single-select Field we should:
  1. Create a new enum Database
  2. Create a Field of the newly created enum Database
  3. Create an Entity for each single-select option
  4. Make the selection required and set the default value
The new enum Database name is built using this format: ${space}/${field}_${app}/${holder-type}.
Response:

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 auxiliary Collaboration~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:
  1. Get fibery/secret of the related Document.
  2. Work with this Document via api/documents Storage endpoint.
Response:

Rename Field

Response:
Command parameters

Delete Field

Response:

Command parameters

To remove a relation, delete both entity [collection] Fields within the same fibery.schema/batch command.
delete-values? parameter behavior
delete-values?
falsetrue
Field typeEmpty primitive FieldField is deletedField is deleted
Non-empty primitive FieldError is thrownField and values are deleted
Empty entity [collection] FieldField is deletedField is deleted
Non-empty entity [collection] FieldError is thrownField and links (but not related Entities) are deleted