IPrimaryPostgresSPLD.Database

Syntax

Database: String;

Description

The Database property determines a database identifier on the PostgreSQL server with the ability to specify a custom schema.

Comments

The public schema is used by default. If on DBMS back end preparation a custom schema was created that is used as a default schema, enter it via a point after database identifier using the IPrimaryPostgresSPLD.SchemaOnly property. The example of database identifiers and custom schema: REPOSITORY_ID.myschema.

If database and custom schema were set in the IPrimaryPostgresSPLD.DatabaseOnly and IPrimaryPostgresSPLD.SchemaOnly properties, the Database property will contain both database identifier and custom schema identifier.

Example

Executing the example requires that the PostgreSQL DBMS server contains the DB_REPOSITORY database. DNS-name of server - Server, default schema - public. Make sure that a repository is created based on the specified database.

Add a link to the Metabase system assembly.

Sub UserProc;
Var
    MbMan: IMetabaseManager;
    MbDefs: IMetabaseDefinitions;
    MbDef: IMetabaseDefinition;
    PostgreSPLD: IPrimaryPostgresSPLD;
Begin
    // Get repository manager parameters
    MbMan := MetabaseManagerFactory.Active;
    MbDefs := MbMan.Definitions;
    // Add a new repository connection
    MbDef := MbDefs.Add;
    MbDef.DriverId := "POSTGRES";
    MbDef.Id := "Test_PostgreSQL";
    MbDef.Name := "Test_PostgreSQL";
    MbDef.Authentication := AuthenticationMode.Password;
    MbDef.SecurityPackage := "STANDARDSECURITYPACKAGE";
    PostgreSPLD := MbDef.LogonData As IPrimaryPostgresSPLD;
    // Set PostgreSQL DBMS server name
    PostgreSPLD.Server := "Server";
    // Set identifier of the database, in which repository is created
    PostgreSPLD.DatabaseOnly := "DB_REPOSITORY";
    PostgreSPLD.SupportBinaryProtocol := True;
    PostgreSPLD.CaseSensitive := True;
    // Save changes
    MbDef.Save;
End Sub UserProc;

After executing the example a new repository connection is created. The DBMS server will be addressed using binary requests taking into account case of repository name, identifiers of objects and their fields in DBMS.

See also:

IPrimaryPostgresSPLD