@@ -140,13 +140,13 @@ public java.util.List<java.util.Map<String, Object>> getTableColumns(String tabl
140140
141141 @ Override
142142 public java .util .List <java .util .Map <String , Object >> query (io .teaql .core .UserContext context , String sql , Object [] args ) {
143- boolean logging = context .isExecutionLoggingEnabled ();
143+ boolean logging = context .isQueryExecutionLoggingEnabled ();
144144 long start = logging ? System .nanoTime () : 0L ;
145145 java .util .List <java .util .Map <String , Object >> res = executionAdapter .queryForList (sql , args );
146146 if (!logging ) return res ;
147147 long elapsed = (System .nanoTime () - start ) / 1000 ;
148148 io .teaql .core .ExecutionMetadata meta = new io .teaql .core .ExecutionMetadata ();
149- meta .setBackend ("SQL-" + name );
149+ meta .setBackend (debugDatabaseKind . toLowerCase ( java . util . Locale . ROOT ) );
150150 meta .setOperation (io .teaql .core .DataServiceOperation .QUERY );
151151 meta .setElapsedUs (elapsed );
152152 meta .setResultCount (res .size ());
@@ -162,13 +162,13 @@ public java.util.List<java.util.Map<String, Object>> query(io.teaql.core.UserCon
162162 public <T extends io .teaql .core .Entity > java .util .List <T > query (
163163 io .teaql .core .UserContext context , String sql , Object [] args ,
164164 io .teaql .core .CompiledRowMapper <T > rowMapper ) {
165- boolean logging = context .isExecutionLoggingEnabled ();
165+ boolean logging = context .isQueryExecutionLoggingEnabled ();
166166 long start = logging ? System .nanoTime () : 0L ;
167167 java .util .List <T > res = executionAdapter .query (sql , args , rowMapper );
168168 if (!logging ) return res ;
169169 long elapsed = (System .nanoTime () - start ) / 1000 ;
170170 io .teaql .core .ExecutionMetadata meta = new io .teaql .core .ExecutionMetadata ();
171- meta .setBackend ("SQL-" + name );
171+ meta .setBackend (debugDatabaseKind . toLowerCase ( java . util . Locale . ROOT ) );
172172 meta .setOperation (io .teaql .core .DataServiceOperation .QUERY );
173173 meta .setElapsedUs (elapsed );
174174 meta .setResultCount (res .size ());
@@ -182,13 +182,13 @@ public <T extends io.teaql.core.Entity> java.util.List<T> query(
182182
183183 @ Override
184184 public int executeUpdate (io .teaql .core .UserContext context , String sql , Object [] args ) {
185- boolean logging = context .isExecutionLoggingEnabled ();
185+ boolean logging = context .isMutationExecutionLoggingEnabled ();
186186 long start = logging ? System .nanoTime () : 0L ;
187187 int res = executionAdapter .update (sql , args );
188188 if (!logging ) return res ;
189189 long elapsed = (System .nanoTime () - start ) / 1000 ;
190190 io .teaql .core .ExecutionMetadata meta = new io .teaql .core .ExecutionMetadata ();
191- meta .setBackend ("SQL-" + name );
191+ meta .setBackend (debugDatabaseKind . toLowerCase ( java . util . Locale . ROOT ) );
192192 meta .setOperation (io .teaql .core .DataServiceOperation .MUTATION );
193193 meta .setElapsedUs (elapsed );
194194 meta .setAffectedRows ((long ) res );
@@ -202,7 +202,7 @@ public int executeUpdate(io.teaql.core.UserContext context, String sql, Object[]
202202
203203 @ Override
204204 public int [] batchUpdate (io .teaql .core .UserContext context , String sql , java .util .List <Object []> batchArgs ) {
205- boolean logging = context .isExecutionLoggingEnabled ();
205+ boolean logging = context .isMutationExecutionLoggingEnabled ();
206206 long start = logging ? System .nanoTime () : 0L ;
207207 int [] res = executionAdapter .batchUpdate (sql , batchArgs );
208208 if (!logging ) return res ;
@@ -216,7 +216,7 @@ public int[] batchUpdate(io.teaql.core.UserContext context, String sql, java.uti
216216 }
217217 }
218218 io .teaql .core .ExecutionMetadata meta = new io .teaql .core .ExecutionMetadata ();
219- meta .setBackend ("SQL-" + name );
219+ meta .setBackend (debugDatabaseKind . toLowerCase ( java . util . Locale . ROOT ) );
220220 meta .setOperation (io .teaql .core .DataServiceOperation .MUTATION );
221221 meta .setElapsedUs (elapsed );
222222 meta .setAffectedRows ((long ) total );
@@ -230,13 +230,13 @@ public int[] batchUpdate(io.teaql.core.UserContext context, String sql, java.uti
230230
231231 @ Override
232232 public void execute (io .teaql .core .UserContext context , String sql ) {
233- boolean logging = context .isExecutionLoggingEnabled ();
233+ boolean logging = context .isMutationExecutionLoggingEnabled ();
234234 long start = logging ? System .nanoTime () : 0L ;
235235 executionAdapter .execute (sql );
236236 if (!logging ) return ;
237237 long elapsed = (System .nanoTime () - start ) / 1000 ;
238238 io .teaql .core .ExecutionMetadata meta = new io .teaql .core .ExecutionMetadata ();
239- meta .setBackend ("SQL-" + name );
239+ meta .setBackend (debugDatabaseKind . toLowerCase ( java . util . Locale . ROOT ) );
240240 meta .setOperation (io .teaql .core .DataServiceOperation .SCHEMA );
241241 meta .setElapsedUs (elapsed );
242242 meta .setResultSummary ("Executed" );
0 commit comments