{"ok": true, "next": null, "rows": [{"id": "configuration:table-configuration-column-types", "page": "configuration", "ref": "table-configuration-column-types", "title": null, "content": "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. \n                     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. \n                     The simplest form maps column names to type name strings: \n                     [[[cog\nconfig_example(cog, textwrap.dedent(\n  \"\"\"\n    databases:\n      mydatabase:\n        tables:\n          example_table:\n            column_types:\n              website: url\n              contact: email\n              extra_data: json\n  \"\"\").strip()\n) \n                     ]]] \n                     [[[end]]] \n                     For column types that accept additional configuration, use an object with  type  and  config  keys: \n                     [[[cog\nconfig_example(cog, textwrap.dedent(\n  \"\"\"\n    databases:\n      mydatabase:\n        tables:\n          example_table:\n            column_types:\n              website:\n                type: url\n                config:\n                  prefix: \"https://\"\n  \"\"\").strip()\n) \n                     ]]] \n                     [[[end]]]", "breadcrumbs": "[\"Configuration\", null, \"Table configuration\"]", "references": "[]"}, {"id": "configuration:table-configuration-facets", "page": "configuration", "ref": "table-configuration-facets", "title": null, "content": "You can turn on facets by default for specific tables.  facet_size  controls how many unique values are shown for each facet on that table (the default is controlled by the  default_facet_size  setting). See  Facets in configuration  for full details. \n                     [[[cog\nconfig_example(cog, textwrap.dedent(\n  \"\"\"\n    databases:\n      sf-trees:\n        tables:\n          Street_Tree_List:\n            facets:\n            - qLegalStatus\n            facet_size: 10\n  \"\"\").strip()\n) \n                     ]]] \n                     [[[end]]] \n                     You can also specify  array  or  date  facets using JSON objects with a single key of  array  or  date : \n                     facets:\n- array: tags\n- date: created", "breadcrumbs": "[\"Configuration\", null, \"Table configuration\"]", "references": "[]"}, {"id": "configuration:table-configuration-fts", "page": "configuration", "ref": "table-configuration-fts", "title": null, "content": "These configure  full-text search  for a table or view. See  Configuring full-text search for a table or view  for full details. \n                     fts_table  specifies which FTS table to use for search.  fts_pk  sets the primary key column if it is something other than  rowid .  searchmode  can be set to  \"raw\"  to enable  SQLite advanced search operators . \n                     [[[cog\nconfig_example(cog, textwrap.dedent(\n  \"\"\"\n    databases:\n      russian-ads:\n        tables:\n          display_ads:\n            fts_table: ads_fts\n            fts_pk: id\n            searchmode: raw\n  \"\"\").strip()\n) \n                     ]]] \n                     [[[end]]]", "breadcrumbs": "[\"Configuration\", null, \"Table configuration\"]", "references": "[{\"href\": \"https://www.sqlite.org/fts5.html#full_text_query_syntax\", \"label\": \"SQLite advanced search operators\"}]"}, {"id": "configuration:table-configuration-hidden", "page": "configuration", "ref": "table-configuration-hidden", "title": null, "content": "You can hide tables from the database listing view (in the same way that FTS and SpatiaLite tables are automatically hidden) using  \"hidden\": true : \n                     [[[cog\nconfig_example(cog, textwrap.dedent(\n  \"\"\"\n    databases:\n      mydatabase:\n        tables:\n          example_table:\n            hidden: true\n  \"\"\").strip()\n) \n                     ]]] \n                     [[[end]]]", "breadcrumbs": "[\"Configuration\", null, \"Table configuration\"]", "references": "[]"}, {"id": "configuration:table-configuration-label-column", "page": "configuration", "ref": "table-configuration-label-column", "title": null, "content": "Datasette's HTML interface attempts to display foreign key references as labelled hyperlinks. By default, it automatically detects a label column using the following rules (in order): \n                     \n                         \n                             If there is exactly one unique text column, use that. \n                         \n                         \n                             If there is a column called  name  or  title  (case-insensitive), use that. \n                         \n                         \n                             If the table has only two columns - a primary key and one other - use the non-primary-key column. \n                         \n                     \n                     You can override this automatic detection by specifying which column should be used for the link label with the  label_column  property: \n                     [[[cog\nconfig_example(cog, textwrap.dedent(\n  \"\"\"\n    databases:\n      mydatabase:\n        tables:\n          example_table:\n            label_column: title\n  \"\"\").strip()\n) \n                     ]]] \n                     [[[end]]]", "breadcrumbs": "[\"Configuration\", null, \"Table configuration\"]", "references": "[]"}, {"id": "configuration:table-configuration-size", "page": "configuration", "ref": "table-configuration-size", "title": null, "content": "Datasette defaults to displaying 100 rows per page, for both tables and views. You can change this on a per-table or per-view basis using the  size  key: \n                     [[[cog\nconfig_example(cog, textwrap.dedent(\n  \"\"\"\n    databases:\n      mydatabase:\n        tables:\n          example_table:\n            size: 10\n  \"\"\").strip()\n) \n                     ]]] \n                     [[[end]]] \n                     This size can still be over-ridden by passing e.g.  ?_size=50  in the query string.", "breadcrumbs": "[\"Configuration\", null, \"Table configuration\"]", "references": "[]"}, {"id": "configuration:table-configuration-sort", "page": "configuration", "ref": "table-configuration-sort", "title": null, "content": "By default Datasette tables are sorted by primary key. You can set a default sort order for a specific table using the  sort  or  sort_desc  properties: \n                     [[[cog\nfrom metadata_doc import config_example\nimport textwrap\nconfig_example(cog, textwrap.dedent(\n  \"\"\"\n    databases:\n      mydatabase:\n        tables:\n          example_table:\n            sort: created\n  \"\"\").strip()\n) \n                     ]]] \n                     [[[end]]] \n                     Or use  sort_desc  to sort in descending order: \n                     [[[cog\nconfig_example(cog, textwrap.dedent(\n  \"\"\"\n    databases:\n      mydatabase:\n        tables:\n          example_table:\n            sort_desc: created\n  \"\"\").strip()\n) \n                     ]]] \n                     [[[end]]]", "breadcrumbs": "[\"Configuration\", null, \"Table configuration\"]", "references": "[]"}, {"id": "configuration:table-configuration-sortable-columns", "page": "configuration", "ref": "table-configuration-sortable-columns", "title": null, "content": "Datasette allows any column to be used for sorting by default. If you need to control which columns are available for sorting you can do so using  sortable_columns : \n                     [[[cog\nconfig_example(cog, textwrap.dedent(\n  \"\"\"\n    databases:\n      mydatabase:\n        tables:\n          example_table:\n            sortable_columns:\n            - height\n            - weight\n  \"\"\").strip()\n) \n                     ]]] \n                     [[[end]]] \n                     This will restrict sorting of  example_table  to just the  height  and  weight  columns. \n                     You can also disable sorting entirely by setting  \"sortable_columns\": [] \n                     You can use  sortable_columns  to enable specific sort orders for a view called  name_of_view  in the database  my_database  like so: \n                     [[[cog\nconfig_example(cog, textwrap.dedent(\n  \"\"\"\n    databases:\n      my_database:\n        tables:\n          name_of_view:\n            sortable_columns:\n            - clicks\n            - impressions\n  \"\"\").strip()\n) \n                     ]]] \n                     [[[end]]]", "breadcrumbs": "[\"Configuration\", null, \"Table configuration\"]", "references": "[]"}], "truncated": false}