1- # install
1+ This repository contains a simple [ Trino] ( https://trino.io ) event listener
2+ plugin for persisting information on completed queries to a database table.
23
3- build plugin:
4+ Currently, only MySQL is supported but support for other database systems
5+ could be easily added if anyone is interested since [ Flyway] ( https://flywaydb.org )
6+ is used for database migrations.
7+
8+ # Installation
9+
10+ ## From release
11+
12+ 1 . Download the release ZIP from the releases page
13+ 2 . unzip file and copy folder to Trino plugin directory
14+ 3 . Create a database/schema in MySQL:
15+ ```
16+ create database trino_db_event_listener;
17+ ```
18+ 4 . create an ` event-listener.properties ` file with contents like:
19+ ```
20+ event-listener.name=db-event-listener
21+ db-listener.url=jdbc:mysql://localhost:3306/trino_db_event_listener
22+ db-listener.user=trino
23+ db-listener.password=trino
24+ ```
25+ 5 . restart Trino
26+
27+ ## From Source
28+
29+ Checkout and build the plugin:
430
531```
632mvn clean install -DskipTests
733```
834
9- unzip folder and copy to trino plugin folder
35+ This will create a folder in the ` target ` directory. Copy this folder to
36+ the Trino plugin folder:
1037
1138```
12- cp -R trino-simple-db-logger-376 /path/to/trino/folder/plugin
39+ cp -R target/ trino-simple-db-logger-376 /path/to/trino/folder/plugin
1340```
1441
15- create schema
42+ Create a database/ schema in MySQL:
1643
1744```
1845create database trino_db_event_listener;
46+ ```
1947
20- create `event-listener.properties` file:
48+ Create an ` event-listener.properties ` file with contents like :
2149
2250```
2351event-listener.name=db-event-listener
@@ -26,11 +54,11 @@ db-listener.user=trino
2654db-listener.password=trino
2755```
2856
29- restart trino
30-
31- verify plugin is loaded and table got created in mysql
57+ Finally, restart trino. Once Trino is up and running, verify the plugin is
58+ loaded and the ` queries ` table was created in MySQL.
3259
33- if working correctly, will see the following in the Trino `server.log` file:
60+ If the plugin is working correctly, you will see the following in the Trino
61+ ` server.log ` file:
3462
3563```
36642022-04-29T16:03:11.763-0400 INFO main io.trino.eventlistener.EventListenerManager -- Loading event listener etc/event-listener.properties --
0 commit comments