tiny_tds 2.1.2 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +5 -5
  2. data/.devcontainer/Dockerfile +21 -0
  3. data/.devcontainer/boot.sh +6 -0
  4. data/.devcontainer/compose.yaml +40 -0
  5. data/.devcontainer/devcontainer.json +30 -0
  6. data/.github/workflows/ci.yml +586 -0
  7. data/.gitignore +2 -0
  8. data/CHANGELOG.md +71 -1
  9. data/Gemfile +1 -8
  10. data/ISSUE_TEMPLATE.md +1 -1
  11. data/README.md +81 -97
  12. data/Rakefile +48 -29
  13. data/VERSION +1 -1
  14. data/astyle.conf +8 -0
  15. data/ext/tiny_tds/client.c +252 -112
  16. data/ext/tiny_tds/client.h +5 -3
  17. data/ext/tiny_tds/extconf.rb +173 -52
  18. data/ext/tiny_tds/extconsts.rb +4 -11
  19. data/ext/tiny_tds/result.c +223 -87
  20. data/ext/tiny_tds/result.h +2 -2
  21. data/ext/tiny_tds/tiny_tds_ext.c +6 -2
  22. data/lib/tiny_tds/bin.rb +14 -28
  23. data/lib/tiny_tds/client.rb +38 -42
  24. data/lib/tiny_tds/error.rb +0 -2
  25. data/lib/tiny_tds/gem.rb +7 -16
  26. data/lib/tiny_tds/result.rb +0 -2
  27. data/lib/tiny_tds/version.rb +1 -1
  28. data/lib/tiny_tds.rb +27 -47
  29. data/tasks/native_gem.rake +12 -10
  30. data/tasks/package.rake +1 -3
  31. data/tasks/ports.rake +14 -77
  32. data/tasks/test.rake +3 -5
  33. data/test/bin/install-freetds.sh +2 -4
  34. data/test/bin/restore-from-native-gem.ps1 +16 -0
  35. data/test/client_test.rb +152 -116
  36. data/test/gem_test.rb +40 -124
  37. data/test/result_test.rb +285 -350
  38. data/test/schema_test.rb +369 -395
  39. data/test/sql/db-create.sql +18 -0
  40. data/test/sql/db-login.sql +38 -0
  41. data/test/test_helper.rb +112 -85
  42. data/test/thread_test.rb +21 -38
  43. data/tiny_tds.gemspec +31 -26
  44. metadata +114 -63
  45. data/.travis.yml +0 -24
  46. data/BACKERS.md +0 -32
  47. data/appveyor.yml +0 -51
  48. data/tasks/ports/freetds.rb +0 -37
  49. data/tasks/ports/libiconv.rb +0 -43
  50. data/tasks/ports/openssl.rb +0 -78
  51. data/tasks/ports/recipe.rb +0 -52
  52. data/test/appveyor/dbsetup.ps1 +0 -27
  53. data/test/appveyor/dbsetup.sql +0 -9
  54. data/test/benchmark/query.rb +0 -77
  55. data/test/benchmark/query_odbc.rb +0 -106
  56. data/test/benchmark/query_tinytds.rb +0 -126
  57. data/test/bin/install-openssl.sh +0 -18
  58. data/test/bin/setup.sh +0 -19
  59. data/test/schema/sqlserver_2000.sql +0 -140
  60. data/test/schema/sqlserver_2005.sql +0 -140
  61. data/test/schema/sqlserver_2014.sql +0 -140
  62. data/test/schema/sqlserver_2016.sql +0 -140
  63. data/test/schema/sybase_ase.sql +0 -138
  64. /data/test/schema/{sqlserver_2008.sql → sqlserver_2017.sql} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2122d9b48df66ded292ff0e42ba758237376d686
4
- data.tar.gz: 2cd078c914b8287bb99db513810e1498707b40ad
2
+ SHA256:
3
+ metadata.gz: 5c8208aafb2c7bdde1d7e21f319c23aa5bff9a7a2677b0c6fe9bd2775af5d21c
4
+ data.tar.gz: 7bb08e91fcbf0283094140ec280dbc659edcdf7d6b968eda3428ad6e879dbde8
5
5
  SHA512:
6
- metadata.gz: 5a70deed6ccd0fd09086c2a16cadb9fa8dc136f3cd6f951a3fbe7a0fc31f5282cc70c08bfe770f6f29970e39cdaa84519dceddc0c624449e9fe45e046d4075c9
7
- data.tar.gz: ef92d35e3e3f7a98818fcf42fc029a4480dfd449dc9da54aa48d180a26435f33d2528fabac0d9cd81d0aaec715ca5180ef470066b75a8e02f11dd0468a5e9f0c
6
+ metadata.gz: aed9efda72201410a5b5b5e4320e655cd930dfd6e8ce3e00c4bd71979c206d3e40732e943fd8f61b8f84498ee3e0e68d85351125eacbfd5d8049489a573e9ff1
7
+ data.tar.gz: 6dbfb299b33525c605410c4d2ab01a7d192c509e3f0477d5b49d479a37d8b68daf4866b2ed2d72d6a09ea6c459d3271e028977ea40701b9d26d958b486e1829d
@@ -0,0 +1,21 @@
1
+ FROM mcr.microsoft.com/devcontainers/ruby:2.7
2
+
3
+ # Install the SQL Server command-line tools and the Artistic Style code formatter
4
+ RUN curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc \
5
+ && curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list \
6
+ && apt-get update \
7
+ && ACCEPT_EULA=Y apt-get install -y astyle mssql-tools18 unixodbc-dev
8
+ ENV PATH=$PATH:/opt/mssql-tools18/bin
9
+
10
+ # Install FreeTDS
11
+ ENV FREETDS_VERSION=1.5.1
12
+ COPY test/bin/install-freetds.sh /tmp/
13
+ RUN /tmp/install-freetds.sh
14
+
15
+ # Add the tiny_tds main Gemfile and install the gems.
16
+ RUN mkdir -p /tmp/tiny_tds
17
+ COPY Gemfile VERSION tiny_tds.gemspec /tmp/tiny_tds/
18
+ RUN cd /tmp/tiny_tds \
19
+ && bundle install \
20
+ && rm -rf /tmp/tiny_tds
21
+ RUN chown -R vscode:vscode /usr/local/rvm && chown -R vscode:vscode /usr/local/bundle
@@ -0,0 +1,6 @@
1
+ # Setup test databases and users.
2
+ sqlcmd -C -S sqlserver -U sa -P 'c0MplicatedP@ssword' -i ./test/sql/db-create.sql
3
+ sqlcmd -C -S sqlserver -U sa -P 'c0MplicatedP@ssword' -i ./test/sql/db-login.sql
4
+
5
+ # Mark directory as safe in Git so that commands run without warnings.
6
+ git config --global --add safe.directory /workspaces/tiny_tds
@@ -0,0 +1,40 @@
1
+ version: '3'
2
+
3
+ services:
4
+ tiny_tds:
5
+ build:
6
+ context: ..
7
+ dockerfile: .devcontainer/Dockerfile
8
+
9
+ volumes:
10
+ - ../..:/workspaces:cached
11
+
12
+ # Overrides default command so things don't shut down after the process ends.
13
+ command: sleep infinity
14
+
15
+ networks:
16
+ - default
17
+ depends_on:
18
+ - sqlserver
19
+
20
+ toxiproxy:
21
+ image: ghcr.io/shopify/toxiproxy:2.5.0
22
+
23
+ sqlserver:
24
+ image: mcr.microsoft.com/mssql/server:2022-latest
25
+ restart: unless-stopped
26
+ networks:
27
+ - default
28
+ volumes:
29
+ - sqlserver-data:/var/opt/mssql
30
+ ports:
31
+ - "1433:1433"
32
+ environment:
33
+ MSSQL_SA_PASSWORD: 'c0MplicatedP@ssword'
34
+ ACCEPT_EULA: Y
35
+
36
+ networks:
37
+ default:
38
+
39
+ volumes:
40
+ sqlserver-data:
@@ -0,0 +1,30 @@
1
+ // For format details, see https://aka.ms/devcontainer.json.
2
+ {
3
+ "name": "tiny_tds project development",
4
+ "dockerComposeFile": "compose.yaml",
5
+ "service": "tiny_tds",
6
+ "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
7
+
8
+ // Features to add to the dev container. More info: https://containers.dev/features.
9
+ "features": {
10
+ "ghcr.io/devcontainers/features/docker-in-docker:2": {
11
+ // Moby is not installable in Debian 11
12
+ "moby": false
13
+ }
14
+ },
15
+
16
+ "containerEnv": {
17
+ "TINYTDS_UNIT_HOST": "sqlserver",
18
+ "TOXIPROXY_HOST": "toxiproxy"
19
+ },
20
+
21
+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
22
+ // This can be used to network with other containers or the host.
23
+ // "forwardPorts": [3000, 5432],
24
+
25
+ // Use 'postCreateCommand' to run commands after the container is created.
26
+ "postCreateCommand": ".devcontainer/boot.sh",
27
+
28
+ // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
29
+ // "remoteUser": "root"
30
+ }
@@ -0,0 +1,586 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ cross-compile:
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ platform:
14
+ - "x64-mingw32"
15
+ - "x64-mingw-ucrt"
16
+ - "x86_64-linux-gnu"
17
+ - "x86_64-linux-musl"
18
+ - "aarch64-linux-gnu"
19
+ - "aarch64-linux-musl"
20
+
21
+ name: cross-compile
22
+ runs-on: ubuntu-22.04
23
+ steps:
24
+ - uses: actions/checkout@v4
25
+
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@v1
28
+ with:
29
+ ruby-version: "2.7"
30
+
31
+ - name: "Install dependencies"
32
+ run: bundle install
33
+
34
+ - name: Write used versions into file
35
+ shell: bash
36
+ run: bundle exec rake ports:version_file[${{ matrix.platform }}]
37
+
38
+ - name: Cache ports
39
+ uses: actions/cache@v4
40
+ with:
41
+ path: ports
42
+ key: cross-compiled-v1-${{ matrix.platform }}-${{ hashFiles('**/.ports_versions') }}
43
+ restore-keys: |
44
+ cross-compiled-v1-${{ matrix.platform }}-${{ hashFiles('**/.ports_versions') }}
45
+ cross-compiled-v1-${{ matrix.platform }}-
46
+
47
+ - name: Build gem
48
+ shell: bash
49
+ run: bundle exec rake gem:native:${{ matrix.platform }}
50
+
51
+ - uses: actions/upload-artifact@v4
52
+ with:
53
+ name: gem-${{ matrix.platform }}
54
+ path: pkg/*.gem
55
+
56
+ install-windows-mingw:
57
+ needs:
58
+ - cross-compile
59
+ strategy:
60
+ fail-fast: false
61
+ matrix:
62
+ ruby-version:
63
+ - "3.0"
64
+
65
+ name: install-windows-mingw
66
+ runs-on: windows-latest
67
+ steps:
68
+ - uses: ruby/setup-ruby@v1
69
+ with:
70
+ ruby-version: ${{ matrix.ruby-version }}
71
+ bundler-cache: true
72
+
73
+ - name: Download precompiled gem
74
+ uses: actions/download-artifact@v4
75
+ with:
76
+ name: gem-x64-mingw32
77
+
78
+ - name: Install native gem
79
+ shell: pwsh
80
+ run: gem install "tiny_tds-*.gem"
81
+
82
+ - name: Test if TinyTDS loads
83
+ shell: pwsh
84
+ run: |
85
+ ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
86
+ exit $LASTEXITCODE
87
+
88
+ - name: Test if tsql wrapper works
89
+ shell: pwsh
90
+ run: |
91
+ tsql-ttds -C
92
+ exit $LASTEXITCODE
93
+
94
+ - name: Test if defncopy wrapper works
95
+ shell: pwsh
96
+ run: |
97
+ defncopy-ttds -v
98
+ exit $LASTEXITCODE
99
+
100
+ test-windows-mingw:
101
+ needs:
102
+ - cross-compile
103
+ strategy:
104
+ fail-fast: false
105
+ matrix:
106
+ force-encryption:
107
+ - false
108
+ - true
109
+ mssql-version:
110
+ - 2017
111
+ - 2019
112
+ - 2022
113
+ ruby-version:
114
+ - "3.0"
115
+
116
+ name: test-windows-mingw
117
+ runs-on: windows-latest
118
+ steps:
119
+ - uses: actions/checkout@v4
120
+
121
+ - uses: ruby/setup-ruby@v1
122
+ with:
123
+ ruby-version: ${{ matrix.ruby-version }}
124
+ bundler-cache: true
125
+
126
+ - name: Download precompiled gem
127
+ uses: actions/download-artifact@v4
128
+ with:
129
+ name: gem-x64-mingw32
130
+
131
+ - name: Install native gem and restore cross-compiled code from it
132
+ shell: pwsh
133
+ run: "& ./test/bin/restore-from-native-gem.ps1"
134
+ env:
135
+ RUBY_ARCHITECTURE: "x64-mingw32"
136
+
137
+ - name: Setup MSSQL
138
+ uses: rails-sqlserver/setup-mssql@v1
139
+ with:
140
+ components: sqlcmd,sqlengine
141
+ version: ${{ matrix.mssql-version }}
142
+ sa-password: c0MplicatedP@ssword
143
+ force-encryption: ${{ matrix.force-encryption }}
144
+
145
+ - name: Setup MSSQL database
146
+ shell: pwsh
147
+ run: |
148
+ & sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-create.sql
149
+ & sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-login.sql
150
+
151
+ - name: Install toxiproxy-server
152
+ shell: pwsh
153
+ run: |
154
+ choco install toxiproxy-server --version=2.5.0 -y
155
+ Start-Process toxiproxy-server
156
+
157
+ - name: Test gem
158
+ shell: pwsh
159
+ run: bundle exec rake test
160
+ env:
161
+ TOXIPROXY_HOST: "localhost"
162
+
163
+ - name: Test Summary
164
+ uses: test-summary/action@v2
165
+ with:
166
+ paths: "test/reports/TEST-*.xml"
167
+ if: always()
168
+
169
+ install-windows-ucrt:
170
+ needs:
171
+ - cross-compile
172
+ strategy:
173
+ fail-fast: false
174
+ matrix:
175
+ ruby-version:
176
+ - "3.1"
177
+ - "3.2"
178
+ - "3.3"
179
+ - "3.4"
180
+ - "4.0"
181
+
182
+ name: install-windows-ucrt
183
+ runs-on: windows-latest
184
+ steps:
185
+ - uses: ruby/setup-ruby@v1
186
+ with:
187
+ ruby-version: ${{ matrix.ruby-version }}
188
+ bundler-cache: true
189
+
190
+ - name: Download precompiled gem
191
+ uses: actions/download-artifact@v4
192
+ with:
193
+ name: gem-x64-mingw-ucrt
194
+
195
+ - name: Install native gem
196
+ shell: pwsh
197
+ run: gem install "tiny_tds-*.gem"
198
+
199
+ - name: Test if TinyTDS loads
200
+ shell: pwsh
201
+ run: |
202
+ ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
203
+ exit $LASTEXITCODE
204
+
205
+ - name: Test if tsql wrapper works
206
+ shell: pwsh
207
+ run: |
208
+ tsql-ttds -C
209
+ exit $LASTEXITCODE
210
+
211
+ - name: Test if defncopy wrapper works
212
+ shell: pwsh
213
+ run: |
214
+ defncopy-ttds -v
215
+ exit $LASTEXITCODE
216
+
217
+ test-windows-ucrt:
218
+ needs:
219
+ - cross-compile
220
+ strategy:
221
+ fail-fast: false
222
+ matrix:
223
+ force-encryption:
224
+ - false
225
+ - true
226
+ mssql-version:
227
+ - 2017
228
+ - 2019
229
+ - 2022
230
+ ruby-version:
231
+ - "3.1"
232
+ - "3.2"
233
+ - "3.3"
234
+ - "3.4"
235
+ - "4.0"
236
+
237
+ name: test-windows-ucrt
238
+ runs-on: windows-latest
239
+ steps:
240
+ - uses: actions/checkout@v4
241
+
242
+ - uses: ruby/setup-ruby@v1
243
+ with:
244
+ ruby-version: ${{ matrix.ruby-version }}
245
+ bundler-cache: true
246
+
247
+ - name: Download precompiled gem
248
+ uses: actions/download-artifact@v4
249
+ with:
250
+ name: gem-x64-mingw-ucrt
251
+
252
+ - name: Install native gem and restore cross-compiled code from it
253
+ shell: pwsh
254
+ run: "& ./test/bin/restore-from-native-gem.ps1"
255
+ env:
256
+ RUBY_ARCHITECTURE: "x64-mingw-ucrt"
257
+
258
+ - name: Setup MSSQL
259
+ uses: rails-sqlserver/setup-mssql@v1
260
+ with:
261
+ components: sqlcmd,sqlengine
262
+ version: ${{ matrix.mssql-version }}
263
+ sa-password: c0MplicatedP@ssword
264
+ force-encryption: ${{ matrix.force-encryption }}
265
+
266
+ - name: Setup MSSQL database
267
+ shell: pwsh
268
+ run: |
269
+ & sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-create.sql
270
+ & sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-login.sql
271
+
272
+ - name: Install toxiproxy-server
273
+ shell: pwsh
274
+ run: |
275
+ choco install toxiproxy-server --version=2.5.0 -y
276
+ Start-Process toxiproxy-server
277
+
278
+ - name: Test gem
279
+ shell: pwsh
280
+ run: bundle exec rake test
281
+ env:
282
+ TOXIPROXY_HOST: "localhost"
283
+
284
+ - name: Test Summary
285
+ uses: test-summary/action@v2
286
+ with:
287
+ paths: "test/reports/TEST-*.xml"
288
+ if: always()
289
+
290
+ install-windows-native:
291
+ strategy:
292
+ fail-fast: false
293
+ matrix:
294
+ ruby-version:
295
+ # currently fails with a dependency resolution
296
+ # looking for conflicting packages...
297
+ # :: 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
298
+ # - "2.7"
299
+ # - "3.0"
300
+ # - "3.1"
301
+ - "3.2"
302
+ - "3.3"
303
+ - "3.4"
304
+ - "4.0"
305
+
306
+ name: install-windows-native
307
+ runs-on: windows-latest
308
+ steps:
309
+ - uses: actions/checkout@v4
310
+
311
+ - uses: ruby/setup-ruby@v1
312
+ with:
313
+ ruby-version: ${{ matrix.ruby-version }}
314
+ bundler-cache: true
315
+
316
+ - name: Build gem
317
+ shell: pwsh
318
+ run: gem build tiny_tds.gemspec
319
+
320
+ - name: Install gem
321
+ shell: pwsh
322
+ run: |
323
+ $gemVersion = (Get-Content VERSION).Trim()
324
+ gem install "tiny_tds-$gemVersion.gem"
325
+
326
+ - name: Test if TinyTDS loads
327
+ shell: pwsh
328
+ run: |
329
+ ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
330
+ exit $LASTEXITCODE
331
+
332
+ - name: Test if tsql wrapper works
333
+ shell: pwsh
334
+ run: |
335
+ tsql-ttds -C
336
+ exit $LASTEXITCODE
337
+
338
+ - name: Test if defncopy wrapper works
339
+ shell: pwsh
340
+ run: |
341
+ defncopy-ttds -v
342
+ exit $LASTEXITCODE
343
+
344
+ install-linux:
345
+ needs:
346
+ - cross-compile
347
+ strategy:
348
+ fail-fast: false
349
+ matrix:
350
+ platform:
351
+ - "x86_64-linux-gnu"
352
+ - "x86_64-linux-musl"
353
+ - "aarch64-linux-gnu"
354
+ - "aarch64-linux-musl"
355
+
356
+ ruby-version:
357
+ - "3.0"
358
+ - "3.1"
359
+ - "3.2"
360
+ - "3.3"
361
+ - "3.4"
362
+ - "4.0"
363
+
364
+ include:
365
+ - platform: x86_64-linux-musl
366
+ docker_tag: "-alpine"
367
+ bootstrap: "apk add -U build-base &&" # required to compile bigdecimal on Ruby 2.7
368
+
369
+ - platform: aarch64-linux-gnu
370
+ docker_platform: "--platform=linux/arm64"
371
+
372
+ - platform: aarch64-linux-musl
373
+ docker_platform: "--platform=linux/arm64"
374
+ docker_tag: "-alpine"
375
+ bootstrap: "apk add -U build-base &&"
376
+
377
+ name: install-linux
378
+ runs-on: ubuntu-22.04
379
+ steps:
380
+ - name: Download precompiled gem
381
+ uses: actions/download-artifact@v4
382
+ with:
383
+ name: gem-${{ matrix.platform }}
384
+ path: precompiled/gems
385
+
386
+ - name: Setup QEMU for docker
387
+ uses: docker/setup-qemu-action@v3
388
+ if: ${{ matrix.docker_platform }} != ''
389
+
390
+ - run: |
391
+ docker run --rm -v $PWD/precompiled:/precompiled -w /precompiled \
392
+ ${{ matrix.docker_platform }} ruby:${{ matrix.ruby-version }}${{ matrix.docker_tag }} \
393
+ sh -c "
394
+ gem update --system 3.3.22 &&
395
+ ${{ matrix.bootstrap }}
396
+ gem install --no-document ./gems/tiny_tds-*.gem &&
397
+ ruby -e \"require 'tiny_tds'; puts TinyTds::Gem.root_path\" &&
398
+ tsql-ttds -C &&
399
+ defncopy-ttds -v
400
+ "
401
+
402
+ test-linux:
403
+ needs:
404
+ - cross-compile
405
+ name: test-linux
406
+ strategy:
407
+ fail-fast: false
408
+ matrix:
409
+ force-encryption:
410
+ - false
411
+ - true
412
+
413
+ mssql-version:
414
+ - 2019
415
+ - 2022
416
+
417
+ ruby-version:
418
+ - "3.0"
419
+ - "3.1"
420
+ - "3.2"
421
+ - "3.3"
422
+ - "3.4"
423
+ - "4.0"
424
+
425
+ runs-on: ubuntu-22.04
426
+ steps:
427
+ - uses: actions/checkout@v4
428
+
429
+ - uses: ruby/setup-ruby@v1
430
+ with:
431
+ ruby-version: ${{ matrix.ruby-version }}
432
+ bundler-cache: true
433
+
434
+ - name: Download precompiled gem
435
+ uses: actions/download-artifact@v4
436
+ with:
437
+ name: gem-x86_64-linux-gnu
438
+
439
+ - name: Install native gem and restore cross-compiled code from it
440
+ shell: pwsh
441
+ run: "& ./test/bin/restore-from-native-gem.ps1"
442
+ env:
443
+ RUBY_ARCHITECTURE: "x86_64-linux-gnu"
444
+
445
+ - name: Setup MSSQL
446
+ uses: rails-sqlserver/setup-mssql@v1
447
+ with:
448
+ components: sqlcmd,sqlengine
449
+ version: ${{ matrix.mssql-version }}
450
+ sa-password: "c0MplicatedP@ssword"
451
+ force-encryption: ${{ matrix.force-encryption }}
452
+
453
+ - name: Setup MSSQL database
454
+ run: |
455
+ sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-create.sql
456
+ sqlcmd -S localhost -U sa -P "c0MplicatedP@ssword" -i ./test/sql/db-login.sql
457
+
458
+ - name: Install toxiproxy-server
459
+ run: |
460
+ wget -O toxiproxy-2.5.0.deb https://github.com/Shopify/toxiproxy/releases/download/v2.5.0/toxiproxy_2.5.0_linux_amd64.deb
461
+ sudo dpkg -i toxiproxy-2.5.0.deb
462
+ sudo toxiproxy-server &
463
+
464
+ - name: Run tests
465
+ run: bundle exec rake test
466
+ env:
467
+ TOXIPROXY_HOST: "localhost"
468
+
469
+ - name: Test Summary
470
+ uses: test-summary/action@v2
471
+ with:
472
+ paths: "test/reports/TEST-*.xml"
473
+ if: always()
474
+
475
+ install-linux-native:
476
+ strategy:
477
+ fail-fast: false
478
+ matrix:
479
+ ruby-version:
480
+ - "2.7"
481
+ - "3.0"
482
+ - "3.1"
483
+ - "3.2"
484
+ - "3.3"
485
+ - "3.4"
486
+ - "4.0"
487
+
488
+ name: install-linux-native
489
+ runs-on: ubuntu-22.04
490
+ steps:
491
+ - uses: actions/checkout@v4
492
+
493
+ - uses: ruby/setup-ruby@v1
494
+ with:
495
+ ruby-version: ${{ matrix.ruby-version }}
496
+ bundler-cache: true
497
+
498
+ - name: Install FreeTDS
499
+ shell: bash
500
+ run: ./test/bin/install-freetds.sh
501
+
502
+ - name: Build gem
503
+ shell: bash
504
+ run: gem build tiny_tds.gemspec
505
+
506
+ - name: Install gem
507
+ shell: bash
508
+ run: gem install "tiny_tds-$(cat VERSION).gem"
509
+
510
+ - name: Test if TinyTDS loads
511
+ shell: bash
512
+ run: ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
513
+
514
+ - name: Test if tsql wrapper works
515
+ shell: bash
516
+ run: tsql-ttds -C
517
+
518
+ - name: Test if defncopy wrapper works
519
+ shell: bash
520
+ run: defncopy-ttds -v
521
+
522
+ install_macos:
523
+ strategy:
524
+ fail-fast: false
525
+ matrix:
526
+ ruby-version:
527
+ - "2.7"
528
+ - "3.0"
529
+ - "3.1"
530
+ - "3.2"
531
+ - "3.3"
532
+ - "3.4"
533
+ - "4.0"
534
+
535
+ name: install-macos-m1
536
+ runs-on: macos-14
537
+ steps:
538
+ - uses: actions/checkout@v4
539
+
540
+ - name: Install FreeTDS
541
+ run: brew install freetds
542
+ shell: bash
543
+
544
+ - uses: ruby/setup-ruby@v1
545
+ with:
546
+ ruby-version: ${{ matrix.ruby-version }}
547
+ bundler-cache: true
548
+
549
+ - name: Build gem
550
+ shell: bash
551
+ run: gem build tiny_tds.gemspec
552
+
553
+ - name: Install gem and test if TinyTDS loads
554
+ shell: bash
555
+ run: |
556
+ gemVersion=$(<VERSION tr -d '[:space:]')
557
+ gem install "tiny_tds-$gemVersion.gem"
558
+
559
+ - name: Test if TinyTDS loads
560
+ shell: bash
561
+ run: |
562
+ ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
563
+
564
+ formatting:
565
+ name: Code formatting
566
+ runs-on: ubuntu-22.04
567
+ steps:
568
+ - uses: actions/checkout@v4
569
+
570
+ - uses: ruby/setup-ruby@v1
571
+ with:
572
+ ruby-version: "2.7"
573
+ bundler-cache: true
574
+
575
+ - name: Check standardrb
576
+ shell: bash
577
+ run: bundle exec standardrb
578
+
579
+ # - name: Check artistic style
580
+ # uses: per1234/artistic-style-action@v1
581
+ # with:
582
+ # options-file-path: "astyle.conf"
583
+ # target-paths: "./ext/"
584
+ # name-patterns: |
585
+ # - '*.c'
586
+ # - '*.h'
data/.gitignore CHANGED
@@ -18,3 +18,5 @@ misc
18
18
  /exe/*
19
19
  /ports/*
20
20
  !/ports/patches/
21
+ test/reports
22
+ .ports_versions