home / docs / sections

sections: configuration:table-configuration-column-types

This data as json

id page ref title content breadcrumbs references
configuration:table-configuration-column-types configuration table-configuration-column-types   You can assign semantic column types to columns, which affect how values are rendered, validated, and transformed. Built-in column types include url , email , and json . Plugins can register additional column types using the register_column_types plugin hook. Column types can optionally declare which SQLite column types they apply to using sqlite_types . Datasette will reject incompatible assignments. The built-in url , email , and json column types are all restricted to TEXT columns. The simplest form maps column names to type name strings: [[[cog config_example(cog, textwrap.dedent( """ databases: mydatabase: tables: example_table: column_types: website: url contact: email extra_data: json """).strip() ) ]]] [[[end]]] For column types that accept additional configuration, use an object with type and config keys: [[[cog config_example(cog, textwrap.dedent( """ databases: mydatabase: tables: example_table: column_types: website: type: url config: prefix: "https://" """).strip() ) ]]] [[[end]]] ["Configuration", null, "Table configuration"] []
Powered by Datasette · Queries took 2.274ms