nanoCAD 3DScan Help

Configuring Connections to Database

CAD drafting Configuring Connections to Database 0 Ribbon: Point Clouds> Database > CAD software Configuring Connections to Database 1 Configuring Connections to Database

CAD drawing Configuring Connections to Database 2 Menu: Point Clouds> Database > CAD drafting Configuring Connections to Database 3 Configuring Connections to Database

CAD software Configuring Connections to Database 4 Toolbars: Point Clouds and Database > CAD drawing Configuring Connections to Database 5

CAD drafting Configuring Connections to Database 6 Command line: PC_STORAGE_CONFIG

The command allows you to configure connections to existing PostgreSQL databases to create point cloud storage on them. The main tool is the Database Configuration toolbar.

The toolbar allows you to:

·          Create new connections;

·          Edit saved connections;

·          Delete saved connections;

·          Update connections;

·          Clear connections;

·          Reset connections;

·          View the connection log (if multiple connections are selected, the log of the first one in the list is opened).

CAD software Configuring Connections to Database 7 Creating new connections

A new connection can created in two ways, depending on the state of the point cloud database in DBMS:

1. DBMS does not contain the required database, or it is empty and contains no data or structure. In this case, the connection must be registered under a DBMS user with administrative rights. You can specify the name of a non-existent database. The command script will detect that such a database does not exist and prompt you to create it. Next, an SQL script will be run on the created or connected database to create the required structure and user groups. The user specified in the connection will then be added to the created point cloud storage user group, and the process of creating a connection will conclude with validation checks for everything created.

2. DBMS contains a database created by other users, and a storage based on it, with a configured structure, user groups, and rights. In this case, the connection can be created under a regular DBMS user, but this user must be a member of the previously created point cloud storage user group.

When creating a connection, a check is performed to ensure that the connection is usable. If the connection is not working, the user will be prompted to either abandon the creation or save it in order to edit some of its parameters later.

In the Host Address field, you can enter the following formats: server name (e.g., https://pgsql.csdev), IP address (e.g., 192.168.1.1), or localhost.

CAD drawing Configuring Connections to Database 8 Set as default.

If there are multiple connections in the list, you can set a default connection.

CAD drafting Configuring Connections to Database 9 Editing connection.

Allows you to change the connection’s parameters.

CAD software Configuring Connections to Database 10 Delete connection.

Deletes the selected connection.

CAD drawing Configuring Connections to Database 11Checking the connection status.

To optimize the toolbar work, the first time the toolbar is launched, it does not automatically check the connection status, as this could lead to long monitoring wait times. Instead, the user has a mechanism for updating the status of connections: the one selected in the list CAD drafting Configuring Connections to Database 12, or all connections in the list CAD software Configuring Connections to Database 13.

The following information is available for each connection:

Connection status

1. The database is accessible and has the correct structure

2. The database is accessible, but has an incorrect structure

A newer version of the database is available, but the older version can still be used. However, some functionality may be unavailable.

A newer version of the database is available. The current version of nanoCAD does not support the older version. An update is required.

The database version is newer than nanoCAD, but it can still be used. However, some functionality may be unavailable.

The database version is newer than nanoCAD. The current version of nanoCAD does not support the newer version of the database. An update is required.

3. User does not have database access rights

This situation occurs when connecting to an existing database, but the user connecting is not a member of the point cloud storage user group. To resolve this, contact the database administrator, who should add the user to the point cloud storage user group.

4. Database unavailable

This situation occurs if, for some reason, the connection could not be established. Check the connection details and contact the database administrator.

Connection name

The connection name cannot be edited. To change the connection name, recreate the connection.

Data size in the database

Data Size in the Database.

DB structure version

A database structure version consists of a major and a minor version. The major version describes the data structure, while the minor version describes the set of functions and stored procedures. Changing the major version (in a new version of nanoCAD) requires recreating the storage and can only be done by explicitly selecting the Reset button by the user. This will result in the loss of all data in the storage. Changing the minor version of the structure can be done seamlessly by an automatic update. This does not threaten the integrity of the data in the storage. Automatic updates are checked and performed when updating connection statuses in the connection list panel.

Additionally, depending on the connection status, two actions are available:

·          Clear an existing database

·          Update the structure of an existing database

CAD drawing Configuring Connections to Database 14 Connection logging.

Allows you to view the connection log (if multiple connections are selected, the log for the first one in the list is opened).

Min. level – Message filtering. If the min. level is set to Error, only logs with errors and critical errors will be displayed in the window. If the min. level is set to INFO, logs with Debug will not be included in the list.

Refresh – Refreshes.

Clear – Clears the log.

Copy – Copies the selected rows or all rows if none are selected.

Save – Saves to a file.

Alternative database setup

The connection list panel allows you to create a database and fully configure it for use as a point cloud storage. Optionally, you can configure the database through the PostgreSQL administrative tools. Database creation script:

CREATE DATABASE “Name” WITH OWNER = c_admin TEMPLATE = ''template0'' ENCODING = ''SQL_ASCII'' TABLESPACE = pg_default LC_COLLATE = ''C'' LC_CTYPE = ''C'' CONNECTION LIMIT = -1;

It is also necessary to first create the c_user user group and the c_admin superuser, which will be used to create the database. When creating the database, these groups should be assigned permissions to work with the DBMS being created:

CREATE ROLE c_user WITH LOGIN INHERIT CREATEROLE PASSWORD “Password”;

CREATE ROLE c_admin WITH LOGIN SUPERUSER INHERIT CREATEROLE CREATEDB PASSWORD “Password”;

GRANT c_user TO c_admin;

SET ROLE c_admin;

GRANT USAGE ON SCHEMA public TO c_user;

GRANT ALL ON ALL TABLES IN SCHEMA public TO c_user;

GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO c_user;

GRANT ALL ON ALL FUNCTIONS IN SCHEMA public TO c_user;

ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO recs_user;

ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO c_user;

ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON FUNCTIONS TO c_user;

Connection settings are saved in the protected Default.dbcfg file.