IDatabase.SupportBinaryProtocol

Fore Syntax

SupportBinaryProtocol: Boolean;

Fore.NET Syntax

SupportBinaryProtocol: Boolean;

Description

The SupportBinaryProtocol property determines whether binary queries will be used to work with PostgreSQL server.

Comments

The property is relevant if the database connects to a server based on PostgreSQL DBMS.

Available values:

NOTE. Binary queries can be used if PostgreSQL 9.3 or later is used at DBMS server.

Fore Example

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    DB: IDatabase;
    LogonData: IPrimaryPostgresSPLD;
Begin
    MB := MetabaseClass.Active;
    //Information about created object
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_DATABASE;
    CrInfo.Id := "POSTGRESQL_DB";
    CrInfo.Name := "PostgreSQL database";
    CrInfo.Parent := MB.Root;
    //Create a new database and set up properties
    DB := MB.CreateObject(CrInfo).Edit As IDatabase;
    DB.Authentication := AuthenticationMode.Password;
    DB.DriverId := "POSTGRES";
    DB.SupportBinaryProtocol := True;
    LogonData := DB.LogonData As IPrimaryPostgresSPLD;
    LogonData.Server := "Server";
    LogonData.Database := "PPTest";
    //Save
    (DB As IMetabaseObject).Save;
End Sub UserProc;

After executing the example a new database is created in the repository root directory. The database will connect to the specified schema located at PostgreSQL server. Binary queries will be used when addressing to the server.

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Db;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    DB: IDatabase;
    LogonData: IPrimaryPostgresSPLD;
Begin
    MB := Params.Metabase;
    //Information about created object
    CrInfo := MB.CreateCreateInfo();
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_DATABASE As Integer;
    CrInfo.Id := "POSTGRESQL_DB";
    CrInfo.Name := "PostgreSQL database";
    CrInfo.Parent := MB.Root;
    //Create a new database and set up properties
    DB := MB.CreateObject(CrInfo).Edit() As IDatabase;
    DB.Authentication := AuthenticationMode.amPassword;
    DB.DriverId := "POSTGRES";
    DB.SupportBinaryProtocol := True;
    LogonData := DB.LogonData As IPrimaryPostgresSPLD;
    LogonData.Server := "Server";
    LogonData.Database := "PPTest";
    //Save
    (DB As IMetabaseObject).Save();
End Sub;

See also:

IDatabase