From 3d0fe5bfe2e15e553279a8420ed048e6b84cc72a Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Thu, 23 Oct 2008 02:09:27 +0000 Subject: [PATCH] Demonstrate mssql url examples for the database engine documentation. Closes #1198. --- doc/build/content/dbengine.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/doc/build/content/dbengine.txt b/doc/build/content/dbengine.txt index 0128b54424..492e6df4bc 100644 --- a/doc/build/content/dbengine.txt +++ b/doc/build/content/dbengine.txt @@ -93,6 +93,12 @@ Available drivernames are `sqlite`, `mysql`, `postgres`, `oracle`, `mssql`, and # oracle will feed host/port/SID into cx_oracle.makedsn oracle_db = create_engine('oracle://scott:tiger@127.0.0.1:1521/sidname') + # mssql + mssql_db = create_engine('mssql://username:password@localhost/database') + + # mssql via a DSN connection + mssql_db = create_engine('mssql://username:password@/?dsn=mydsn') + The `Engine` will ask the connection pool for a connection when the `connect()` or `execute()` methods are called. The default connection pool, `QueuePool`, as well as the default connection pool used with SQLite, `SingletonThreadPool`, will open connections to the database on an as-needed basis. As concurrent statements are executed, `QueuePool` will grow its pool of connections to a default size of five, and will allow a default "overflow" of ten. Since the `Engine` is essentially "home base" for the connection pool, it follows that you should keep a single `Engine` per database established within an application, rather than creating a new one for each connection. #### Custom DBAPI connect() arguments -- 2.47.3