Preconfigure a database connection #485

Open
opened 2026-03-04 10:12:58 -05:00 by deekerman · 0 comments
Owner

Originally created by @cafischer on GitHub (Apr 14, 2023).

Describe the bug
In https://github.com/dbeaver/cloudbeaver/wiki/Connection-configuration it is described that database configuration has to be put into ${WORKSPACE}/GlobalConfiguration/.dbeaver/data-sources.json. However, the database connection did not show up in the admin interface. When I instead put it into /opt/cloudbeaver/conf/initial-data-sources.conf the connection showed up as wished. Can you update the documentation or fix the problem with the proposed approach?

To Reproduce
docker-compose.yml

  dbeaver:
    build: ./docker/dbeaver
    container_name: dbeaver
    volumes:
      - database_volume:/db
    ports:
      - 8080:8978
    environment:
      CB_SERVER_NAME: CloudBeaver CE Server
      CB_SERVER_URL: http://localhost:8080
      CB_ADMIN_NAME: someadmin
      CB_ADMIN_PASSWORD: something

volumes:
  database_volume:

Dockerfile

FROM dbeaver/cloudbeaver:23.0.2

# not working:
ADD config/initial-data-sources.conf /opt/cloudbeaver/GlobalConfiguration/.dbeaver/data-sources.json  
# working:
# ADD config/initial-data-sources.conf /opt/cloudbeaver/conf/initial-data-sources.conf

initial-data-sources.conf

{
  "folders": {},
  "connections": {
    "postgresql-template-1": {
      "provider": "postgresql",
      "driver": "postgres-jdbc",
      "name": "PostgreSQL (Template)",
      "save-password": false,
      "show-system-objects": false,
      "read-only": true,
      "template": true,
      "configuration": {
        "host": "localhost",
        "port": "5432",
        "database": "postgres",
        "url": "jdbc:postgresql://localhost:5432/postgres",
        "type": "dev",
        "provider-properties": {
          "@dbeaver-show-non-default-db@": "false"
        }
      }
    },
    "sqlite-database": {
      "provider": "sqlite",
      "driver": "sqlite_jdbc",
      "name": "SQLite@localhost",
      "configuration": {
        "database": "/db/db.sqlite3",
        "url": "jdbc:sqlite:/db/db.sqlite3",
        "configurationType": "MANUAL",
        "type": "dev"
      }
    }
  },
  "connection-types": {
    "dev": {
      "name": "Development",
      "color": "255,255,255",
      "description": "Regular development database",
      "auto-commit": true,
      "confirm-execute": false,
      "confirm-data-change": false,
      "auto-close-transactions": false
    }
  }
}

When starting the application the sqlite database can not be seen in the admin interface under connections.

Originally created by @cafischer on GitHub (Apr 14, 2023). **Describe the bug** In https://github.com/dbeaver/cloudbeaver/wiki/Connection-configuration it is described that database configuration has to be put into ${WORKSPACE}/GlobalConfiguration/.dbeaver/data-sources.json. However, the database connection did not show up in the admin interface. When I instead put it into /opt/cloudbeaver/conf/initial-data-sources.conf the connection showed up as wished. Can you update the documentation or fix the problem with the proposed approach? **To Reproduce** docker-compose.yml ``` dbeaver: build: ./docker/dbeaver container_name: dbeaver volumes: - database_volume:/db ports: - 8080:8978 environment: CB_SERVER_NAME: CloudBeaver CE Server CB_SERVER_URL: http://localhost:8080 CB_ADMIN_NAME: someadmin CB_ADMIN_PASSWORD: something volumes: database_volume: ``` Dockerfile ``` FROM dbeaver/cloudbeaver:23.0.2 # not working: ADD config/initial-data-sources.conf /opt/cloudbeaver/GlobalConfiguration/.dbeaver/data-sources.json # working: # ADD config/initial-data-sources.conf /opt/cloudbeaver/conf/initial-data-sources.conf ``` initial-data-sources.conf ``` { "folders": {}, "connections": { "postgresql-template-1": { "provider": "postgresql", "driver": "postgres-jdbc", "name": "PostgreSQL (Template)", "save-password": false, "show-system-objects": false, "read-only": true, "template": true, "configuration": { "host": "localhost", "port": "5432", "database": "postgres", "url": "jdbc:postgresql://localhost:5432/postgres", "type": "dev", "provider-properties": { "@dbeaver-show-non-default-db@": "false" } } }, "sqlite-database": { "provider": "sqlite", "driver": "sqlite_jdbc", "name": "SQLite@localhost", "configuration": { "database": "/db/db.sqlite3", "url": "jdbc:sqlite:/db/db.sqlite3", "configurationType": "MANUAL", "type": "dev" } } }, "connection-types": { "dev": { "name": "Development", "color": "255,255,255", "description": "Regular development database", "auto-commit": true, "confirm-execute": false, "confirm-data-change": false, "auto-close-transactions": false } } } ``` When starting the application the sqlite database can not be seen in the admin interface under connections.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cloudbeaver#485
No description provided.