Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-5369. Added API for transaction log for commits #3183

Merged
merged 27 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
02baaf3
CB-5369. Added API for transaction log for commits
DenisSinelnikov Jan 9, 2025
d352e50
Merge branch 'devel' into CB-5369-transaction-log-for-commits
DenisSinelnikov Jan 9, 2025
8d47710
CB-5369. Refactor after review
DenisSinelnikov Jan 9, 2025
1f04b43
Merge remote-tracking branch 'origin/CB-5369-transaction-log-for-comm…
DenisSinelnikov Jan 9, 2025
89e0ff4
CB-5369 add transaction logs table
devnaumov Jan 9, 2025
d0c621b
Merge branches 'CB-5369-transaction-log-for-commits' and 'CB-5369-tra…
devnaumov Jan 9, 2025
854f830
CB-5369. Added id for data
DenisSinelnikov Jan 10, 2025
0848dbf
Merge remote-tracking branch 'origin/CB-5369-transaction-log-for-comm…
DenisSinelnikov Jan 10, 2025
5f44a3b
CB-5369 fix typo
devnaumov Jan 10, 2025
b9fd5fb
CB-5369. Added event for get count
DenisSinelnikov Jan 10, 2025
a171da8
Merge remote-tracking branch 'origin/CB-5369-transaction-log-for-comm…
DenisSinelnikov Jan 10, 2025
024c671
CB-5369. Refactor event
DenisSinelnikov Jan 12, 2025
6659111
CB-5369. Refactor event
DenisSinelnikov Jan 12, 2025
bc54897
CB-5369. Refactor after review
DenisSinelnikov Jan 12, 2025
5622605
CB-5369. Refactor after review
DenisSinelnikov Jan 12, 2025
4e7b62f
CB-5369. Added connectionId to event
DenisSinelnikov Jan 12, 2025
3314f75
CB-5369 support count event
devnaumov Jan 12, 2025
c1f5834
CB-5369. Rename eventId
DenisSinelnikov Jan 13, 2025
96954ff
Merge remote-tracking branch 'origin/CB-5369-transaction-log-for-comm…
DenisSinelnikov Jan 13, 2025
0647177
CB-5369 adjust count styles
devnaumov Jan 13, 2025
6bea6b0
CB-5369 format time
devnaumov Jan 13, 2025
41c60fa
CB-5369 add missing deps
devnaumov Jan 13, 2025
abad3a0
CB-5369 remove extra important flags
devnaumov Jan 13, 2025
3c5332a
CB-5369 review fixes
devnaumov Jan 13, 2025
8f6e63e
CB-5369 remove extra import
devnaumov Jan 13, 2025
e0e5f82
Merge branch 'devel' into CB-5369-transaction-log-for-commits
dariamarutkina Jan 14, 2025
691ae67
Merge branch 'devel' into CB-5369-transaction-log-for-commits
dariamarutkina Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions server/bundles/io.cloudbeaver.server/schema/service.core.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,21 @@ type LogEntry {
stackTrace: String
}


type TransactionLogInfos {
DenisSinelnikov marked this conversation as resolved.
Show resolved Hide resolved
count: Int
transactionLogInfos: [ TransactionLogInfoItem ]
}
Wroud marked this conversation as resolved.
Show resolved Hide resolved

type TransactionLogInfoItem {
time: DateTime
type: String
queryString: String
durationMs: Int
rows: Int
result: String
Wroud marked this conversation as resolved.
Show resolved Hide resolved
}

####################################################
# Input types
####################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,12 @@ extend type Mutation {
dataFormat: ResultDataFormat
): AsyncTaskInfo!

getTransactionLogInfo(
projectId: ID!,
connectionId: ID!,
contextId: ID!
): TransactionLogInfos

# Close results (free resources)
sqlResultClose(projectId: ID, connectionId: ID!, contextId: ID!, resultId: ID!): Boolean!

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 DBeaver Corp and others
* Copyright (C) 2010-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -27,6 +27,7 @@
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.model.exec.DBCLogicalOperator;
import org.jkiss.dbeaver.model.exec.trace.DBCTraceProperty;
import org.jkiss.dbeaver.model.qm.QMTransactionLogInfo;
import org.jkiss.dbeaver.model.sql.registry.SQLGeneratorDescriptor;

import java.util.List;
Expand Down Expand Up @@ -202,4 +203,10 @@
WebAsyncTaskInfo asyncSqlCommitTransaction(
@NotNull WebSession webSession,
@NotNull WebSQLContextInfo sqlContext);

@WebAction

Check warning on line 207 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/DBWServiceSQL.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/DBWServiceSQL.java:207:5: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

Check warning on line 207 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/DBWServiceSQL.java

View check run for this annotation

Jenkins-CI-integration / CheckStyle Java Report

server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/DBWServiceSQL.java#L207

Missing a Javadoc comment.
QMTransactionLogInfo getTransactionLogInfo(
@NotNull WebSession webSession,
@NotNull WebSQLContextInfo sqlContext
);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 DBeaver Corp and others
* Copyright (C) 2010-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,6 +31,7 @@
import org.jkiss.dbeaver.model.exec.*;
import org.jkiss.dbeaver.model.exec.trace.DBCTrace;
import org.jkiss.dbeaver.model.meta.Property;
import org.jkiss.dbeaver.model.qm.QMTransactionLogInfo;
import org.jkiss.dbeaver.model.qm.QMTransactionState;
import org.jkiss.dbeaver.model.qm.QMUtils;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
Expand Down Expand Up @@ -216,7 +217,12 @@

}

public QMTransactionLogInfo getTransactionLogInfo() {

Check warning on line 220 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLContextInfo.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLContextInfo.java:220:5: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)

Check warning on line 220 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLContextInfo.java

View check run for this annotation

Jenkins-CI-integration / CheckStyle Java Report

server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLContextInfo.java#L220

Missing a Javadoc comment.
DBCExecutionContext context = processor.getExecutionContext();
return QMUtils.getTransactionLogInfo(context);
}

public WebAsyncTaskInfo commitTransaction() {

Check warning on line 225 in server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLContextInfo.java

View workflow job for this annotation

GitHub Actions / Server / Lint

[checkstyle] reported by reviewdog 🐶 Missing a Javadoc comment. Raw Output: /github/workspace/./server/bundles/io.cloudbeaver.server/src/io/cloudbeaver/service/sql/WebSQLContextInfo.java:225:5: warning: Missing a Javadoc comment. (com.puppycrawl.tools.checkstyle.checks.javadoc.MissingJavadocMethodCheck)
DBCExecutionContext context = processor.getExecutionContext();
DBCTransactionManager txnManager = DBUtils.getTransactionManager(context);
WebAsyncTaskProcessor<String> runnable = new WebAsyncTaskProcessor<>() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 DBeaver Corp and others
* Copyright (C) 2010-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -226,6 +226,11 @@ public void bindWiring(DBWBindingContext model) throws DBWebException {
getWebSession(env),
getSQLContext(env)
))
.dataFetcher("getTransactionLogInfo", env ->
getService(env).getTransactionLogInfo(
getWebSession(env),
getSQLContext(env)
))
.dataFetcher("asyncSqlRollbackTransaction", env ->
getService(env).asyncSqlRollbackTransaction(
getWebSession(env),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2024 DBeaver Corp and others
* Copyright (C) 2010-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -42,6 +42,7 @@
import org.jkiss.dbeaver.model.impl.sql.BasicSQLDialect;
import org.jkiss.dbeaver.model.navigator.DBNModel;
import org.jkiss.dbeaver.model.navigator.DBNNode;
import org.jkiss.dbeaver.model.qm.QMTransactionLogInfo;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.model.sql.*;
import org.jkiss.dbeaver.model.sql.completion.SQLCompletionAnalyzer;
Expand Down Expand Up @@ -615,4 +616,8 @@ public WebAsyncTaskInfo asyncSqlCommitTransaction(@NotNull WebSession webSession
return contextInfo.commitTransaction();
}

@Override
public QMTransactionLogInfo getTransactionLogInfo(@NotNull WebSession webSession, @NotNull WebSQLContextInfo sqlContext) {
return sqlContext.getTransactionLogInfo();
}
}
Loading