Skip to content
Draft

V4 #603

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
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/devcontainers/ruby:2.7
FROM mcr.microsoft.com/devcontainers/ruby:3.2

# Install the SQL Server command-line tools and the Artistic Style code formatter
RUN curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc \
Expand All @@ -8,7 +8,7 @@ RUN curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/t
ENV PATH=$PATH:/opt/mssql-tools18/bin

# Install FreeTDS
ENV FREETDS_VERSION=1.5.1
ENV FREETDS_VERSION=1.5.4
COPY test/bin/install-freetds.sh /tmp/
RUN /tmp/install-freetds.sh

Expand Down
143 changes: 4 additions & 139 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
fail-fast: false
matrix:
platform:
- "x64-mingw32"
- "x64-mingw-ucrt"
- "x86_64-linux-gnu"
- "x86_64-linux-musl"
Expand All @@ -26,7 +25,7 @@ jobs:
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
ruby-version: "3.2"

- name: "Install dependencies"
run: bundle install
Expand All @@ -53,127 +52,13 @@ jobs:
name: gem-${{ matrix.platform }}
path: pkg/*.gem

install-windows-mingw:
needs:
- cross-compile
strategy:
fail-fast: false
matrix:
ruby-version:
- "3.0"

name: install-windows-mingw
runs-on: windows-latest
steps:
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Download precompiled gem
uses: actions/download-artifact@v4
with:
name: gem-x64-mingw32

- name: Install native gem
shell: pwsh
run: gem install "tiny_tds-*.gem"

- name: Test if TinyTDS loads
shell: pwsh
run: |
ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
exit $LASTEXITCODE

- name: Test if tsql wrapper works
shell: pwsh
run: |
tsql-ttds -C
exit $LASTEXITCODE

- name: Test if defncopy wrapper works
shell: pwsh
run: |
defncopy-ttds -v
exit $LASTEXITCODE

test-windows-mingw:
needs:
- cross-compile
strategy:
fail-fast: false
matrix:
force-encryption:
- false
- true
mssql-version:
- 2017
- 2019
- 2022
ruby-version:
- "3.0"

name: test-windows-mingw
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true

- name: Download precompiled gem
uses: actions/download-artifact@v4
with:
name: gem-x64-mingw32

- name: Install native gem and restore cross-compiled code from it
shell: pwsh
run: "& ./test/bin/restore-from-native-gem.ps1"
env:
RUBY_ARCHITECTURE: "x64-mingw32"

- name: Setup MSSQL
uses: rails-sqlserver/setup-mssql@v1
with:
components: sqlcmd,sqlengine
version: ${{ matrix.mssql-version }}
sa-password: c0MplicatedP@ssword
force-encryption: ${{ matrix.force-encryption }}

- name: Setup MSSQL database
shell: pwsh
run: |
& sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-create.sql
& sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-login.sql

- name: Install toxiproxy-server
shell: pwsh
run: |
choco install toxiproxy-server --version=2.5.0 -y
Start-Process toxiproxy-server

- name: Test gem
shell: pwsh
run: bundle exec rake test
env:
TOXIPROXY_HOST: "localhost"

- name: Test Summary
uses: test-summary/action@v2
with:
paths: "test/reports/TEST-*.xml"
if: always()

install-windows-ucrt:
needs:
- cross-compile
strategy:
fail-fast: false
matrix:
ruby-version:
- "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand Down Expand Up @@ -224,11 +109,9 @@ jobs:
- false
- true
mssql-version:
- 2017
- 2019
- 2022
ruby-version:
- "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand Down Expand Up @@ -256,7 +139,7 @@ jobs:
RUBY_ARCHITECTURE: "x64-mingw-ucrt"

- name: Setup MSSQL
uses: rails-sqlserver/setup-mssql@v1
uses: rails-sqlserver/setup-mssql@v2
with:
components: sqlcmd,sqlengine
version: ${{ matrix.mssql-version }}
Expand Down Expand Up @@ -292,12 +175,6 @@ jobs:
fail-fast: false
matrix:
ruby-version:
# currently fails with a dependency resolution
# looking for conflicting packages...
# :: installing mingw-w64-x86_64-gcc-libs (15.1.0-8) breaks dependency 'mingw-w64-x86_64-gcc-libs=14.2.0-3' required by mingw-w64-x86_64-gcc
# - "2.7"
# - "3.0"
# - "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand Down Expand Up @@ -354,8 +231,6 @@ jobs:
- "aarch64-linux-musl"

ruby-version:
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand All @@ -364,15 +239,13 @@ jobs:
include:
- platform: x86_64-linux-musl
docker_tag: "-alpine"
bootstrap: "apk add -U build-base &&" # required to compile bigdecimal on Ruby 2.7

- platform: aarch64-linux-gnu
docker_platform: "--platform=linux/arm64"

- platform: aarch64-linux-musl
docker_platform: "--platform=linux/arm64"
docker_tag: "-alpine"
bootstrap: "apk add -U build-base &&"

name: install-linux
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -415,8 +288,6 @@ jobs:
- 2022

ruby-version:
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand All @@ -443,7 +314,7 @@ jobs:
RUBY_ARCHITECTURE: "x86_64-linux-gnu"

- name: Setup MSSQL
uses: rails-sqlserver/setup-mssql@v1
uses: rails-sqlserver/setup-mssql@v2
with:
components: sqlcmd,sqlengine
version: ${{ matrix.mssql-version }}
Expand Down Expand Up @@ -477,9 +348,6 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand Down Expand Up @@ -524,9 +392,6 @@ jobs:
fail-fast: false
matrix:
ruby-version:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
- "3.3"
- "3.4"
Expand Down Expand Up @@ -569,7 +434,7 @@ jobs:

- uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
ruby-version: "3.2"
bundler-cache: true

- name: Check standardrb
Expand Down
31 changes: 0 additions & 31 deletions .rubocop.yml

This file was deleted.

12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
## (unreleased)

* Drop support for Ruby < 3.2
* Drop support for SQL Server < 2019
* Removed lazy-loading of results for `execute`
* Moved `#do`, `#insert` and `#execute` methods to the `TinyTds::Client` class
* `TinyTds::Result` is now a pure Ruby class
* `#execute`: Replaced `opts` hash with keyword arguments
* Removed `symbolize_keys` and `cache_rows` from `#default_query_options`
* `TinyTds::Client.new` now accepts keyword arguments instead of a hash
* Renamed `tds_version` and `tds_version_info` to `server_version` and `server_version_info`
* Separate `#new` and `#connect`
* Instead, before running `#do`, `#execute` or `#insert`, `tiny_tds` will check if the connection is active and re-connect if needed.

## 3.4.0

* Add Ruby 4.0 to the cross compile list
Expand Down
Loading