2025-02-11 08:47:01 +03:00
---
sidebar_position: 5
2025-05-05 11:15:20 +03:00
description: Generate connection string and other functions to work with PostgreSQL in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
2025-05-05 09:49:19 +03:00
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, PostgreSQL]
2025-02-11 08:47:01 +03:00
---
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-17 17:16:27 +03:00
Address = "127.0.0.1";
2025-02-13 21:31:59 +03:00
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
```
2025-02-18 14:08:09 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
oint postgres GenerateConnectionString \
--addr "127.0.0.1" \
--db "postgres" \
--login "bayselonarrend" \
--pass "***"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
oint postgres GenerateConnectionString ^
--addr "127.0.0.1" ^
--db "postgres" ^
--login "bayselonarrend" ^
--pass "***"
```
</TabItem>
</Tabs>
2025-06-11 18:49:55 +03:00