2025-03-27 20:05:59 +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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-04-03 22:56:38 +03:00
|
|
|
`Function GenerateConnectionString(Val Address, Val Base = "", Val Login = "", Val Password = "", Val Port = "3306") Export`
|
2025-03-27 20:05:59 +03:00
|
|
|
|
|
|
|
|
| Parameter | CLI option | Type | Required | Description |
|
|
|
|
|
|-|-|-|-|-|
|
|
|
|
|
| Address | --addr | String | ✔ | IP address or domain name of the server |
|
2025-04-03 22:56:38 +03:00
|
|
|
| Base | --db | String | ✖ | Name of the database to connect |
|
|
|
|
|
| Login | --login | String | ✖ | MySQL user |
|
2025-03-27 20:05:59 +03:00
|
|
|
| Password | --pass | String | ✖ | MySQL password |
|
|
|
|
|
| Port | --port | String | ✖ | Connection port |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns: String - MySQL database connection string
|
|
|
|
|
|
|
|
|
|
<br/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```bsl title="1C:Enterprise/OneScript code example"
|
|
|
|
|
Address = "127.0.0.1";
|
|
|
|
|
Login = "bayselonarrend";
|
|
|
|
|
Password = "12we...";
|
|
|
|
|
Base = "";
|
|
|
|
|
|
|
|
|
|
Result = OPI_MySQL.GenerateConnectionString(Address, Base, Login, Password);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|