From fc428b62cbf2ec24e15fcb8f112db605c137430b Mon Sep 17 00:00:00 2001 From: Pranav C <61551451+pranavxc@users.noreply.github.com> Date: Fri, 23 Jul 2021 18:27:32 +0530 Subject: [PATCH] docs: Add table creation and Abstract type Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com> --- README.md | 2 +- packages/nc-gui/helpers/PgUi.js | 2 +- packages/nc-gui/helpers/SqliteUi.js | 15 +- .../en/developer-resources/graphql-apis.md | 2 +- .../en/developer-resources/rest-apis.md | 2 +- packages/noco-docs/content/en/faqs.md | 2 +- packages/noco-docs/content/en/index.md | 2 + .../en/setup-and-usages/abstract-types.md | 420 ++++++++++++++++++ .../en/setup-and-usages/apis-access.md | 2 +- .../en/setup-and-usages/nocodb-dashboard.md | 2 +- .../table-and-column-creation.md | 70 +++ packages/noco-docs/nuxt.config.js | 5 +- 12 files changed, 511 insertions(+), 15 deletions(-) create mode 100644 packages/noco-docs/content/en/setup-and-usages/abstract-types.md create mode 100644 packages/noco-docs/content/en/setup-and-usages/table-and-column-creation.md diff --git a/README.md b/README.md index d11007bb9c..977acd3297 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Turns any MySQL, PostgreSQL, SQL Server, SQLite & MariaDB into a smart-spreadshe [![Build Status](https://travis-ci.org/dwyl/esta.svg?branch=master)](https://travis-ci.com/github/NocoDB/NocoDB) [![Node version](https://badgen.net/npm/node/next)](http://nodejs.org/download/) [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/NocoDB.svg?style=social&label=Follow%20%40NocoDB)](https://twitter.com/NocoDB) - +

diff --git a/packages/nc-gui/helpers/PgUi.js b/packages/nc-gui/helpers/PgUi.js index 2d9ccb850e..f7d07727ce 100644 --- a/packages/nc-gui/helpers/PgUi.js +++ b/packages/nc-gui/helpers/PgUi.js @@ -1581,7 +1581,7 @@ export class PgUi { break case 'Year': - colProp.dt = 'year' + colProp.dt = 'int' break case 'Time': colProp.dt = 'time' diff --git a/packages/nc-gui/helpers/SqliteUi.js b/packages/nc-gui/helpers/SqliteUi.js index 8a08dbe5b1..d105d9d68c 100644 --- a/packages/nc-gui/helpers/SqliteUi.js +++ b/packages/nc-gui/helpers/SqliteUi.js @@ -631,7 +631,9 @@ export class SqliteUi { } static isValidTimestamp(key, value) { - if (typeof value !== 'number') { return false } + if (typeof value !== 'number') { + return false + } return new Date(value).getTime() > 0 && /(?:_|(?=A))[aA]t$/.test(key) } @@ -653,7 +655,9 @@ export class SqliteUi { } static colPropAuDisabled(col) { - if (col.altered !== 1) { return true } + if (col.altered !== 1) { + return true + } switch (col.dt) { case 'date': @@ -866,7 +870,8 @@ export class SqliteUi { ] case 'Checkbox': - return ['int', + return [ + 'int', 'integer', 'tinyint', 'smallint', @@ -1038,8 +1043,8 @@ export class SqliteUi { case 'Date': return [ - 'date' - + 'date', + 'varchar' ] case 'DateTime': diff --git a/packages/noco-docs/content/en/developer-resources/graphql-apis.md b/packages/noco-docs/content/en/developer-resources/graphql-apis.md index cccdc0ce70..9e12e4d965 100644 --- a/packages/noco-docs/content/en/developer-resources/graphql-apis.md +++ b/packages/noco-docs/content/en/developer-resources/graphql-apis.md @@ -1,6 +1,6 @@ --- title: 'GraphQL APIs' -position: 7 +position: 21 category: 'Developer Resources' menuTitle: 'GraphQL APIs' --- diff --git a/packages/noco-docs/content/en/developer-resources/rest-apis.md b/packages/noco-docs/content/en/developer-resources/rest-apis.md index 9df8167067..34ff8c30f3 100644 --- a/packages/noco-docs/content/en/developer-resources/rest-apis.md +++ b/packages/noco-docs/content/en/developer-resources/rest-apis.md @@ -1,6 +1,6 @@ --- title: 'REST APIs' -position: 6 +position: 20 category: 'Developer Resources' menuTitle: 'REST APIs' --- diff --git a/packages/noco-docs/content/en/faqs.md b/packages/noco-docs/content/en/faqs.md index 125b6de622..09e336b8b5 100644 --- a/packages/noco-docs/content/en/faqs.md +++ b/packages/noco-docs/content/en/faqs.md @@ -1,7 +1,7 @@ --- title: 'FAQs' description: 'FAQs' -position: 8 +position: 100 category: 'FAQ' fullscreen: true menuTitle: 'FAQs' diff --git a/packages/noco-docs/content/en/index.md b/packages/noco-docs/content/en/index.md index 1e7893746d..a5353f754c 100644 --- a/packages/noco-docs/content/en/index.md +++ b/packages/noco-docs/content/en/index.md @@ -14,6 +14,8 @@ NocoDB works by connecting to any relational database and transforming them into Also NocoDB's app store allows you to build business workflows on views with combination of Slack, Microsoft Teams, Discord, Twilio, Whatsapp, Email & any 3rd party APIs too. Plus NocoDB provides programmatic access to APIs so that you can build integrations with Zapier / Integromat and custom applications too. + + ## Features ### Rich Spreadsheet Interface diff --git a/packages/noco-docs/content/en/setup-and-usages/abstract-types.md b/packages/noco-docs/content/en/setup-and-usages/abstract-types.md new file mode 100644 index 0000000000..9be436bc19 --- /dev/null +++ b/packages/noco-docs/content/en/setup-and-usages/abstract-types.md @@ -0,0 +1,420 @@ +--- +title: 'Abstract Types' +description: 'Abstract Types' +position: 12 +category: 'Setup and Usages' +menuTitle: 'Abstract Types' +--- + +## Available Abstract Types + +| Type | Description | +|---|---| +| [ID](#id) | Primary column of the table | +| [LinkToAnotherRecord](#linktoanotherrecord) | Has Many or Many To Many columns | +| [ForeignKey](#foreignkey)| Belongs To relation | +| [SingleLineText](#singlelinetext) | For short text | +| [LongText](#longtext) | For lengthy string content | +| [Attachment](#attachment) | File attachment column | +| [Checkbox](#checkbox) | Boolean value | +| [MultiSelect](#multiselect) | Multiple options can be selected once | +| [SingleSelect](#singleselect) | Single option select | +| [Date](#date) | Date selector | +| [Year](#year) | Year selector | +| [Time](#time) | Time selector | +| [PhoneNumber](#phonenumber) | Phone number field | +| [Email](#email) | Email field | +| [URL](#url) | Valid URL field | +| [Number](#number) | Any type of number | +|[Decimal](#decimal)| Fractional number | +|[Currency](#currency)| Currency value | +|[Percent](#percent)| Percentage | +|[Duration](#duration)| Duration | +|[Rating](#rating)| Rating | +|[Formula](#formula)| Formula based generated column | +| [Count](#count) | | +|[DateTime](#datetime)| Date & Time selector | +|[CreateTime](#createtime)| | +|[AutoNumber](#autonumber)| | +|[Geometry](#geometry)| Geometry column | +|[SpecificDBType](#specificdbtype)| Custom DB type option | + + + + +## Database Types + + +### ID + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|_All types are available_|int| +|**PostgreSQL**|_All types are available_|int4| +|**SQL Server**|_All types are available_|int| +|**SQLite**|_All types are available_|integer| + + + +### LinkToAnotherRecord + + + + +### ForeignKey + + + + + +### SingleLineText + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**||| +|**PostgreSQL**||| +|**SQL Server**||| +|**SQLite**||| + + + +### LongText + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|char, varchar, nchar, text, tinytext, mediumtext, longtext|text| +|**PostgreSQL**|char, character, character varying, text|text| +|**SQL Server**|char, ntext, text, varchar, nvarchar|text| +|**SQLite**|character, text, varchar|text| + + + +### Attachment + +#### Available Database Types +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|json, char, varchar, nchar, text, tinytext, mediumtext, longtext| text | +|**PostgreSQL**|json, char, character, character varying, text| text | +|**SQL Server**|char, ntext, text, varchar, nvarchar| text | +|**SQLite**|character, text, varchar|text| + + + + + +### Checkbox + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|int, smallint, mediumint, bigint, bit, boolean, serial, tinyint|tinyint| +|**PostgreSQL**|bit, bool, int2, int4, int8, boolean, smallint, int, integer, bigint, bigserial, char, int4range, int8range, serial, serial2, serial8|bool| +|**SQL Server**|bigint, bit, int, tinyint|tinyint| +|**SQLite**|int, integer, tinyint, smallint, mediumint, bigint, int2, int8, boolean|| + + + + + +### MultiSelect + +#### Available Database Types +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|set, text, tinytext, mediumtext, longtext|set| +|**PostgreSQL**|text|text| +|**SQL Server**|text, ntext|text| +|**SQLite**|text, varchar|text| + + + + + +### SingleSelect + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|enum, text, tinytext, mediumtext, longtext|enum| +|**PostgreSQL**|anyenum, text|text| +|**SQL Server**|text, ntext|text| +|**SQLite**|text, varchar|text| + + + + +### Date + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|date, datetime, timestamp, varchar|varchar| +|**PostgreSQL**||character varying| +|**SQL Server**||| +|**SQLite**|date|varchar| + + + + +### Year + +#### Available Database Types +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|year|year| +|**PostgreSQL**|int|int| +|**SQL Server**|int|int| +|**SQLite**|int, integer, tinyint, smallint, mediumint, bigint, int2, int8|| + + + + + +### Time + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|time|time| +|**PostgreSQL**|time, time without time zone, timestamp, timestamp without time zone, timestamptz, timestamp with time zone, timetz, time with time zone|time| +|**SQL Server**|time|time| +|**SQLite**|int, integer, tinyint, smallint, mediumint, bigint, int2, int8|time| + + + + +### PhoneNumber + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|varchar|varchar| +|**PostgreSQL**|character varying|character varying| +|**SQL Server**|varchar|varchar| +|**SQLite**|varchar, text|varchar| + + + + +### Email + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|varchar|varchar| +|**PostgreSQL**|character varying|character varying| +|**SQL Server**|varchar|| +|**SQLite**|varchar, text|varchar| + + + + +### URL + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|text, tinytext, mediumtext, longtext, varchar|varchar| +|**PostgreSQL**|character varying, text|character varying| +|**SQL Server**|varchar, text|varchar| +|**SQLite**|varchar, text|varchar| + + + + +### Number + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|int, smallint, mediumint, bigint, bit, float, decimal, double, serial|int| +|**PostgreSQL**|int, integer, bigint, bigserial, int2, int4, int8, serial, serial2, serial8, double precision, float4, float8, smallint, smallserial|int8| +|**SQL Server**|int, bigint, bit, decimal, float, numeric, real, smallint, tinyint|int| +|**SQLite**|int, integer, tinyint, smallint, mediumint, bigint, int2, int8, numeric, real, double, double precision, float|integer| + + + + +### Decimal + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|float, decimal, double, serial|decimal| +|**PostgreSQL**|double precision,float4,float8|decimal| +|**SQL Server**|decimal, float|decimal| +|**SQLite**|real, double, double precision, float, numericdecimal| + + + + +### Currency + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|decimal, float, double, serial', 'int, smallint, mediumint, bigint, bit|decimal| +|**PostgreSQL**|int, integer, bigint, bigserial, int2, int4, int8, serial, serial2, serial8, double precision, money', 'float4, float8|decimal| +|**SQL Server**|int, bigint, bit, decimal, float, numeric, real, smallint, tinyint|decimal| +|**SQLite**|real, double, double precision, float, int, integer, tinyint, smallint, mediumint, bigint, int2, int8, numeric|double precision| + + + + +### Percent + +#### Available Database Types + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|decimal, float, double, serial', 'int, smallint, mediumint, bigint, bit|double| +|**PostgreSQL**|int, integer, bigint, bigserial, int2, int4, int8, serial, serial2, serial8, double precision, float4, float8, smallint, smallserial|double| +|**SQL Server**|int, bigint, bit, decimal, float, numeric, real, smallint, tinyint|double| +|**SQLite**|real, double, double precision, float, int, integer, tinyint, smallint, mediumint, bigint, int2, int8, numeric|double| + + + + + +### Duration + +#### Available Database Types + + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|decimal, float, double, serial', 'int, smallint, mediumint, bigint, bit|int| +|**PostgreSQL**|int, integer, bigint, bigserial, int2, int4, int8, serial, serial2, serial8, double precision, float4, float8, smallint, smallserial|int8| +|**SQL Server**|int, bigint, bit, decimal, float, numeric, real, smallint, tinyint|int| +|**SQLite**|int, integer, tinyint, smallint, mediumint, bigint, int2, int8|integer| + + + + + +### Rating + +#### Available Database Types + + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|decimal, float, double, serial', 'int, smallint, mediumint, bigint, bit|float| +|**PostgreSQL**|int, integer, bigint, bigserial, int2, int4, int8, serial, serial2, serial8, double precision, float4, float8, smallint, smallserial|float8| +|**SQL Server**|int, bigint, bit, decimal, float, numeric, real, smallint, tinyint|float| +|**SQLite**|real, double, double precision, float, int, integer, tinyint, smallint, mediumint, bigint, int2, int8, numeric|float| + + + + + +### Formula + + + + + +### Count + +#### Available Database Types + + + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|int, smallint, mediumint, bigint, serial|int| +|**PostgreSQL**|int, integer, bigint, bigserial, int2, int4, int8, serial, serial2, serial8, smallint, smallserial|int8| +|**SQL Server**|int, bigint, smallint, tinyint|int| +|**SQLite**|int, integer, tinyint, smallint, mediumint, bigint, int2, int8|integer| + + + + + +### DateTime + +#### Available Database Types + + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|datetime, timestamp, varchar|datetime| +|**PostgreSQL**|timestamp, timestamp without time zone, timestamptz, timestamp with time zone|datetime| +|**SQL Server**|datetime, datetime2, datetimeoffset|datetime| +|**SQLite**|datetime, timestamp|datetime| + + + + + +### CreateTime + +#### Available Database Types + + + +|Database| Types| Default Type| +|-----|----------|----------| +|**MySQL**|datetime, timestamp, varchar|datetime| +|**PostgreSQL**|timestamp, timestamp without time zone, timestamptz, timestamp with time zone|datetime| +|**SQL Server**|datetime, datetime2, datetimeoffset|datetime| +|**SQLite**|datetime, timestamp|datetime| + + +### Geometry + +#### Available Database Types + + +|Database| Types| +|-----|----------| +|**MySQL**|geometry, point, linestring, polygon, multipoint, multilinestring, multipolygon| +|**PostgreSQL**|polygon, point, circle, box, line, lseg, path, circle| +|**SQL Server**|geometry| +|**SQLite**|text| + + + + + +### SpecificDBType + +#### Available Database Types + + +|Database| Types| +|-----|----------| +|**MySQL**|_All types are available_| +|**PostgreSQL**|_All types are available_| +|**SQL Server**|_All types are available_| +|**SQLite**|_All types are available_| + + + + + + + + + + + + + diff --git a/packages/noco-docs/content/en/setup-and-usages/apis-access.md b/packages/noco-docs/content/en/setup-and-usages/apis-access.md index fd7c657d55..f37d42b437 100644 --- a/packages/noco-docs/content/en/setup-and-usages/apis-access.md +++ b/packages/noco-docs/content/en/setup-and-usages/apis-access.md @@ -1,7 +1,7 @@ --- title: 'APIs Access' description: 'APIs Access' -position: 5 +position: 14 category: 'Setup and Usages' menuTitle: 'APIs Access' --- diff --git a/packages/noco-docs/content/en/setup-and-usages/nocodb-dashboard.md b/packages/noco-docs/content/en/setup-and-usages/nocodb-dashboard.md index 70d0b85d48..a5c0104dc5 100644 --- a/packages/noco-docs/content/en/setup-and-usages/nocodb-dashboard.md +++ b/packages/noco-docs/content/en/setup-and-usages/nocodb-dashboard.md @@ -1,7 +1,7 @@ --- title: 'NocoDB Dashboard' description: 'NocoDB Dashboard' -position: 4 +position: 10 category: 'Setup and Usages' menuTitle: 'NocoDB Dashboard' --- diff --git a/packages/noco-docs/content/en/setup-and-usages/table-and-column-creation.md b/packages/noco-docs/content/en/setup-and-usages/table-and-column-creation.md new file mode 100644 index 0000000000..c7a831ccb6 --- /dev/null +++ b/packages/noco-docs/content/en/setup-and-usages/table-and-column-creation.md @@ -0,0 +1,70 @@ +--- +title: 'Table & Columns' +description: 'Table and Columns Creation' +position: 11 +category: 'Setup and Usages' +menuTitle: 'Table and Columns Creation' +--- + + +## Table Creation + +Once you have created a new NocoDB project you can open it, In the browser, the URL would be like `example.com/dashboard/#/nc/project_id`. + +Now you can start creating new tables, so let's begin the table creation by simply clicking one of the following options. + +![table_create](https://user-images.githubusercontent.com/61551451/126771744-063f22da-6def-43fe-b9ef-1744d104db9d.png) + + On click, it will popup a table create a modal popup, in which you can enter the table name alias and table name. Enable/disable default columns and finally click the `Submit` button. + +![table_create_modal](https://user-images.githubusercontent.com/61551451/126772859-5a301c45-d830-4df2-a05a-43b15dd77728.png) + +> You can't disable the `id` column since we need a primary column for the table. + +After the successful submission, the table will create and open as a new tab. + +![image](https://user-images.githubusercontent.com/61551451/126773614-c945f654-cba8-4dd6-bd5e-d74890543d11.png) + +## Column Creation + +Adding a column is simple, you have to click the `+` icon on the right corner of the table. + +![Step 9](../../static/s3/9.png)![Pasted_Image_23_07_21__4_39_PM](https://user-images.githubusercontent.com/61551451/126773798-4470d632-69e0-4f5f-803b-e3597715fe22.png) + +After the click, it will show a menu and you can enter the column name and choose the column type ([Abstract type](./abstract-types)) from the column type. And finally, you can click the save button to create the new column. + +![image](https://user-images.githubusercontent.com/61551451/126774157-ae9af236-e1ad-4a54-adb7-1b96775cae57.png) + +> For more about Abstract type [click here](./abstract-types). + + +Finally, we have our new column as part of our table. + + +![Pasted_Image_23_07_21__4_43_PM](https://user-images.githubusercontent.com/61551451/126774276-e947f510-2fe1-4595-afc1-a31d2c35a69a.png) + + +## Row creation + +For adding new values to the table we need new rows, new rows can be added in two methods. + +### Using Form + +- Click the `+` icon in the toolbar of the table tab. + + ![Pasted_Image_23_07_21__5_40_PM](https://user-images.githubusercontent.com/61551451/126783882-abd7e1dc-f13f-49bf-b44d-e66a06aacf5d.png) +- Now it will open a modal Form to enter the values, provide the values and press the save button. + + +![Pasted_Image_23_07_21__6_22_PM](https://user-images.githubusercontent.com/61551451/126784347-b82f9dfd-4c6d-4d65-be07-80e051ff19de.png) + + + + + + + +### Using Table Row + + + diff --git a/packages/noco-docs/nuxt.config.js b/packages/noco-docs/nuxt.config.js index a6bfb42220..717e0d50a3 100644 --- a/packages/noco-docs/nuxt.config.js +++ b/packages/noco-docs/nuxt.config.js @@ -6,7 +6,6 @@ export default theme({ }, css: [ "./assets/main.css" - ], content: { - liveEdit: false - } + ] }) +