Xano supports a number of different field types to be used in the building of your database.
While Xano's table editor might appear like a standard spreadsheet, it can store rich content in each cell. For example, a table can contain records (rows) with attachments, files, checkboxes, location data, links to records in other tables, and much more.
The data type is for the Database to understand what type of data is expected inside of each column, and it's always a way to ensure data is stored in a consistent and known format.
Below are all of the supported Field Types in Xano:
Text variable-length character string. Typically used for things like titles, names, descriptions and urls Integer: A number without decimals. Used to store whole numbers like age or a credit card number
Table Reference: this is what is used to define Table relationships. It's an integer that references another table using the
id. Used to tell Xano when one piece of content is related to another. Enum: A list of possible values. This is typically used when you're doing a list like
roles(basic, admin, super admin). Timestamp: A timestamp is stored as a Unix timestamp in milliseconds. Anytime you store a date or time, you would use this field type.
Date: Store dates with an easy calendar interface.
Boolean: logical Boolean When you want to store a true/false checkbox
Decimal: You can store a decimal value with 31072 digits before the decimal point to 16383 digits after the decimal point. Good for when you want to display fractional vlaues
- Image Metadata: this allows you to upload any image files. For example: .jpg.
- Video Metadata: this allows you to upload any video files. For example: .mp4.
- Attachment Metadata: this allows you to upload any files with the exception of .exe.
JSON: Consists of 6 data types. First four data types (string, number, boolean and null) can be referred as simple data types. Other two data types (object and array) can be referred as complex data types. Here's a great article if you want to learn more. Typically used when you are storing temporary data. a good example is user-generated data such as filling out a form or data logging.
This feature allows you to further enforce restrictions when it comes to how your Database Fields are displayed using the API. For example, you might want to change the API access level of any fields containing particularly sensitive information, such as passwords.
- Public - This field is accessible to be used in any API.
- Point (geo_point): a special type that represents a point on the map using latitude and longitude.
- Point Collection (geo_multipoint): a special type that represents a collection of points on one map using latitude and longitude.
- Path (geo_linestring): a collection of points that represent a line on a map using the latitude and longitude of each point.
- Path Collection (geo_multilinestring): a collection of lines on one map.
- Polygon (geo_polygon): a collection of lines that form a multi-sided shape on a map.
- Polygon Collection (geo_multipolygon): a collection of polygons on one map.