Skip to main content
Jump to: navigation, search

Difference between revisions of "BaSyx / Download / Components Setup"

Line 3: Line 3:
 
The Components package requires an SQL backend to be able to run the DirectorySQLProvider. This backend can for example be provided by [https://www.postgresql.org/ postgreSQL].
 
The Components package requires an SQL backend to be able to run the DirectorySQLProvider. This backend can for example be provided by [https://www.postgresql.org/ postgreSQL].
  
Choose the following credentials:
+
During installation of the SQL backend, choose the following credentials:
  
 
'''user''': postgres
 
'''user''': postgres
Line 9: Line 9:
 
'''password''': admin
 
'''password''': admin
  
 
+
To setup the database for the test cases, open up a console and use the following commands:
To setup the database for the test cases use the following commands:
+
  
 
{| class="wikitable" style="text-align: left;"
 
{| class="wikitable" style="text-align: left;"
Line 18: Line 17:
 
Create configuration directory:
 
Create configuration directory:
  
initdb -D "*PATH*" -U *USER*
+
initdb -D "<installation-path>" -U <username>
  
default user: postgres
+
Where <installation-path> is a path to a directory you have the right to write to, and <username> would be "postgres". Now you start the database with
  
Start database:
+
pg_ctl -D "<installation-path>" start
  
pg_ctl -D "*PATH*" start
+
and connect your command line interface to the running instance with
  
Connect command line to running instance:
+
psql -U <username>
  
psql -U *USER*
+
|-
 +
|}
  
Create and fill database:
+
With the following SQL commands you can now create and fill the database as follows:
  
 +
{| class="wikitable" style="text-align: left;"
 +
|-
 +
|
 
CREATE DATABASE "basyx-map";
 
CREATE DATABASE "basyx-map";
  

Revision as of 10:43, 6 August 2019

How to run the BaSyx Components

The Components package requires an SQL backend to be able to run the DirectorySQLProvider. This backend can for example be provided by postgreSQL.

During installation of the SQL backend, choose the following credentials:

user: postgres

password: admin

To setup the database for the test cases, open up a console and use the following commands:

Create configuration directory:

initdb -D "<installation-path>" -U <username>

Where <installation-path> is a path to a directory you have the right to write to, and <username> would be "postgres". Now you start the database with

pg_ctl -D "<installation-path>" start

and connect your command line interface to the running instance with

psql -U <username>

With the following SQL commands you can now create and fill the database as follows:

CREATE DATABASE "basyx-map";

\c basyx-map

CREATE SCHEMA elements;

CREATE DATABASE "basyx-directory";

\c basyx-directory

CREATE SCHEMA directory;

CREATE TABLE directory.directory ( "ElementRef" varchar(999999), "ElementID" varchar(999999) primary key );

INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES ( 'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-19', 'content.aas1' );

INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES ( 'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-18', 'content.aas2' );

INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES ( 'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-17', 'content.aas3' );

INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES ( 'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-16', 'content.aas4' );

INSERT INTO directory.directory ( "ElementID", "ElementRef" ) VALUES ( 'urn:de.FHG:es.iese:aas:0.98:5:lab/microscope#A-15', 'content.aas5' );

Back to the top