tiny_tds 3.2.0-x64-mingw32 → 3.3.0-x64-mingw32
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.
- checksums.yaml +4 -4
- data/.devcontainer/Dockerfile +21 -0
- data/.devcontainer/boot.sh +6 -0
- data/.devcontainer/compose.yaml +40 -0
- data/.devcontainer/devcontainer.json +30 -0
- data/.github/workflows/ci.yml +20 -27
- data/CHANGELOG.md +12 -0
- data/README.md +17 -33
- data/Rakefile +5 -0
- data/VERSION +1 -1
- data/astyle.conf +8 -0
- data/ext/tiny_tds/client.c +163 -64
- data/ext/tiny_tds/extconsts.rb +2 -2
- data/ext/tiny_tds/result.c +171 -42
- data/ext/tiny_tds/result.h +2 -2
- data/ext/tiny_tds/tiny_tds_ext.c +2 -1
- data/lib/tiny_tds/2.7/tiny_tds.so +0 -0
- data/lib/tiny_tds/3.0/tiny_tds.so +0 -0
- data/lib/tiny_tds/bin.rb +2 -2
- data/lib/tiny_tds/gem.rb +6 -6
- data/lib/tiny_tds.rb +1 -2
- data/ports/x64-mingw32/bin/defncopy.exe +0 -0
- data/ports/x64-mingw32/bin/libsybdb-5.dll +0 -0
- data/ports/x64-mingw32/bin/tsql.exe +0 -0
- data/test/bin/restore-from-native-gem.ps1 +7 -1
- data/test/gem_test.rb +23 -28
- data/test/thread_test.rb +1 -1
- data/tiny_tds.gemspec +2 -2
- metadata +7 -10
- data/docker-compose.yml +0 -34
- data/setup_cimgruby_dev.sh +0 -25
- data/start_dev.sh +0 -21
- data/test/bin/install-mssql.ps1 +0 -42
- data/test/bin/install-mssqltools.sh +0 -9
- data/test/bin/install-openssl.sh +0 -18
- data/test/bin/setup_tinytds_db.sh +0 -7
- data/test/bin/setup_volume_permissions.sh +0 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54b3de649d19270daf9ed150ebc13224493b09c204204aecf5f74dcafdbb2642
|
4
|
+
data.tar.gz: fecc088d5ffa3f9cb94fcc3a5f27a9d8e8d01828ed1118437265ec8fd5160936
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d432eb891e3d6a266d4d4f81611c71a6d9100fa964ca50a52b2964815fe92e3b494ec5375dced644d0f6324784bf6bae837bfff29d282187525283f482a12e5
|
7
|
+
data.tar.gz: 5bd01484facd6fac7fca705f87fcf73f72e593613e506df7765326dc15b4ae98449e05aa03baee3fe924f05f444a0d94c962cea2f451150d74c472f0ae4455ee
|
@@ -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
|
+
}
|
data/.github/workflows/ci.yml
CHANGED
@@ -66,8 +66,6 @@ jobs:
|
|
66
66
|
name: install-windows-mingw
|
67
67
|
runs-on: windows-latest
|
68
68
|
steps:
|
69
|
-
- uses: actions/checkout@v4
|
70
|
-
|
71
69
|
- uses: ruby/setup-ruby@v1
|
72
70
|
with:
|
73
71
|
ruby-version: ${{ matrix.ruby-version }}
|
@@ -80,13 +78,7 @@ jobs:
|
|
80
78
|
|
81
79
|
- name: Install native gem
|
82
80
|
shell: pwsh
|
83
|
-
run:
|
84
|
-
$rubyArchitecture = (ruby -e "puts RbConfig::CONFIG['arch']").Trim()
|
85
|
-
$gemVersion = (Get-Content VERSION).Trim()
|
86
|
-
$gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem"
|
87
|
-
|
88
|
-
Write-Host "Looking to install $gemToInstall"
|
89
|
-
gem install "$gemToInstall"
|
81
|
+
run: gem install "tiny_tds-*.gem"
|
90
82
|
|
91
83
|
- name: Test if TinyTDS loads
|
92
84
|
shell: pwsh
|
@@ -191,8 +183,6 @@ jobs:
|
|
191
183
|
name: install-windows-ucrt
|
192
184
|
runs-on: windows-latest
|
193
185
|
steps:
|
194
|
-
- uses: actions/checkout@v4
|
195
|
-
|
196
186
|
- uses: ruby/setup-ruby@v1
|
197
187
|
with:
|
198
188
|
ruby-version: ${{ matrix.ruby-version }}
|
@@ -205,13 +195,7 @@ jobs:
|
|
205
195
|
|
206
196
|
- name: Install native gem
|
207
197
|
shell: pwsh
|
208
|
-
run:
|
209
|
-
$rubyArchitecture = (ruby -e "puts RbConfig::CONFIG['arch']").Trim()
|
210
|
-
$gemVersion = (Get-Content VERSION).Trim()
|
211
|
-
$gemToInstall = "./tiny_tds-$gemVersion-$rubyArchitecture.gem"
|
212
|
-
|
213
|
-
Write-Host "Looking to install $gemToInstall"
|
214
|
-
gem install "$gemToInstall"
|
198
|
+
run: gem install "tiny_tds-*.gem"
|
215
199
|
|
216
200
|
- name: Test if TinyTDS loads
|
217
201
|
shell: pwsh
|
@@ -308,9 +292,12 @@ jobs:
|
|
308
292
|
fail-fast: false
|
309
293
|
matrix:
|
310
294
|
ruby-version:
|
311
|
-
|
312
|
-
|
313
|
-
-
|
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"
|
314
301
|
- "3.2"
|
315
302
|
- "3.3"
|
316
303
|
- "3.4"
|
@@ -389,8 +376,6 @@ jobs:
|
|
389
376
|
name: install-linux
|
390
377
|
runs-on: ubuntu-22.04
|
391
378
|
steps:
|
392
|
-
- uses: actions/checkout@v4
|
393
|
-
|
394
379
|
- name: Download precompiled gem
|
395
380
|
uses: actions/download-artifact@v4
|
396
381
|
with:
|
@@ -407,7 +392,7 @@ jobs:
|
|
407
392
|
sh -c "
|
408
393
|
gem update --system 3.3.22 &&
|
409
394
|
${{ matrix.bootstrap }}
|
410
|
-
gem install --no-document ./gems/tiny_tds
|
395
|
+
gem install --no-document ./gems/tiny_tds-*.gem &&
|
411
396
|
ruby -e \"require 'tiny_tds'; puts TinyTds::Gem.root_path\" &&
|
412
397
|
tsql-ttds -C &&
|
413
398
|
defncopy-ttds -v
|
@@ -425,7 +410,6 @@ jobs:
|
|
425
410
|
- true
|
426
411
|
|
427
412
|
mssql-version:
|
428
|
-
- 2017
|
429
413
|
- 2019
|
430
414
|
- 2022
|
431
415
|
|
@@ -574,8 +558,8 @@ jobs:
|
|
574
558
|
run: |
|
575
559
|
ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
|
576
560
|
|
577
|
-
|
578
|
-
name:
|
561
|
+
formatting:
|
562
|
+
name: Code formatting
|
579
563
|
runs-on: ubuntu-22.04
|
580
564
|
steps:
|
581
565
|
- uses: actions/checkout@v4
|
@@ -588,3 +572,12 @@ jobs:
|
|
588
572
|
- name: Check standardrb
|
589
573
|
shell: bash
|
590
574
|
run: bundle exec standardrb
|
575
|
+
|
576
|
+
# - name: Check artistic style
|
577
|
+
# uses: per1234/artistic-style-action@v1
|
578
|
+
# with:
|
579
|
+
# options-file-path: "astyle.conf"
|
580
|
+
# target-paths: "./ext/"
|
581
|
+
# name-patterns: |
|
582
|
+
# - '*.c'
|
583
|
+
# - '*.h'
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
## (unreleased)
|
2
|
+
|
3
|
+
## 3.3.0
|
4
|
+
|
5
|
+
* Use freetds v1.5.4 and OpenSSL v3.5.2 for Windows and Linux builds.
|
6
|
+
* Use `TypedData` in C-Land.
|
7
|
+
|
8
|
+
## 3.2.1
|
9
|
+
|
10
|
+
* Ensure the native Gem loads on Windows. Fixes #581.
|
11
|
+
* Use OpenSSL v3.4.1 for Windows and Linux builds.
|
12
|
+
|
1
13
|
## 3.2.0
|
2
14
|
|
3
15
|
* Reduce number of files shipped with precompiled Windows gem
|
data/README.md
CHANGED
@@ -80,9 +80,9 @@ Optionally, Microsoft has done a great job writing [an article](https://learn.mi
|
|
80
80
|
|
81
81
|
## Data Types
|
82
82
|
|
83
|
-
Our goal is to support every SQL Server data type and
|
83
|
+
Our goal is to support every SQL Server data type and convert it to a logical Ruby object. When dates or times are returned, they are instantiated to either `:utc` or `:local` time depending on the query options. Only [datetimeoffset] types are excluded. All strings are associated to the connection's encoding and all binary data types are associated to Ruby's `ASCII-8BIT/BINARY` encoding.
|
84
84
|
|
85
|
-
Below is a list of the data types we support when using the 7.
|
85
|
+
Below is a list of the data types we support when using the 7.3 TDS protocol version. Using a lower protocol version will result in these types being returned as strings.
|
86
86
|
|
87
87
|
* [date]
|
88
88
|
* [datetime2]
|
@@ -98,11 +98,11 @@ Connect to a database.
|
|
98
98
|
client = TinyTds::Client.new username: 'sa', password: 'secret', host: 'mydb.host.net'
|
99
99
|
```
|
100
100
|
|
101
|
-
Creating a new client takes a hash of options. For valid iconv encoding options, see the output of `iconv -l`. Only a few have been tested and highly recommended to leave blank for the UTF-8 default.
|
101
|
+
Creating a new client takes a hash of options. For valid iconv encoding options, see the output of `iconv -l`. Only a few have been tested, and are highly recommended to leave blank for the UTF-8 default.
|
102
102
|
|
103
103
|
* :username - The database server user.
|
104
104
|
* :password - The user password.
|
105
|
-
* :dataserver - Can be the name for your data server as defined in freetds.conf. Raw hostname or hostname:port will work here too. FreeTDS says that named instance like 'localhost\SQLEXPRESS' work too, but I highly suggest that you use the :host and :port options below. [Google how to find your host port if you are using named instances](http://bit.ly/xAf2jm) or [go here](http://msdn.microsoft.com/en-us/library/ms181087.aspx).
|
105
|
+
* :dataserver - Can be the name for your data server as defined in freetds.conf. Raw hostname or hostname:port will work here too. FreeTDS says that a named instance like 'localhost\SQLEXPRESS' will work too, but I highly suggest that you use the :host and :port options below. [Google how to find your host port if you are using named instances](http://bit.ly/xAf2jm) or [go here](http://msdn.microsoft.com/en-us/library/ms181087.aspx).
|
106
106
|
* :host - Used if :dataserver blank. Can be an host name or IP.
|
107
107
|
* :port - Defaults to 1433. Only used if :host is used.
|
108
108
|
* :database - The default database to use.
|
@@ -401,47 +401,31 @@ First, clone the repo using the command line or your Git GUI of choice.
|
|
401
401
|
$ git clone git@github.com:rails-sqlserver/tiny_tds.git
|
402
402
|
```
|
403
403
|
|
404
|
-
After that, the quickest way to get setup for development is to use
|
404
|
+
After that, the quickest way to get setup for development is to use the provided devcontainers setup.
|
405
405
|
|
406
406
|
```shell
|
407
|
-
|
407
|
+
npm install -g @devcontainers/cli
|
408
|
+
devcontainer up --workspace-folder .
|
409
|
+
devcontainer exec --workspace-folder . bash
|
408
410
|
```
|
409
411
|
|
410
|
-
|
412
|
+
From within the container, you can run the tests using the following command:
|
411
413
|
|
412
414
|
```shell
|
413
|
-
|
414
|
-
|
415
|
-
$ docker run -p 1433:1433 -d --name sqlserver --network main-network mcr.microsoft.com/mssql/server:2017-latest
|
416
|
-
$ docker pull shopify/toxiproxy
|
417
|
-
$ docker run -p 8474:8474 -p 1234:1234 -d --name toxiproxy --network main-network shopify/toxiproxy
|
415
|
+
bundle install
|
416
|
+
bundle exec rake test
|
418
417
|
```
|
419
418
|
|
420
|
-
|
419
|
+
You can customize the environment variables to run the tests against a different environment
|
421
420
|
|
422
|
-
```shell
|
423
|
-
|
424
|
-
|
425
|
-
```
|
426
|
-
|
427
|
-
From here you can build and run tests against an installed version of FreeTDS.
|
428
|
-
|
429
|
-
```shell
|
430
|
-
$ bundle install
|
431
|
-
$ bundle exec rake
|
432
|
-
```
|
433
|
-
|
434
|
-
Examples us using enviornment variables to customize the test task.
|
435
|
-
|
436
|
-
```
|
437
|
-
$ rake TINYTDS_UNIT_DATASERVER=mydbserver
|
438
|
-
$ rake TINYTDS_UNIT_DATASERVER=mydbserver TINYTDS_SCHEMA=sqlserver_2017
|
439
|
-
$ rake TINYTDS_UNIT_HOST=mydb.host.net TINYTDS_SCHEMA=sqlserver_azure
|
421
|
+
```shell
|
422
|
+
rake test TINYTDS_UNIT_DATASERVER=mydbserver TINYTDS_SCHEMA=sqlserver_2017
|
423
|
+
rake test TINYTDS_UNIT_HOST=mydb.host.net TINYTDS_SCHEMA=sqlserver_azure
|
440
424
|
```
|
441
425
|
|
442
426
|
### Code formatting
|
443
427
|
|
444
|
-
We are using `standardrb` to format
|
428
|
+
We are using `standardrb` to format the Ruby code and Artistic Style for the C code. Run `bundle exec rake format` to format both types in one operation. Artistic Style needs to be manually installed through your package manager (e.g. `apt install -y astyle`).
|
445
429
|
|
446
430
|
### Compiling Gems for Windows and Linux
|
447
431
|
|
@@ -450,7 +434,7 @@ We are using `standardrb` to format our code. Just run `bundle exec standardrb -
|
|
450
434
|
|
451
435
|
For the convenience, TinyTDS ships pre-compiled gems for supported versions of Ruby on Windows and Linux. In order to generate these gems, [rake-compiler-dock](https://github.com/rake-compiler/rake-compiler-dock) is used.
|
452
436
|
|
453
|
-
Run the following rake task to compile the gems.
|
437
|
+
Run the following rake task to compile the gems. You can run these commands from inside the devcontainers setup, or outside if neeed. The command will check the availability of [Docker](https://www.docker.com/) and will give some advice for download and installation. When docker is running, it will download the docker image (once-only) and start the build:
|
454
438
|
|
455
439
|
```shell
|
456
440
|
bundle exec rake gem:native
|
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.
|
1
|
+
3.3.0
|