MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / initialize

Method initialize

lib/sqlalchemy/dialects/mysql/base.py:3162–3187  ·  view source on GitHub ↗
(self, connection: Connection)

Source from the content-addressed store, hash-verified

3160 return mariadb_callable(*arg, **kw)
3161
3162 def initialize(self, connection: Connection) -> None:
3163 # this is driver-based, does not need server version info
3164 # and is fairly critical for even basic SQL operations
3165 self._connection_charset: Optional[str] = self._detect_charset(
3166 connection
3167 )
3168
3169 # call super().initialize() because we need to have
3170 # server_version_info set up. in 1.4 under python 2 only this does the
3171 # "check unicode returns" thing, which is the one area that some
3172 # SQL gets compiled within initialize() currently
3173 default.DefaultDialect.initialize(self, connection)
3174
3175 self._detect_sql_mode(connection)
3176 self._detect_ansiquotes(connection) # depends on sql mode
3177 self._detect_casing(connection)
3178 if self._server_ansiquotes:
3179 # if ansiquotes == True, build a new IdentifierPreparer
3180 # with the new setting
3181 self.identifier_preparer = self.preparer(
3182 self, server_ansiquotes=self._server_ansiquotes
3183 )
3184
3185 self._dispatch_for_vendor(
3186 self._initialize_mysql, self._initialize_mariadb, connection
3187 )
3188
3189 def _initialize_mysql(self, connection: Connection) -> None:
3190 assert not self.is_mariadb

Callers

nothing calls this directly

Calls 5

_detect_charsetMethod · 0.95
_detect_sql_modeMethod · 0.95
_detect_ansiquotesMethod · 0.95
_detect_casingMethod · 0.95
_dispatch_for_vendorMethod · 0.95

Tested by

no test coverage detected