Skip to content

Commit aa0ad65

Browse files
committed
docs: add example image to query insights
1 parent ccd3b98 commit aa0ad65

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

README.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ the [Hyperf](https://github.com/hyperf/hyperf) framework. These comments use
1414
the [sqlcommenter](https://google.github.io/sqlcommenter/) format, which is understood by various database tools and
1515
services, providing enhanced insights and traceability for your application's database interactions.
1616

17+
## Installation
18+
19+
You can install the library via Composer:
20+
21+
```shell
22+
composer require reinanhs/sqlcommenter-hyperf
23+
```
24+
25+
Add component configuration:
26+
27+
```shell
28+
php bin/hyperf.php vendor:publish reinanhs/sqlcommenter-hyperf
29+
```
30+
1731
## Sample
1832

1933
See an example of a simple query being executed:
@@ -26,7 +40,7 @@ Using this package, comments like this will be added:
2640

2741
```sql
2842
select * from users /*framework='Hyperf',
29-
application='hyperf-skeleton'
43+
application='hyperf-skeleton',
3044
controller='UserController',
3145
action='index',
3246
route='%%2Fapi%%2Ftest',
@@ -52,31 +66,10 @@ Various tools and services can interpret these comments, helping to correlate us
5266

5367
Here is an example of how this information appears within [Google Cloud SQL](https://cloud.google.com/sql/docs/postgres/using-query-insights):
5468

55-
![Exemplo do sqlcommenter na GCP](image.png)
69+
![SQLcommenter example on GCP](https://i.imgur.com/lce2iZ6.png)
5670

5771
In addition to **Cloud SQL**, several other tools also support _sqlcommenter_. One example is the [Planetscale Query Insights](https://planetscale.com/docs/concepts/query-insights).
5872

59-
## Features
60-
61-
- Automatically adds sqlcommenter-compatible comments to SQL queries.
62-
- Provides better traceability and insights into database interactions.
63-
- Easy integration with the Hyperf framework.
64-
- Supports multiple database drivers.
65-
66-
## Installation
67-
68-
You can install the library via Composer:
69-
70-
```shell
71-
composer require reinanhs/sqlcommenter-hyperf
72-
```
73-
74-
Add component configuration:
75-
76-
```shell
77-
php bin/hyperf.php vendor:publish reinanhs/sqlcommenter-hyperf
78-
```
79-
8073
## Config
8174

8275
When you install the library in your project, it will be automatically enabled through the default settings. Therefore, to use this library, you only need to have it installed in your project.
@@ -100,6 +93,13 @@ With the settings below, you can enable or disable the comments generated by thi
10093

10194
You can refer to the documentation for more details.
10295

96+
## Features
97+
98+
- Automatically adds sqlcommenter-compatible comments to SQL queries.
99+
- Provides better traceability and insights into database interactions.
100+
- Easy integration with the Hyperf framework.
101+
- Supports multiple database drivers.
102+
103103
## Performance
104104

105105
Using the Sqlcommenter Hyperf library may introduce a small performance impact due to the addition of comments to SQL queries. However, the benefits in terms of traceability, ease of debugging, and integration with monitoring tools generally outweigh this impact.

0 commit comments

Comments
 (0)