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
Object: An object is a collection of properties or key values. Here's a great example of what an object is. If the object was a car, it's properties might be brand, weight, color, make, year
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 values
Password: this is a special case where the data entered into this field is automatically encrypted using salt encryption. You can also configure how passwords are stored. Use to store passwords or anything sensitive
- 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.
Timestamp: this is the number of milliseconds that have elapsed since the Unix epoch. Learn more about Date & Time in Xano
Xano supports array (list) structures for each of field types available in the database.
There is no hard and fast rule on this, but we like to say if you anticipate your object list growing over 100, it's probably time to start thinking about separating it into a new table. You can still keep everything in an object, but it becomes a little unwieldy to manage especially because when you update objects, you're updating the whole thing (so potentially 100+ records) and if you make a mistake on how you update the data on the front-end, it could lead to some trouble.
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.
- Internal - When you create a CRUD API endpoint that references this table, This field will be hidden from the Input section of the NO CODE API builder AND from the response of any Database Function that accesses it.
- 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.