Skip to content

Commit

Permalink
fix: Schema is a reserved keyword (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
phzietsman authored Sep 10, 2024
1 parent 80ce064 commit ef9229a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main/java/cloudandthings/plugin/telogger/TELogger.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void saveQuery(QueryCompletedEvent queryCompletedEvent, Handle handle)
"INSERT INTO queries (" +
" query_id," +
" catalog," +
" `schema`," +
" schema_name," +
" environment," +
" query_text," +
" query_plan," +
Expand Down Expand Up @@ -96,7 +96,7 @@ private void saveQuery(QueryCompletedEvent queryCompletedEvent, Handle handle)
"VALUES (" +
" :query_id," +
" :catalog," +
" :schema," +
" :schema_name," +
" :environment," +
" :query_text," +
" :query_plan," +
Expand Down Expand Up @@ -154,7 +154,7 @@ private void saveQuery(QueryCompletedEvent queryCompletedEvent, Handle handle)
handle.createUpdate(sql)
.bind("query_id", queryCompletedEvent.getMetadata().getQueryId())
.bind("catalog", queryCompletedEvent.getContext().getCatalog().orElse(""))
.bind("schema", queryCompletedEvent.getContext().getSchema().orElse(""))
.bind("schema_name", queryCompletedEvent.getContext().getSchema().orElse(""))
.bind("environment", queryCompletedEvent.getContext().getEnvironment())
.bind("query_text", queryCompletedEvent.getMetadata().getQuery())
.bind("query_plan", queryCompletedEvent.getMetadata().getPlan().orElse(""))
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/db/mysql/V1__create_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ CREATE TABLE queries (
id INT NOT NULL AUTO_INCREMENT,
query_id VARCHAR(50),
catalog VARCHAR(256),
`schema` VARCHAR(256),
schema_name VARCHAR(256),
environment VARCHAR(256),
query_text LONGTEXT NOT NULL,
query_plan LONGTEXT,
Expand Down

0 comments on commit ef9229a

Please sign in to comment.