You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-05-16 09:38:28 +02:00
86 lines
2.5 KiB
Plaintext
Vendored
86 lines
2.5 KiB
Plaintext
Vendored
---
|
|
sidebar_position: 5
|
|
|
|
description: Generate connection string and other functions to work with MySQL in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
|
|
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, MySQL]
|
|
---
|
|
|
|
import Tabs from '@theme/Tabs';
|
|
import TabItem from '@theme/TabItem';
|
|
import Admonition from '@theme/Admonition';
|
|
|
|
# Generate connection string
|
|
Forms a connection string from the passed data
|
|
|
|
|
|
|
|
<Tabs>
|
|
<TabItem value="params" label="Parameters" default>
|
|
|
|
`Function GenerateConnectionString(Val Address, Val Base = "", Val Login = "", Val Password = "", Val Port = "3306") 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 | ✖ | MySQL user |
|
|
| Password | --pass | String | ✖ | MySQL password |
|
|
| Port | --port | String | ✖ | Connection port |
|
|
|
|
|
|
<div className="return-value-note">
|
|
<div className="return-value-note__title">Returns</div>
|
|
<div className="return-value-note__value">
|
|
String - MySQL database connection string
|
|
</div>
|
|
</div>
|
|
|
|
</TabItem>
|
|
<TabItem value="extended" label={<span>Advanced call{' '}<a href="/docs/Start/Advanced-call" target="_blank" rel="noreferrer" title="About advanced call" onClick={(e) => e.stopPropagation()}>?</a></span>}>
|
|
|
|
*This method has no additional advanced call parameters.*
|
|
|
|
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
|
|
```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);
|
|
```
|
|
|
|
|
|
<Tabs>
|
|
|
|
<TabItem value="bash" label="Bash" default>
|
|
```bash
|
|
oint mysql GenerateConnectionString \
|
|
--addr "127.0.0.1" \
|
|
--login "bayselonarrend" \
|
|
--pass "***" \
|
|
--port 3307
|
|
```
|
|
</TabItem>
|
|
|
|
<TabItem value="bat" label="CMD/Bat" default>
|
|
```batch
|
|
oint mysql GenerateConnectionString ^
|
|
--addr "127.0.0.1" ^
|
|
--login "bayselonarrend" ^
|
|
--pass "***" ^
|
|
--port 3307
|
|
```
|
|
</TabItem>
|
|
</Tabs>
|
|
|
|
|
|
```json title="Result"
|
|
"mysql://bayselonarrend:***@127.0.0.1:3306/"
|
|
```
|