MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _mssql_create_db

Function _mssql_create_db

lib/sqlalchemy/dialects/mssql/provision.py:63–74  ·  view source on GitHub ↗
(cfg, eng, ident)

Source from the content-addressed store, hash-verified

61
62@create_db.for_db("mssql")
63def _mssql_create_db(cfg, eng, ident):
64 with eng.connect().execution_options(isolation_level="AUTOCOMMIT") as conn:
65 conn.exec_driver_sql("create database %s" % ident)
66 conn.exec_driver_sql(
67 "ALTER DATABASE %s SET ALLOW_SNAPSHOT_ISOLATION ON" % ident
68 )
69 conn.exec_driver_sql(
70 "ALTER DATABASE %s SET READ_COMMITTED_SNAPSHOT ON" % ident
71 )
72 conn.exec_driver_sql("use %s" % ident)
73 conn.exec_driver_sql("create schema test_schema")
74 conn.exec_driver_sql("create schema test_schema_2")
75
76
77@drop_db.for_db("mssql")

Callers

nothing calls this directly

Calls 3

execution_optionsMethod · 0.45
connectMethod · 0.45
exec_driver_sqlMethod · 0.45

Tested by

no test coverage detected