@@ -287,10 +287,12 @@ public class SqlServerClient
287
287
288
288
return FULL_PUSHDOWN .apply (session , domain );
289
289
};
290
+ private final boolean synonymsEnabled ;
290
291
291
292
@ Inject
292
293
public SqlServerClient (
293
294
BaseJdbcConfig config ,
295
+ SqlServerConfig sqlServerConfig ,
294
296
JdbcStatisticsConfig statisticsConfig ,
295
297
ConnectionFactory connectionFactory ,
296
298
QueryBuilder queryBuilder ,
@@ -300,6 +302,7 @@ public SqlServerClient(
300
302
super ("\" " , connectionFactory , queryBuilder , config .getJdbcTypesMappedToVarchar (), identifierMapping , queryModifier , true );
301
303
302
304
this .statisticsEnabled = statisticsConfig .isEnabled ();
305
+ this .synonymsEnabled = sqlServerConfig .isSynonymsEnabled ();
303
306
304
307
this .connectorExpressionRewriter = JdbcConnectorExpressionRewriterBuilder .newBuilder ()
305
308
.addStandardRules (this ::quoted )
@@ -345,6 +348,15 @@ public SqlServerClient(
345
348
.build ());
346
349
}
347
350
351
+ @ Override
352
+ protected Optional <List <String >> getTableTypes ()
353
+ {
354
+ if (synonymsEnabled ) {
355
+ return Optional .of (ImmutableList .of ("TABLE" , "VIEW" , "SYNONYM" ));
356
+ }
357
+ return Optional .of (ImmutableList .of ("TABLE" , "VIEW" ));
358
+ }
359
+
348
360
@ Override
349
361
protected void dropSchema (ConnectorSession session , Connection connection , String remoteSchemaName , boolean cascade )
350
362
throws SQLException
0 commit comments