Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
232fe82
Fixed pipelines
JLesDev Oct 1, 2025
55b1798
Xtask work
JLesDev Oct 15, 2025
a733304
macos test --lib + clippy
JLesDev Oct 17, 2025
0905769
Cargo clippy
JLesDev Oct 21, 2025
35d431c
Clean up
JLesDev Oct 21, 2025
d79bf69
Clean up
JLesDev Oct 21, 2025
71900c7
Fixes based on comments
JLesDev Oct 23, 2025
9cf0f78
Testing
JLesDev Oct 27, 2025
a5d1d0f
Added working directory
JLesDev Oct 27, 2025
d833a01
Added working directory
JLesDev Oct 27, 2025
82ddf82
Added working directory
JLesDev Oct 27, 2025
9ee8f39
Added working directory
JLesDev Oct 27, 2025
8944a3d
Fixes
JLesDev Oct 27, 2025
1be487e
Making it better
JLesDev Oct 28, 2025
07fffb2
Making it better
JLesDev Oct 28, 2025
34c1d39
Certificate fixes
JLesDev Nov 10, 2025
39d0ede
Certificate fixes - testing
JLesDev Nov 10, 2025
692c114
Certificate fixes - testing
JLesDev Nov 10, 2025
1de4b02
Certificate fixes - testing
JLesDev Nov 10, 2025
16ff2b8
Certificate fixes - testing
JLesDev Nov 10, 2025
9cb967f
Certificate fixes - testing
JLesDev Nov 10, 2025
6659073
Certificate fixes - testing
JLesDev Nov 10, 2025
bcf7876
Certificate fixes - testing
JLesDev Nov 10, 2025
a6c8ae6
Certificate fixes - testing
JLesDev Nov 10, 2025
7ab0425
Certificate fixes - testing
JLesDev Nov 10, 2025
ad3b79d
update certs generation
esheppa Nov 18, 2025
09440ea
Remove connection string for linux
JLesDev Jan 13, 2026
8cd5391
Remove connection string for linux
JLesDev Jan 13, 2026
e56c4d7
Remove connection string for linux
JLesDev Jan 13, 2026
ec21ab9
Clean up + instructions
JLesDev Jan 31, 2026
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
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[alias]
xtask = "run --package xtask --"
313 changes: 140 additions & 173 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,217 +1,184 @@
name: Cargo tests
name: Cargo Tests

on:
push:
branches:
- main
branches: [ main ]
pull_request:


jobs:
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
components: clippy
override: true
- name: Install dependencies
run: sudo apt install -y openssl libkrb5-dev
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features=all

format:
runs-on: ubuntu-latest
- uses: actions/checkout@v5 # checkout versions have been updated. previous v1/2
- uses: dtolnay/rust-toolchain@stable # changed to stable
with:
components: rustfmt, clippy

steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
components: rustfmt
override: true
- uses: mbrobbel/rustfmt-check@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libkrb5-dev krb5-user && sudo ln -s /usr/include/krb5/gssapi /usr/include/gssapi
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need openssl here?


- run: cargo clippy --features=all

- run: cargo fmt --check

cargo-test-linux:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
database:
- 2017
- 2019
- 2022
- azure-sql-edge
features:
- "--features=all"
- "--no-default-features"
- "--no-default-features --features=chrono"
- "--no-default-features --features=time"
- "--no-default-features --features=rustls"
- "--no-default-features --features=vendored-openssl"

engine: [ 2017, 2019, 2022, "azure" ]
env:
TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:localhost,1433;user=SA;password=<YourStrong@Passw0rd>;TrustServerCertificate=true"
RUSTFLAGS: "-Dwarnings"
TIBERIUS_TEST_INSTANCE: "MSSQLSERVER"
# TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:127.0.0.1,1433;IntegratedSecurity=true;TrustServerCertificate=true"
# TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:localhost,1433;IntegratedSecurity=true;TrustServerCertificate=true"
# TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:localhost,1433;user=sa;password=<YourStrong@Passw0rd>;TrustServerCertificate=true"

steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v5

- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libkrb5-dev krb5-user && sudo ln -s /usr/include/krb5/gssapi /usr/include/gssapi

- name: Install Rust
uses: dtolnay/rust-toolchain@stable

- uses: actions-rs/toolchain@v1
# we use the same cache key irrespective of the
# SQL server version
- name: Setup Cargo build cache
uses: actions/cache@v4
with:
path: target
key: ubuntu-cargo

- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ matrix.features }}
- run: cargo xtask container ${{ matrix.engine }}

- name: Start SQL Server ${{matrix.database}}
run: DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml up -d mssql-${{matrix.database}}
# Wait for SQL Server
- run: sleep 25

- name: Install dependencies
run: sudo apt install -y openssl libkrb5-dev
- run: cargo xtask test --features=all
- run: cargo xtask test --no-default-features
- run: cargo xtask test --no-default-features --features=chrono
- run: cargo xtask test --no-default-features --features=rustls
- run: cargo xtask test --no-default-features --features=time
- run: cargo xtask test --no-default-features --features=vendored-openssl

- name: Run tests
run: cargo test ${{matrix.features}}
- run: cargo xtask stop ${{ matrix.engine }}

cargo-test-windows:
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
database:
- 2019
features:
- "--features=all"
- "--no-default-features --features=rustls,winauth"
- "--no-default-features --features=vendored-openssl,winauth"

- 2019
env:
TIBERIUS_TEST_INSTANCE: "MSSQLSERVER"
TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:127.0.0.1,1433;IntegratedSecurity=true;TrustServerCertificate=true"
# TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:127.0.0.1,1433;IntegratedSecurity=true;TrustServerCertificate=true"
TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:localhost,1433;IntegratedSecurity=true;TrustServerCertificate=true"

steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1

- name: Set required PowerShell modules
id: psmodulecache
uses: potatoqualitee/psmodulecache@v1
with:
modules-to-cache: SqlServer

- name: Setup PowerShell module cache
id: cacher
uses: actions/cache@v2
with:
path: ${{ steps.psmodulecache.outputs.modulepath }}
key: ${{ steps.psmodulecache.outputs.keygen }}

- name: Setup Chocolatey download cache
id: chococache
uses: actions/cache@v2
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey\
key: chocolatey-install

- name: Setup Cargo build cache
uses: actions/cache@v2
with:
path: |
C:\Users\runneradmin\.cargo\registry
C:\Users\runneradmin\.cargo\git
target
key: ${{ runner.os }}-cargo

- name: Install required PowerShell modules
if: steps.cacher.outputs.cache-hit != 'true'
shell: powershell
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module SqlServer

- name: Install SQL Server ${{matrix.database}}
shell: powershell
run: |
choco feature disable --name="'exitOnRebootDetected'"
$ErrorActionPreference = 'SilentlyContinue'
choco install sql-server-${{matrix.database}} --params="'/IgnorePendingReboot'"

- name: Setup SQL Server ${{matrix.database}}
shell: powershell
run: |
Import-Module 'sqlps'

[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null

$serverName = $env:COMPUTERNAME
$instanceName = "MSSQLSERVER"

$smo = 'Microsoft.SqlServer.Management.Smo.'
$wmi = new-object ($smo + 'Wmi.ManagedComputer')
$wmi

# Enable TCP/IP
echo "Enabling TCP/IP"
$Tcp = $wmi.GetSmoObject("ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']")
$Tcp.IsEnabled = $true
$Tcp.alter()
$Tcp

# Enable named pipes
echo "Enabling named pipes"
$Np = $wmi.GetSmoObject("ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Np']")
$Np.IsEnabled = $true
$Np.Alter()
$Np

# Set Alias
echo "Setting the alias"
New-Item HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client -Name ConnectTo | Out-Null
Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo -Name '(local)' -Value "DBMSSOCN,$serverName\$instanceName" | Out-Null

# Start services
echo "Starting services"
Set-Service SQLBrowser -StartupType Manual
Start-Service SQLBrowser
net stop MSSQLSERVER
net start MSSQLSERVER

- name: Run normal tests
shell: powershell
run: cargo test ${{matrix.features}}
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Set required PowerShell modules
id: psmodulecache
uses: potatoqualitee/psmodulecache@v1
with:
modules-to-cache: SqlServer

- name: Setup PowerShell module cache
id: cacher
uses: actions/cache@v4 # cache updated to v4
with:
path: ${{ steps.psmodulecache.outputs.modulepath }}
key: ${{ steps.psmodulecache.outputs.keygen }}

- name: Cache Cargo build cache
uses: actions/cache@v4 # cache command, updated to v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: windows-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Install required PowerShell modules
if: steps.cacher.outputs.cache-hit != 'true'
shell: powershell
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module SqlServer

- name: Install SQL Server ${{matrix.database}}
shell: powershell
run: |
choco feature disable --name="'exitOnRebootDetected'"
$ErrorActionPreference = 'SilentlyContinue'
choco install sql-server-${{matrix.database}} --params="'/IgnorePendingReboot'"

- name: Setup SQL Server ${{matrix.database}}
shell: powershell
run: |
Import-Module 'sqlps'
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null
$serverName = $env:COMPUTERNAME
$instanceName = "MSSQLSERVER"
$smo = 'Microsoft.SqlServer.Management.Smo.'
$wmi = new-object ($smo + 'Wmi.ManagedComputer')
$wmi
# Enable TCP/IP
echo "Enabling TCP/IP"
$Tcp = $wmi.GetSmoObject("ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Tcp']")
$Tcp.IsEnabled = $true
$Tcp.alter()
$Tcp
# Enable named pipes
echo "Enabling named pipes"
$Np = $wmi.GetSmoObject("ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instanceName']/ServerProtocol[@Name='Np']")
$Np.IsEnabled = $true
$Np.Alter()
$Np
# Set Alias
echo "Setting the alias"
New-Item HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client -Name ConnectTo | Out-Null
Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\MSSQLServer\Client\ConnectTo -Name '(local)' -Value "DBMSSOCN,$serverName\$instanceName" | Out-Null
# Start services
echo "Starting services"
Set-Service SQLBrowser -StartupType Manual
Start-Service SQLBrowser
net stop MSSQLSERVER
net start MSSQLSERVER

- shell: powershell
run: cargo test --features=all
- shell: powershell
run: cargo test --no-default-features --features=rustls,winauth
- shell: powershell
run: cargo test --no-default-features --features=vendored-openssl,winauth

cargo-test-macos:
runs-on: macos-12
runs-on: macos-26

strategy:
fail-fast: false
matrix:
database:
- 2019
features:
- "--no-default-features --features=rustls,chrono,time,tds73,sql-browser-async-std,sql-browser-tokio,sql-browser-smol,integrated-auth-gssapi,rust_decimal,bigdecimal"
- "--no-default-features --features=vendored-openssl"

env:
TIBERIUS_TEST_CONNECTION_STRING: "server=tcp:localhost,1433;user=SA;password=<YourStrong@Passw0rd>;TrustServerCertificate=true"
- 2019

steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1

- uses: docker-practice/actions-setup-docker@master

- name: Start SQL Server ${{matrix.database}}
run: DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml up -d mssql-${{matrix.database}}
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Run tests
run: cargo test ${{matrix.features}}
# For now we're not running the integration tests in macos,
# only running the unit tests
- run: cargo test --no-default-features --features=vendored-openssl --lib
- run: cargo test --no-default-features --features=rustls,chrono,time,tds73,sql-browser-tokio,sql-browser-smol,integrated-auth-gssapi,rust_decimal,bigdecimal --lib
- run: cargo clippy ${{ matrix.features }}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run this with all the feature sets used with cargo test

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ Cargo.lock
.idea
.direnv/
.vscode
mssql.crt
mssql.key
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repository = "https://github.com/prisma/tiberius"
version = "0.12.3"

[workspace]
members = ["runtimes-macro"]
members = ["runtimes-macro", "xtask"]

[[test]]
path = "tests/query.rs"
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
## Security

If you have a security issue to report, please contact us at [security@prisma.io](mailto:security@prisma.io?subject=[GitHub]%20Prisma%202%20Security%20Report%20Tiberius)

## Notes

We have native TLS, open TLS, and rust TLS. In the event that multiple are chosen the one with the lowest number will always "win".

1. Rust TLS
2. Native TLS
3. Open TLS
Loading
Loading