]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Demonstrate mssql url examples for the database engine documentation. Closes #1198.
authorMichael Trier <mtrier@gmail.com>
Thu, 23 Oct 2008 02:09:27 +0000 (02:09 +0000)
committerMichael Trier <mtrier@gmail.com>
Thu, 23 Oct 2008 02:09:27 +0000 (02:09 +0000)
doc/build/content/dbengine.txt

index 0128b54424a49e75065829c50d6a79b1c401f641..492e6df4bce448c8f3deac82c6a8c53d1735a4b9 100644 (file)
@@ -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