Skip to content

NocoDB

Open Source Airtable Alternative.

NocoDB is an open source NoCode platform that turns any database into a smart spreadsheet.

Features

  • AGPL-3.0 License

Demo

docker run -it --rm -v "$(pwd)"/nocodb:/usr/app/data/ -p 8080:8080 nocodb/nocodb:latest

Healthcheck

/api/v1/db/meta/nocodb/info

$ curl https://table.server.com/api/v1/db/meta/nocodb/info
{"authType":"jwt","projectHasAdmin":true,"firstUser":false,"type":"rest","googleAuthEnabled":false,"githubAuthEnabled":false,"oneClick":false,"connectToExternalDB":true,"version":"0.90.11","defaultLimit":25,"ncMin":false,"teleEnabled":true,"ncSiteUrl":"http://table.server.com"}

/api/v1/db/meta/nocodb/version

$ curl https://table.server.com/api/v1/db/meta/nocodb/version
{"releaseVersion":"0.90.11"}

Installation

postgres with nocodb

version: '2.1'

services:
  root_db:
    image: postgres
    restart: always
    volumes:
      - db_data:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: password
      POSTGRES_USER: postgres
      POSTGRES_DB: root_db
    healthcheck:
      test: pg_isready -U "$$POSTGRES_USER" -d "$$POSTGRES_DB"
      interval: 10s
      timeout: 2s
      retries: 10
  nocodb:
    depends_on:
      root_db:
        condition: service_healthy
    image: nocodb/nocodb:latest
    ports:
      - "8080:8080"
    restart: always
    volumes:
      - nc_data:/usr/app/data
    environment:
      NC_DB: "pg://root_db:5432?u=postgres&p=password&d=root_db"
    healthcheck:
      test:
        - node
        - -e
        - "require(\"http\").get(\"http://localhost:8080/api/v1/db/meta/nocodb/version\", res => res.statusCode === 200 ? process.exit(0) : process.exit(1));"
      interval: 10s
      timeout: 2s
      retries: 10
volumes:
  db_data: {}
  nc_data: {}

Configuration

NC_INVITE_ONLY_SIGNUP=yes
사용자가 초대 URL을 통해서만 가입할 수 있도록 허용합니다.

Troubleshooting

getaddrinfo ENOTFOUND

docker-compose를 직접 사용하면 문제가 없는데 swarm에서 돌리면 다음과 같이 네트워크 에러가 난다.

Error: getaddrinfo ENOTFOUND db
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:66:26) {
  errno: 'ENOTFOUND',
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'db'
}

그냥 docker container ps로 해당 컨테이너 찾아서 docker container restart로 재부팅하면 된다. docker의 네트워크 연결이 늦어져서 그런듯 하다. 나중에 기동시간에 딜레이 줘야할 듯?

실수로 삭제한 테이블 복구 방법

결론부터 말하면, 없다.

psql로 접속해서 nc_projects_v2 테이블 정보를 확인해 보니 다음과 같다:

root_db=# select * from nc_projects_v2;
        id        |       title        |  prefix   |
------------------+--------------------+-----------+
 p_dyfb2n5ij86pn2 | DevTeam            | nc_qndu__ |
...

원하는 프로젝트의 prefix로 등록된 테이블을 확인해 보면 해당 테이블이 존재하는지 확인할 수 있지만 없었다...

root_db-# \dt
                      List of relations
 Schema |               Name               | Type  |  Owner
--------+----------------------------------+-------+----------
 public | nc_1uuy__weekly_report           | table | yourname
...
 public | nc_projects_v2                   | table | yourname
 public | nc_qndu__answer_relase           | table | yourname
...

(nc_qndu__answer_relase 는 있지만, 내가 원하는건 없었다)

거기에, pg_dump로도 sql 추출 후, 확인해보니 없었다.

See also

Favorite site