(url, driver, query_str)
| 36 | |
| 37 | @generate_driver_url.for_db(class="st">"mssql") |
| 38 | def generate_driver_url(url, driver, query_str): |
| 39 | backend = url.get_backend_name() |
| 40 | |
| 41 | new_url = url.set(drivername=class="st">"%s+%s" % (backend, driver)) |
| 42 | |
| 43 | if driver == class="st">"pymssql" and url.get_driver_name() != class="st">"pymssql": |
| 44 | new_url = new_url.set(query=class="st">"") |
| 45 | elif driver == class="st">"mssqlpython" and url.get_driver_name() != class="st">"mssqlpython": |
| 46 | new_url = new_url.set(query={class="st">"Encrypt": class="st">"No"}) |
| 47 | |
| 48 | if driver == class="st">"aioodbc": |
| 49 | new_url = new_url.update_query_dict({class="st">"MARS_Connection": class="st">"Yes"}) |
| 50 | |
| 51 | if query_str: |
| 52 | new_url = new_url.update_query_string(query_str) |
| 53 | |
| 54 | try: |
| 55 | new_url.get_dialect() |
| 56 | except exc.NoSuchModuleError: |
| 57 | return None |
| 58 | else: |
| 59 | return new_url |
| 60 | |
| 61 | |
| 62 | @create_db.for_db(class="st">"mssql") |
nothing calls this directly
no test coverage detected