| 3073 | |
| 3074 | |
| 3075 | class MSDialect(default._BackendsMultiReflection, default.DefaultDialect): |
| 3076 | # will assume it's at least mssql2005 |
| 3077 | name = "mssql" |
| 3078 | supports_statement_cache = True |
| 3079 | supports_default_values = True |
| 3080 | supports_empty_insert = False |
| 3081 | favor_returning_over_lastrowid = True |
| 3082 | scope_identity_must_be_embedded = False |
| 3083 | |
| 3084 | returns_native_bytes = True |
| 3085 | |
| 3086 | supports_comments = True |
| 3087 | supports_default_metavalue = False |
| 3088 | """dialect supports INSERT... VALUES (DEFAULT) syntax - |
| 3089 | SQL Server **does** support this, but **not** for the IDENTITY column, |
| 3090 | so we can't turn this on. |
| 3091 | |
| 3092 | """ |
| 3093 | |
| 3094 | aggregate_order_by_style = AggregateOrderByStyle.WITHIN_GROUP |
| 3095 | |
| 3096 | # supports_native_uuid is partial here, so we implement our |
| 3097 | # own impl type |
| 3098 | |
| 3099 | execution_ctx_cls = MSExecutionContext |
| 3100 | use_scope_identity = True |
| 3101 | max_identifier_length = 128 |
| 3102 | schema_name = "dbo" |
| 3103 | |
| 3104 | insert_returning = True |
| 3105 | update_returning = True |
| 3106 | delete_returning = True |
| 3107 | update_returning_multifrom = True |
| 3108 | delete_returning_multifrom = True |
| 3109 | |
| 3110 | colspecs = { |
| 3111 | sqltypes.DateTime: _MSDateTime, |
| 3112 | sqltypes.Date: _MSDate, |
| 3113 | sqltypes.JSON: JSON, |
| 3114 | sqltypes.JSON.JSONIndexType: JSONIndexType, |
| 3115 | sqltypes.JSON.JSONPathType: JSONPathType, |
| 3116 | sqltypes.Time: _BASETIMEIMPL, |
| 3117 | sqltypes.Unicode: _MSUnicode, |
| 3118 | sqltypes.UnicodeText: _MSUnicodeText, |
| 3119 | DATETIMEOFFSET: DATETIMEOFFSET, |
| 3120 | DATETIME2: DATETIME2, |
| 3121 | SMALLDATETIME: SMALLDATETIME, |
| 3122 | DATETIME: DATETIME, |
| 3123 | sqltypes.Uuid: MSUUid, |
| 3124 | } |
| 3125 | |
| 3126 | engine_config_types = default.DefaultDialect.engine_config_types.union( |
| 3127 | {"legacy_schema_aliasing": util.asbool} |
| 3128 | ) |
| 3129 | |
| 3130 | ischema_names = ischema_names |
| 3131 | |
| 3132 | supports_sequences = True |