2025-02-11 08:47:01 +03:00
|
|
|
---
|
|
|
|
sidebar_position: 5
|
|
|
|
---
|
|
|
|
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
|
|
import TabItem from '@theme/TabItem';
|
|
|
|
|
|
|
|
# Generate connection string
|
|
|
|
Forms a connection string from the passed data
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`Function GenerateConnectionString(Val Address, Val Base, Val Login, Val Password = "", Val Port = "5432") Export`
|
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|
|
|-|-|-|-|-|
|
|
|
|
| Address | --addr | String | ✔ | IP address or domain name of the server |
|
|
|
|
| Base | --db | String | ✔ | Name of the database to connect |
|
|
|
|
| Login | --login | String | ✔ | Postgres user login |
|
|
|
|
| Password | --pass | String | ✖ | Postgres user password |
|
|
|
|
| Port | --port | String | ✖ | Connection port |
|
|
|
|
|
|
|
|
|
|
|
|
Returns: String - PostgreSQL database connection string
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
2025-02-13 21:31:59 +03:00
|
|
|
Address = "93.125.42.204";
|
|
|
|
Login = "bayselonarrend";
|
|
|
|
Password = "12we...";
|
|
|
|
Base = "postgres";
|
2025-02-11 08:47:01 +03:00
|
|
|
|
2025-02-13 21:31:59 +03:00
|
|
|
Result = OPI_PostgreSQL.GenerateConnectionString(Address, Base, Login, Password);
|
2025-02-11 08:47:01 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|