<commit_before><!-- multilang from definicion-tablas.md




DO NOT MODIFY DIRECTLY THIS FILE WAS GENERATED BY multilang.js




-->


# Tables definition


<!--multilang buttons-->

language: ![English](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-en.png)
also available in:
[![Spanish](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-es.png)](definicion-tablas.md)


Are defined tables, database views (which correspond to a database VIEW), or query views (which are simply a query that knows the application but didn't generate a VIEW).
In the future there will be available to create tables which not have data originated by the database, for example a list of fields would have to be able to be seen in a table.


## tableDef


property          | type | default value         | use
------------------|------|-----------------------|----------------------------------------------------------------------------------------------
name              | T    |                       | table name in database. this name is the table id inside the system
title             | T    | `name`                | grid title
editable          | L    | `false`               | permissions
allow             | PO   | `editable`            | individual permissions object
primaryKey        | [T]  | `[]`                  | PK name field list
foreignKeys       | [O]  | `[]`                  | FK definition list
softForeignKeys   | [O]  | `[]`                  | SFK definition list. It's used to specify FKs (one to one) not defined in database.
constraints       | [O]  | `[]`                  | constraints list (except PK and FK)
sql               | O    | *deduced*             | SQL syntax for special cases
isTable           | L    | `true`                | (see Spanish)
layout            | O    | {}                    | (see Spanish)
vertical          | L    | `false`               | (see Spanish)
forInsertOnlyMode | L    | `false`               | (see Spanish)
filterColumns     | [O]  | `[]`                  | (see Spanish)
registerImports   | [O]  | (registerImportsDef)  | Object list. It is uset to configure how "others" fields are stored when any person imports a file (*it works* **__only if you set to true one field with "defaultForOtherFields"__** *(see fieldDef)*)
sortColumns       | [O]  | `[]`                  | default order
detailTables      | [O]  | `[]`                  | master/detail subgrids based in other tables

list examples    | element format
-----------------|--------------------------------------
 foreignKeys     | {references:'ptable', fields:['atomic_number']}
 softForeignKeys | {references:'ptable', fields:['atomic_number']}
 constraints     | {constraintType:'unique', fields:['atomic_number','order'], consName:'repeating order in atomic_number'}
 filterColumns   | {column:'atomic_number', operator:'=', value:7}
 sortColumns     | {column:'discovery_date', order:-1}
detailTables     | {table:'ptable', fields:['atomic_number'], abr:'A', refreshParent:true}

permissions | table | field | allows:
------------|-------|-------|-------
insert      | x     | x     | (see Spanish)
update      | x     | x     | (see Spanish)
delete      | x     |       | (see Spanish)<commit_msg>Update table-definitions.md<commit_after><!-- multilang from definicion-tablas.md




DO NOT MODIFY DIRECTLY THIS FILE WAS GENERATED BY multilang.js




-->


# Tables definition


<!--multilang buttons-->

language: ![English](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-en.png)
also available in:
[![Spanish](https://raw.githubusercontent.com/codenautas/multilang/master/img/lang-es.png)](definicion-tablas.md)


Are defined tables, database views (which correspond to a database VIEW), or query views (which are simply a query that knows the application but didn't generate a VIEW).
In the future there will be available to create tables which not have data originated by the database, for example a list of fields would have to be able to be seen in a table.


## tableDef


property          | type | default value         | use
------------------|------|-----------------------|----------------------------------------------------------------------------------------------
name              | T    |                       | table name in database. this name is the table id inside the system
title             | T    | `name`                | grid title
editable          | L    | `false`               | permissions
allow             | PO   | `editable`            | individual permissions object
primaryKey        | [T]  | `[]`                  | PK name field list
foreignKeys       | [O]  | `[]`                  | FK definition list
softForeignKeys   | [O]  | `[]`                  | SFK definition list. It's used to specify FKs (one to one) not defined in database.
constraints       | [O]  | `[]`                  | constraints list (except PK and FK)
sql               | O    | *deduced*             | SQL syntax for special cases
layout            | O    | {}                    | (see Spanish)
vertical          | L    | `false`               | (see Spanish)
forInsertOnlyMode | L    | `false`               | (see Spanish)
filterColumns     | [O]  | `[]`                  | (see Spanish)
registerImports   | [O]  | (registerImportsDef)  | Object list. It is uset to configure how "others" fields are stored when any person imports a file (*it works* **__only if you set to true one field with "defaultForOtherFields"__** *(see fieldDef)*)
sortColumns       | [O]  | `[]`                  | default order
detailTables      | [O]  | `[]`                  | master/detail subgrids based in other tables

list examples    | element format
-----------------|--------------------------------------
 foreignKeys     | {references:'ptable', fields:['atomic_number']}
 softForeignKeys | {references:'ptable', fields:['atomic_number']}
 constraints     | {constraintType:'unique', fields:['atomic_number','order'], consName:'repeating order in atomic_number'}
 filterColumns   | {column:'atomic_number', operator:'=', value:7}
 sortColumns     | {column:'discovery_date', order:-1}
detailTables     | {table:'ptable', fields:['atomic_number'], abr:'A', refreshParent:true}

permissions | table | field | allows:
------------|-------|-------|-------
insert      | x     | x     | (see Spanish)
update      | x     | x     | (see Spanish)
delete      | x     |       | (see Spanish)
{'fraction_non_alphanumeric': 0.173892917759605, 'fraction_numerical': 0.0006171887054466903, 'mean_word_length': 1.8207136640557007, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3794001', 'n_tokens_mistral': 1715, 'n_tokens_neox': 1632, 'n_words': 563}