Skip to main content
Version: 1.0.0

SQL Server

The SQL Server adapter allows intugle to connect to Microsoft SQL Server and Azure SQL databases. It uses the modern mssql-python driver, which connects directly to SQL Server without needing an external driver manager like ODBC.

OS Dependencies

The mssql-python driver may require additional system-level libraries depending on your operating system (e.g., libltdl on Linux). Before proceeding, please ensure you have installed any necessary prerequisites for your OS.

For detailed, OS-specific installation instructions, please refer to the official Microsoft mssql-python documentation.

Installation

To use this adapter, you must install the necessary dependencies as an extra:

pip install "intugle[sqlserver]"

Profile Configuration

To configure the connection, add a sqlserver entry to your profiles.yml file.

profiles.yml

sqlserver:
name: my_sqlserver_source # A unique name for this source
type: sqlserver
host: "your_server_address"
port: 1433
user: "your_username"
password: "your_password"
database: "your_database_name"
schema: "dbo" # Optional, defaults to 'dbo'
encrypt: true # Optional, defaults to true
KeyDescriptionRequiredDefault
nameA unique identifier for this data source connection.Yes
typeThe type of the adapter. Must be sqlserver.Yes
hostThe hostname or IP address of your SQL Server instance.Yes
portThe port number for the connection.No1433
userThe username for authentication.Yes
passwordThe password for authentication.Yes
databaseThe name of the database to connect to.Yes
schemaThe default schema to use for tables that are not fully qualified.Nodbo
encryptWhether to encrypt the connection. Recommended to keep this true.Notrue

Dataset Configuration

When defining datasets for the SemanticModel, use the type: "sqlserver" and provide the table name as the identifier.

from intugle import SemanticModel

datasets = {
"customers": {
"type": "sqlserver",
"identifier": "Customers" # The name of the table in SQL Server
},
"orders": {
"type": "sqlserver",
"identifier": "Orders"
},
# ... other datasets
}

# Build the semantic model
sm = SemanticModel(datasets, domain="E-commerce")
sm.build()