<commit_before># edit
  * edit (array): allow in-cell editing of the specified columns

Basic example:
```php
  'edit' => [
    3 => 'user.firstname',
    4 => 'user.lastname'
  ]
```

  * edit (array): all options
    * target (string): the column to store the entered data in &lt;table>.&lt;column> format
    * type (string): change the type of the used input element; available options are:
        * multiline: use a &lt;textarea> element allowing line-breaks in the input
        * checkbox: use a &lt;input type="checkbox"> element; also allows the use of the 'truevalue' and 'falsevalue' suboptions to change the way boolean values are interpreted
          from and written to the database
        * date: use a &lt;input type="date"> element which presents a native date-picker UI in supporting browsers; falls back to normal text input otherwise
        * password: use a &lt;input type="password"> element which masks out the input
        * email: use a &lt;input type="email"> element which enforces a valid email address as input in supporting browsers; falls back to normal text input otherwise
        * color: use a color picker as input element; requires https://github.com/mrgrain/colpick to be loaded. Saves the color's #-code in the cell
        * number: use a &lt;input type="number"> element which presents up/down arrows in supporting browsers; falls back to normal text input otherwise. Also allows the use of
          'min' and 'max' suboptions that set limits on the permitted input
    * query (string): query to generate a pulldown menu from; should produce a foreign key and a description.
      The foreign key is stored in the 'target' column, the description is shown in the user interface.
    * required (boolean or array): enforce that the field cannot be left empty
        * regex (string): only accept input matching this regular expression
        * message (string): show this message if the input is invalid
    * condition (array): sets a condition that must be true for the field to be editable; needs to have 3 elements in the array, the left-hand side, the comparison type
      (either '==' or '!=') as a string and the right-hand side. The left-hand side will expand hash-tags like '#2' meaning 'the value of column 2 in this row'.
    * show (string): [experimental] only supports the value 'always' currently, which makes the edit input always visible, not just after clicking
    * trigger (string): refresh the indicated other table whenever this table is changed through edit; needs to contain the 'tag' name of the other table

Full example:
```php
  'edit' => [
    1 => 'table.column1',
    2 => [ 'target' => 'table.column2', 'type' => 'multiline' ],
    3 => [ 'target' => 'table.column3', 'type' => 'checkbox', 'truevalue' => 't', 'falsevalue' => 'f' ],
    4 => [ 'target' => 'table.column4', 'type' => 'number', 'min' => 1, 'max' => 100 ],
    5 => [ 'target' => 'table.column5', 'query' => 'SELECT id, description FROM othertable' ],
    6 => [ 'target' => 'table.column6', 'required' => true ],
    7 => [ 'target' => 'table.column7', 'required' => [ 'regex' => '\d{4}', 'message' => 'Input is not a 4-digit code' ] ],
    8 => [ 'target' => 'table.column8', 'condition' => [ '#3', '==', 't' ] ],
    'trigger' => 'tag'
  ]
```

# insert
  * insert (array): add a row to the table to insert new data

Basic example:
```php
  'insert' => [
    3 => 'user.firstname',
    4 => 'user.lastname'
  ]
```

  * insert (array): it is common to allow insertion of all columns that are already configured for 'edit'; this can be done with the 'include' suboption. The example below
    includes the 'edit' configuration and adds column 5 purely for the insert function.

Include example:
```php
  'insert' => [
    'include' => 'edit',
    5 => [ 'table.column5' ]
  ]
```

  * insert (array): all options<commit_msg>Document the edit type datauri option<commit_after># edit
  * edit (array): allow in-cell editing of the specified columns

Basic example:
```php
  'edit' => [
    3 => 'user.firstname',
    4 => 'user.lastname'
  ]
```

  * edit (array): all options
    * target (string): the column to store the entered data in &lt;table>.&lt;column> format
    * type (string): change the type of the used input element; available options are:
        * multiline: use a &lt;textarea> element allowing line-breaks in the input
        * checkbox: use a &lt;input type="checkbox"> element; also allows the use of the 'truevalue' and 'falsevalue' suboptions to change the way boolean values are interpreted
          from and written to the database
        * date: use a &lt;input type="date"> element which presents a native date-picker UI in supporting browsers; falls back to normal text input otherwise
        * password: use a &lt;input type="password"> element which masks out the input
        * email: use a &lt;input type="email"> element which enforces a valid email address as input in supporting browsers; falls back to normal text input otherwise
        * color: use a color picker as input element; requires https://github.com/mrgrain/colpick to be loaded. Saves the color's #-code in the cell
        * number: use a &lt;input type="number"> element which presents up/down arrows in supporting browsers; falls back to normal text input otherwise. Also allows the use of
          'min' and 'max' suboptions that set limits on the permitted input
        * datauri: use a file upload element; the uploaded file should be an image and will be stored in the database as a data uri (to be used in conjunction with [transformations -> image](https://bart.noordervliet.net/lt-docs/table_options_display/#transformations-experimental))
          note: there is currently no size limit and automatic resizing is not yet implemented, so beware of bloating your database with giant files
    * query (string): query to generate a pulldown menu from; should produce a foreign key and a description.
      The foreign key is stored in the 'target' column, the description is shown in the user interface.
    * required (boolean or array): enforce that the field cannot be left empty
        * regex (string): only accept input matching this regular expression
        * message (string): show this message if the input is invalid
    * condition (array): sets a condition that must be true for the field to be editable; needs to have 3 elements in the array, the left-hand side, the comparison type
      (either '==' or '!=') as a string and the right-hand side. The left-hand side will expand hash-tags like '#2' meaning 'the value of column 2 in this row'.
    * show (string): [experimental] only supports the value 'always' currently, which makes the edit input always visible, not just after clicking
    * trigger (string): refresh the indicated other table whenever this table is changed through edit; needs to contain the 'tag' name of the other table

Full example:
```php
  'edit' => [
    1 => 'table.column1',
    2 => [ 'target' => 'table.column2', 'type' => 'multiline' ],
    3 => [ 'target' => 'table.column3', 'type' => 'checkbox', 'truevalue' => 't', 'falsevalue' => 'f' ],
    4 => [ 'target' => 'table.column4', 'type' => 'number', 'min' => 1, 'max' => 100 ],
    5 => [ 'target' => 'table.column9', 'type' => 'datauri' ],
    6 => [ 'target' => 'table.column5', 'query' => 'SELECT id, description FROM othertable' ],
    7 => [ 'target' => 'table.column6', 'required' => true ],
    8 => [ 'target' => 'table.column7', 'required' => [ 'regex' => '\d{4}', 'message' => 'Input is not a 4-digit code' ] ],
    9 => [ 'target' => 'table.column8', 'condition' => [ '#3', '==', 't' ] ],
    'trigger' => 'tag'
  ]
```

# insert
  * insert (array): add a row to the table to insert new data

Basic example:
```php
  'insert' => [
    3 => 'user.firstname',
    4 => 'user.lastname'
  ]
```

  * insert (array): it is common to allow insertion of all columns that are already configured for 'edit'; this can be done with the 'include' suboption. The example below
    includes the 'edit' configuration and adds column 5 purely for the insert function.

Include example:
```php
  'insert' => [
    'include' => 'edit',
    5 => [ 'table.column5' ]
  ]
```

  * insert (array): all options
{'fraction_non_alphanumeric': 0.1206291591046582, 'fraction_numerical': 0.00822746521476104, 'mean_word_length': 3.49727965179543, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 101, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6014159', 'n_tokens_mistral': 2317, 'n_tokens_neox': 2249, 'n_words': 1072}