You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-8Lines changed: 23 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,27 +27,42 @@ If you don't know what is Testcontainers, please check their official web page h
27
27
28
28
## Usage
29
29
30
-
For having a working plugin there are 2 requirements;
30
+
For having a working plugin, there are 2 requirements;
31
31
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.
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.
40
42
41
43
After covering these 2 requirements, the plugin automatically will catch the log and update the matched data source URL with the Testcontainers' one.
42
44
43
45
### Plugin Settings
44
46
45
47
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`
51
66
---
52
67
Plugin based on the [IntelliJ Platform Plugin Template][template].
0 commit comments