Skip to content

Commit 08262fd

Browse files
doc: update README.md 📝
1 parent 63db904 commit 08262fd

File tree

1 file changed

+23
-8
lines changed

1 file changed

+23
-8
lines changed

README.md

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,42 @@ If you don't know what is Testcontainers, please check their official web page h
2727

2828
## Usage
2929

30-
For having a working plugin there are 2 requirements;
30+
For having a working plugin, there are 2 requirements;
3131

32-
1- The plugin expects that Testcontainers writes a log that starts with ` Database: `. If you don't see any logs on your console, please check your Testcontainers configurations and your log level.
32+
1- The plugin expects that your application writes a log that starts with the log entry prefix (default log entry prefix is `Database:`).
33+
If you don't see any logs on your console, please check your configurations and your log level.
3334

3435
Example log;
3536
```
3637
2021-06-23 14:07:26.408 INFO [your-service,,] 11111 --- [ main] o.f.c.i.database.base.DatabaseType : Database: jdbc:postgresql://localhost:12345/test (PostgreSQL 10.13)
3738
```
3839

39-
2- Copy the URL from the Testcontainers log and add it to your IntelliJ as a new data source. For more details, please visit [this page](https://www.jetbrains.com/help/idea/connecting-to-a-database.html) from IntelliJ.
40+
2- Copy the URL (`jdbc:postgresql://localhost:12345/test`) from the console log and add it to your IntelliJ as a new data source.
41+
For more details, please visit [this page](https://www.jetbrains.com/help/idea/connecting-to-a-database.html) from IntelliJ.
4042

4143
After covering these 2 requirements, the plugin automatically will catch the log and update the matched data source URL with the Testcontainers' one.
4244

4345
### Plugin Settings
4446

4547
To adjust Testcontainers Port Updater plugin settings, open IntelliJ preferences and navigate to **Tools | Testcontainers Port Updater**.
46-
47-
Currently, there is only one setting is possible:
48-
49-
- To enable/disable 'Updated data source URL' notifications, check/uncheck "Do you want to get notified from Testcontainers Port Updater?" option.
50-
48+
Please be aware, settings are stored at the project level, so each project has its own settings.
49+
50+
#### - `Enable notifications` Enable/disable 'Updated data source URL' notifications
51+
#### - `Enter log entry prefix` Default is `Database:`
52+
#### - `Select match mode`
53+
- `Exact match`<br>
54+
Logged data source URL and IntelliJ data source URL should be the same ignoring port part. Example match will be:<br>
55+
<b>Logged data source URL:</b> `Database: jdbc:postgresql://localhost:11111/test?loggerLevel=OFF`<br>
56+
<b>IntelliJ data source URL:</b> `jdbc:postgresql://localhost:22222/test?loggerLevel=OFF`<br><br>
57+
- `Everything`<br>
58+
Before the port part (`jdbc:postgresql://localhost`) should be the same for the logged data source URL and IntelliJ data source URL. Example match will be:<br>
59+
<b>Logged data source URL:</b> `Database: jdbc:postgresql://localhost:11111/test`<br>
60+
<b>IntelliJ data source URL:</b> `jdbc:postgresql://localhost:22222/test?loggerLevel=OFF`<br><br>
61+
- `With testcontainers=true parameter`<br>
62+
IntelliJ data source URL should contain `testcontainers=true` and before the port part (`jdbc:postgresql://localhost`) should be the same\
63+
for the logged data source URL and IntelliJ data source URL. Example match will be:<br>
64+
<b>Logged data source URL:</b> `Database: jdbc:postgresql://localhost:11111/test?loggerLevel=OFF`<br>
65+
<b>IntelliJ data source URL:</b> `jdbc:postgresql://localhost:22222/test?testcontainers=true`
5166
---
5267
Plugin based on the [IntelliJ Platform Plugin Template][template].
5368

0 commit comments

Comments
 (0)