Skip to content

Alpha changes #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Ignore all files in the pybind/build directory
mssql_python/pybind/build/

mssql_python/pybind/pymsbuild/build/

# Ignore pyd file
mssql_python/ddbc_bindings.pyd

# Ignore pycache files and folders
__pycache__/
**/__pycache__/
*.pyc

# Ignore pytest cache
.pytest_cache/
**/.pytest_cache/

# Ignore log files
*.log

# Ignore Visual Studio files
mssql_python/.vs
.vs

# Ignore test-*.xml files
test-*.xml
**/test-**.xml

# Ignore the build & mssql_python.egg-info directories
build/
mssql_python.egg-info/
8 changes: 4 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MIT License
All files licensed under the MIT license except the dynamic-link libraries (DLLs) in the libs\win folder,
All files licensed under the MIT license except the dynamic-link libraries (DLLs) in the mssql_python\libs\win folder,
which are subject to different licensing terms. Please review the licensing details for each component below.

A. MIT License
Expand Down Expand Up @@ -27,7 +27,7 @@ SOFTWARE

B. MICROSOFT LICENSES
==================================================================
The following dynamic-link libraries (DLLs) in the libs\win folder fall under different Microsoft licenses.
The following dynamic-link libraries (DLLs) in the mssql_python\libs\win folder fall under different Microsoft licenses.
Below is a breakdown of these components by their respective licenses.

1. Microsoft ODBC Driver 18 End User License Agreement (EULA)
Expand All @@ -37,11 +37,11 @@ These components are part of the Microsoft ODBC Driver 18 for SQL Server and are
- msodbcdiag18.dll: Diagnostic library for handling error reporting and troubleshooting.
- msodbcsql18.dll: Core ODBC driver enabling connectivity between SQL Server and applications.

For official licensing terms, refer to: libs\win\MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt
For official licensing terms, refer to: mssql_python\libs\win\MICROSOFT_ODBC_DRIVER_FOR_SQL_SERVER_LICENSE.txt

2. Microsoft Visual C++ Redistributable EULA
These components are part of the Microsoft Visual C++ Redistributable and are governed by the Microsoft Visual C++ Redistributable EULA.

- msvcp140.dll: Microsoft C++ Standard Library runtime, required for running C++ applications.

For redistribution and usage terms, refer to: libs\win\libs\win\MICROSOFT_VISUAL_STUDIO_LICENSE.txt
For redistribution and usage terms, refer to: mssql_python\libs\win\libs\win\MICROSOFT_VISUAL_STUDIO_LICENSE.txt
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,12 @@ Connect to SQL Server and execute a simple query:
import mssql_python

# Establish a connection
connection = mssql_python.connect(
server='your_server',
database='your_database',
username='your_username',
password='your_password'
)
# Specify connection string
connection = ("SERVER=<your_server_name>;DATABASE=<your_database_name>;UID=<your_user_name>;PWD=<your_password>;Encrypt=yes;")

# Execute a query
cursor = connection.cursor()
cursor.execute("SELECT * FROM your_table")
cursor.execute("SELECT @@version")
rows = cursor.fetchall()

for row in rows:
Expand Down Expand Up @@ -85,7 +81,7 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.
contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

## License
The mssql-python driver for SQL Server is licensed under the MIT license, except the dynamic-link libraries (DLLs) in the [libs](libs) folder
The mssql-python driver for SQL Server is licensed under the MIT license, except the dynamic-link libraries (DLLs) in the [libs](https://github.com/microsoft/mssql-python/tree/alphaChanges/mssql_python/libs) folder
that are licensed under MICROSOFT SOFTWARE LICENSE TERMS.

Please review the [LICENSE](LICENSE) file for more details.
Expand Down
55 changes: 55 additions & 0 deletions mssql_python/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
"""
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
This module initializes the mssql_python package.
"""

# Exceptions
# https://www.python.org/dev/peps/pep-0249/#exceptions
from .exceptions import (
Warning,
Error,
InterfaceError,
DatabaseError,
DataError,
OperationalError,
IntegrityError,
InternalError,
ProgrammingError,
NotSupportedError,
)

# Type Objects
from .type import (
Date,
Time,
Timestamp,
DateFromTicks,
TimeFromTicks,
TimestampFromTicks,
Binary,
STRING,
BINARY,
NUMBER,
DATETIME,
ROWID,
)

# Connection Objects
from .connection import Connection
from .db_connection import connect

# Cursor Objects
from .cursor import Cursor

# Logging Configuration
from .logging_config import setup_logging, get_logger

# Constants
from .constants import ConstantsDDBC

# GLOBALS
# Read-Only
apilevel = "2.0"
paramstyle = "qmark"
threadsafety = 1
Loading