Skip to content

Commit 42aef4f

Browse files
committed
Add Sql Server option to docs
1 parent e8425e7 commit 42aef4f

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Currently available features:
1515
* MariaDb container
1616
* OracleDb container
1717
* PostgreSQL Db container
18+
* Microsoft SQL Server container
1819
* Generic docker containers
1920

2021
### Quick start

docs/database.rst

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Necessary to use it:
6363

6464
- ``cx_Oracle``
6565
- `Oracle client libraries <https://cx-oracle.readthedocs.io/en/latest/user_guide/installation.html>`_
66-
=======
66+
6767
::
6868

6969
hostname: localhost
@@ -112,4 +112,17 @@ Example of MongoDb database usage:
112112
print(document)
113113

114114
Connection is made using pymongo package and MongoClient class.
115-
Alternatively, you can use get_connection_url method to use the driver that better fits for your use case.
115+
Alternatively, you can use get_connection_url method to use the driver that better fits for your use case.
116+
117+
Microsoft SQL Server
118+
--------------------
119+
120+
::
121+
122+
mssql = SqlServerContainer()
123+
124+
with mssql:
125+
e = sqlalchemy.create_engine(mssql.get_connection_url())
126+
result = e.execute("select @@VERSION")
127+
128+
It uses the Microsoft-provided Docker image and requires the pymssql driver.

docs/index.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Currently available features:
1717
- Google Cloud PubSub emulator container
1818
- Elasticsearch container
1919
- MongoDb container
20+
- MS SQL Server container
2021
- Generic Docker containers
2122

2223
Installation
@@ -35,6 +36,7 @@ and can be installed using pip, depending on which containers you need:
3536
pip install testcontainers[selenium]
3637
pip install testcontainers[google-cloud-pubsub]
3738
pip install testcontainers[mongodb]
39+
pip install testcontainers[mssqlserver]
3840
# or with multiple
3941
pip install testcontainers[mysql,postgresql,selenium,google-cloud-pubsub]
4042

requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-e file:.[docker-compose,mysql,oracle,postgresql,selenium,google-cloud-pubsub,mongo,redis]
1+
-e file:.[docker-compose,mysql,oracle,postgresql,selenium,google-cloud-pubsub,mongo,redis,mssqlserver]
22
codecov
33
flake8
44
pytest

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
'selenium': ['selenium'],
5656
'google-cloud-pubsub': ['google-cloud-pubsub'],
5757
'mongo': ['pymongo'],
58-
'redis': ['redis']
58+
'redis': ['redis'],
59+
'mssqlserver': ['pymssql']
5960
},
6061
long_description_content_type="text/markdown",
6162
long_description=long_description,

0 commit comments

Comments
 (0)