MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / setup_config

Function setup_config

lib/sqlalchemy/testing/provision.py:81–109  ·  view source on GitHub ↗
(db_url, options, file_config, follower_ident)

Source from the content-addressed store, hash-verified

79
80
81def setup_config(db_url, options, file_config, follower_ident):
82 # load the dialect, which should also have it set up its provision
83 # hooks
84
85 dialect = sa_url.make_url(db_url).get_dialect()
86
87 dialect.load_provisioning()
88
89 if follower_ident:
90 db_url = follower_url_from_main(db_url, follower_ident)
91 db_opts = {}
92 update_db_opts(db_url, db_opts, options)
93 db_opts["scope"] = "global"
94 eng = engines.testing_engine(db_url, db_opts)
95
96 post_configure_engine(db_url, eng, follower_ident)
97
98 eng.connect().close()
99
100 cfg = config.Config.register(eng, db_opts, options, file_config)
101
102 # a symbolic name that tests can use if they need to disambiguate
103 # names across databases
104 if follower_ident:
105 config.ident = follower_ident
106
107 if follower_ident:
108 configure_follower(cfg, follower_ident)
109 return cfg
110
111
112def drop_follower_db(follower_ident):

Callers

nothing calls this directly

Calls 10

follower_url_from_mainFunction · 0.85
update_db_optsFunction · 0.85
testing_engineMethod · 0.80
post_configure_engineFunction · 0.70
configure_followerFunction · 0.70
get_dialectMethod · 0.45
load_provisioningMethod · 0.45
closeMethod · 0.45
connectMethod · 0.45
registerMethod · 0.45

Tested by

no test coverage detected