<palign="center"><imgsrc="https://user-images.githubusercontent.com/5435402/133762127-e94da292-a1c3-4458-b09a-02cd5b57be53.png"alt="The Open Source Airtable Alternative - works on MySQL, Postgres SQL Server & MariaDB"width="1000px"/></p>
<tdalign="center"><ahref="http://bvkatwijk.nl/"><imgsrc="https://avatars.githubusercontent.com/u/18490578?v=4?s=100"width="100px;"alt=""/><br/><sub><b>Boris van Katwijk</b></sub></a><br/><ahref="https://github.com/nocodb/nocodb/commits?author=bvkatwijk"title="Code">💻</a></td>
<tdalign="center"><ahref="http://stackexchange.com/users/1677570/ferrybig"><imgsrc="https://avatars.githubusercontent.com/u/1576684?v=4?s=100"width="100px;"alt=""/><br/><sub><b>Fernando van Loenhout</b></sub></a><br/><ahref="https://github.com/nocodb/nocodb/commits?author=ferrybig"title="Code">💻</a></td>
<tdalign="center"><ahref="http://quantimo.do"><imgsrc="https://avatars.githubusercontent.com/u/2808553?v=4?s=100"width="100px;"alt=""/><br/><sub><b>Mike P. Sinn</b></sub></a><br/><ahref="https://github.com/nocodb/nocodb/commits?author=mikepsinn"title="Code">💻</a></td>
<tdalign="center"><ahref="http://dolibit.de"><imgsrc="https://avatars.githubusercontent.com/u/45215329?v=4?s=100"width="100px;"alt=""/><br/><sub><b>UT from dolibit</b></sub></a><br/><ahref="https://github.com/nocodb/nocodb/commits?author=dolibit-ut"title="Code">💻</a></td>
NocoDB allows creating API tokens which allow it to be integrated seamlessly with 3rd party apps. API Token is a Nano ID with a length of 40. If you are passing API Token, make sure that the header is called `xc-token`.
# wait until both 3000 and 8080 ports are available
# or run following command to run it with GUI
npm run cypress:open
# run test script
- quickTest.js
```
## Enabling CI-CD for draft PR
CI-CD will be triggered on moving a PR from draft state to `Ready for review` state & on pushing changes to `Develop`. To verify CI-CD before requesting for review, add label `trigger-CI` on Draft PR.
- All individual unit tests are independent of each other. We don't use any shared state between tests.
- Test environment includes `sakila` sample database and any change to it by a test is reverted before running other tests.
- While running unit tests, it tries to connect to mysql server running on `localhost:3306` with username `root` and password `password` (which can be configured) and if not found, it will use `sqlite` as a fallback, hence no requirement of any sql server to run tests.
### Pre-requisites
- MySQL is preferred - however tests can fallback on SQLite too
### Setup
@ -35,13 +40,7 @@ Configure the following variables
npm run test:unit
```
## Unit tests : Notes
- All individual unit tests are independent of each other. We don't use any shared state between tests.
- Test environment includes `sakila` sample database and any change to it by a test is reverted before running other tests.
- While running unit tests, it tries to connect to mysql server running on `localhost:3306` with username `root` and password `password`(which can be configured) and if not found, it will use `sqlite` as a fallback, hence no requirement of any sql server to run tests.
### Folder structure
### Folder Structure
The root folder for unit tests is `packages/tests/unit`
@ -52,19 +51,18 @@ The root folder for unit tests is `packages/tests/unit`
- `index.test.ts` is the root test suite file which imports all the test suites.
- `TestDbMngr.ts` is a helper class to manage test databases (i.e. creating, dropping, etc.).
### Patterns to follow
### Factory Pattern
- **Factories**
- Use factories for create/update/delete data. No data should be directly create/updated/deleted in the test.
- While writing a factory make sure that it can be used with as less parameters as possible and use default values for other parameters.
- Use named parameters for factories.
``` typescript
- Use factories for create/update/delete data. No data should be directly create/updated/deleted in the test.
- While writing a factory make sure that it can be used with as less parameters as possible and use default values for other parameters.
- Use named parameters for factories.
```ts
createUser({ email, password})
```
- Use one file per factory.
- Use one file per factory.
### Walk through of writing a unit test
### Walk through of writing a Unit Test
We will create an `Table` test suite as an example.
> NOTE: We can also run individual test by using `.only` in `describe` or `it` function and the running the test command.
<alert>
We can also run individual test by using `.only` in `describe` or `it` function and the running the test command.
</alert>
```typescript
it.only('Get table list', async () => {
```
#### Integrating the new test suite
#### Integrating the New Test Suite
We create a new file `table.test.ts` in `packages/nocodb/tests/unit/rest/tests` directory.
@ -158,8 +158,8 @@ export default function () {
We can then import the `Table` test suite to `Rest` test suite in `packages/nocodb/tests/unit/rest/index.test.ts` file(`Rest` test suite is imported in the root test suite file which is `packages/nocodb/tests/unit/index.test.ts`).
If your service fails to start, you may check the logs in ECS console or in Cloudwatch. Generally it fails due to the connection between ECS container and NC_DB. Make sure the security groups have the correct inbound and outbound rules.
</alert>
```
</details>
### GCP (Cloud Run)
<details>
<summary>Click to Expand</summary>
#### Pull NocoDB Image on Cloud Shell
Since Cloud Run only supports images from Google Container Registry (GCR) or Artifact Registry, we need to pull NocoDB image, tag it and push it in GCP using Cloud Shell. Here are some sample commands which you can execute in Cloud Shell.
```bash
# pull latest NocoDB image
docker pull nocodb/nocodb:latest
# tag the image
docker tag nocodb/nocodb:latest gcr.io/<MY_PROJECT_ID>/nocodb/nocodb:latest
It is mandatory to configure `NC_DB` environment variables for production usecases.
@ -274,96 +507,6 @@ It is mandatory to configure `NC_DB` environment variables for production usecas
| NC_ADMIN_EMAIL | No | For updating/creating super admin with provided email and password | | |
| NC_ADMIN_PASSWORD | No | For updating/creating super admin with provided email and password. Your password should have at least 8 letters with one uppercase, one number and one special letter(Allowed special chars <code>$&+,:;=?@#|'.^*()%!_-"</code> ) | | |
If your service fails to start, you may check the logs in ECS console or in Cloudwatch. Generally it fails due to the connection between ECS container and NC_DB. Make sure the security groups have the correct inbound and outbound rules.
NocoDB is a no-code database platform that allows teams to collaborate and build applications with ease of a familiar and intuitive spreadsheet interface. This allows even non-developers or business users to become software creators.
NocoDB works by connecting to any relational database and transforming them into a smart spreadsheet interface! This allows you to build no-code applications collaboratively with teams. NocoDB currently works with MySQL, PostgreSQL, Microsoft SQL Server, SQLite, Amazon Aurora & MariaDB databases.
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.
We are keeping all the user operation logs under Audit. To access it, click the down arrow button next to Project Name on the top left side, then select `Team & Settings`.
@ -46,7 +46,7 @@ Click `Create By Connecting To An External Database`, you need to specify the pr
Tip: If you are running NocoDB on Docker and your local DB is running on your host machine, your Host Address would be host.docker.internal instead of localhost.
Currently it supports MySQL, Postgres, MSSQL and SQLite.
@ -92,4 +92,4 @@ Tip: You can click Edit Connection JSON and specify the schema you want to use i
Click `Test Database Connection` to see if the connection can be established or not. NocoDB creates a new **empty database** with specified parameters if the database doesn't exist.
If you want to help translate, please check out <ahref ="../engineering/translation"target="_blank">i18n</a>. If you want to request a new language, please create an issue on <ahref="https://github.com/nocodb/nocodb/issues"target="_blank">Github</a>.
@ -55,19 +52,19 @@ From the destination project, go to `Project Metadata`. Under ``Export / Import
Go to `Project Metadata`, under ``Metadata``, you can see your metadata sync status. If it is out of sync, you can sync the schema. See <ahref="./sync-schema">Sync Schema</a> for more.
@ -78,8 +75,7 @@ Go to `Project Metadata`, under ``ERD View``, you can see the ERD of your databa
<imgwidth="1681"alt="Show Junction table names for many to many table"src="https://user-images.githubusercontent.com/5435402/192140913-9da37700-28fe-404d-88e8-35ba0c8e2f53.png">
## Miscellaneous
- Enabling, `Show M2M Tables` will show junction tables between many to many tables.
- Enabling, `Show M2M Tables` will show junction tables between many to many tables.
- You can revise the table name by double clicking it, column name and column type. By default, the first column will be chosen as <ahref="./primary-value"target="_blank">Primary Value</a> and cannot be deleted.
- You can revise the table name, column name and column type. By default, the first column will be chosen as <ahref="./primary-value"target="_blank">Primary Value</a> and cannot be deleted.
<alert>
Note: If your Excel file contains multiple sheets, each sheet will be stored in a separate table.
You can export your data from a table as a CSV file by clicking the down arrow next to Table name and hover on `Download`. Currently only CSV and XLSX formats are supported for export.
You can import your data in CSV format to a table by clicking the down arrow next to Table name and hover on `Upload`. Currently only CSV format is supported for upload.
@ -13,14 +13,14 @@ In a table, you can use different views to display your data. You can show speci
To navigate different views, we can select the target one in the view sidebar. By default, Grid View will be created for you after creating the table. You can create multiple views of a type, as long as they have unique View names.
## View Menu Bar
To work with `Views`, use View menu-bar on the right hand side -
- <1> Toggle View menu-bar.
- <2> Displays created view-list for the selected table
- Currently active view is high-lighted
- <3> Add new view to the list
![Screenshot 2022-09-09 at 2 56 15 PM](https://user-images.githubusercontent.com/86527202/189321194-303c4a8c-d9a1-4368-962c-c7596763efb6.png)