tiny_tds 3.2.1-x64-mingw-ucrt → 3.4.0-x64-mingw-ucrt

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ec1f8d3c14774f60938a49610e5ef4d8505d76cbf08e0de9eae7ee70d8a97a5c
4
- data.tar.gz: 20898496930040aaa8a5b63720d152ed826489771ab6e113cc25795e029b6496
3
+ metadata.gz: ea9b8530b935fc87d3b3b8ae41bcbcd0bcbb975a71632449536f9bdf0bdaf456
4
+ data.tar.gz: 2725041ecc76d2c19ae966bb1df722f780599daa640589015da15a69378bd9a5
5
5
  SHA512:
6
- metadata.gz: 3d70f09ffef9d809f56cdb73fe1ea60c33b75dad11a8312a039000710e4e23abd740891a2d22e2c59887ccfc786f6df3a2634e45325a25515e81fb945a3a32d5
7
- data.tar.gz: db3b6e1afac094ff59c6d3fd1edd4289b449564521f150303022a0d04212f464649d63babb17c2115f0567f14f8768760e7439d1a2d5e84f15becff101a7b129
6
+ metadata.gz: 6b6ce521ec90688f2e1d281b4ad8ad68061b3e4c33ad0af8a7fc15885e0b80717c4037efa0163581f0bbd8ae2b49eb2eae9fba89b8133124b1fd72297a329c2e
7
+ data.tar.gz: 996066fddbc79fa1540605deba12af3becdac5b24c1f177e4057a1bbca3db871dd2c207c7ac20e6888b38da520f61bec0f60281cfa7ce6cc64070d07643b01c8
@@ -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
+ }
@@ -60,7 +60,6 @@ jobs:
60
60
  fail-fast: false
61
61
  matrix:
62
62
  ruby-version:
63
- - "2.7"
64
63
  - "3.0"
65
64
 
66
65
  name: install-windows-mingw
@@ -112,7 +111,6 @@ jobs:
112
111
  - 2019
113
112
  - 2022
114
113
  ruby-version:
115
- - "2.7"
116
114
  - "3.0"
117
115
 
118
116
  name: test-windows-mingw
@@ -179,6 +177,7 @@ jobs:
179
177
  - "3.2"
180
178
  - "3.3"
181
179
  - "3.4"
180
+ - "4.0"
182
181
 
183
182
  name: install-windows-ucrt
184
183
  runs-on: windows-latest
@@ -233,6 +232,7 @@ jobs:
233
232
  - "3.2"
234
233
  - "3.3"
235
234
  - "3.4"
235
+ - "4.0"
236
236
 
237
237
  name: test-windows-ucrt
238
238
  runs-on: windows-latest
@@ -292,12 +292,16 @@ jobs:
292
292
  fail-fast: false
293
293
  matrix:
294
294
  ruby-version:
295
- - "2.7"
296
- - "3.0"
297
- - "3.1"
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"
298
301
  - "3.2"
299
302
  - "3.3"
300
303
  - "3.4"
304
+ - "4.0"
301
305
 
302
306
  name: install-windows-native
303
307
  runs-on: windows-latest
@@ -350,12 +354,12 @@ jobs:
350
354
  - "aarch64-linux-musl"
351
355
 
352
356
  ruby-version:
353
- - "2.7"
354
357
  - "3.0"
355
358
  - "3.1"
356
359
  - "3.2"
357
360
  - "3.3"
358
361
  - "3.4"
362
+ - "4.0"
359
363
 
360
364
  include:
361
365
  - platform: x86_64-linux-musl
@@ -411,12 +415,12 @@ jobs:
411
415
  - 2022
412
416
 
413
417
  ruby-version:
414
- - "2.7"
415
418
  - "3.0"
416
419
  - "3.1"
417
420
  - "3.2"
418
421
  - "3.3"
419
422
  - "3.4"
423
+ - "4.0"
420
424
 
421
425
  runs-on: ubuntu-22.04
422
426
  steps:
@@ -479,6 +483,7 @@ jobs:
479
483
  - "3.2"
480
484
  - "3.3"
481
485
  - "3.4"
486
+ - "4.0"
482
487
 
483
488
  name: install-linux-native
484
489
  runs-on: ubuntu-22.04
@@ -525,6 +530,7 @@ jobs:
525
530
  - "3.2"
526
531
  - "3.3"
527
532
  - "3.4"
533
+ - "4.0"
528
534
 
529
535
  name: install-macos-m1
530
536
  runs-on: macos-14
@@ -555,8 +561,8 @@ jobs:
555
561
  run: |
556
562
  ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
557
563
 
558
- standardrb:
559
- name: standardrb
564
+ formatting:
565
+ name: Code formatting
560
566
  runs-on: ubuntu-22.04
561
567
  steps:
562
568
  - uses: actions/checkout@v4
@@ -569,3 +575,12 @@ jobs:
569
575
  - name: Check standardrb
570
576
  shell: bash
571
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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## (unreleased)
2
+
3
+ ## 3.4.0
4
+
5
+ * Add Ruby 4.0 to the cross compile list
6
+ * No longer ship a precompiled Gem for Ruby 2.7
7
+ * This is due to an [upstream change](https://github.com/rake-compiler/rake-compiler-dock/releases/tag/v1.11.0). Users on Windows and Linux on Ruby v2.7 are advised to either upgrade or install FreeTDS manually.
8
+ * Use freetds v1.5.10 and OpenSSL v3.6.0 for Windows and Linux builds.
9
+ * Lower `bigdecimal` requirement to `>= 2.0.0` (was 3.0 only) to allow `bigdecimal` 4.0 on Ruby 4.0. Closes #601.
10
+
11
+ ## 3.3.0
12
+
13
+ * Use freetds v1.5.4 and OpenSSL v3.5.2 for Windows and Linux builds.
14
+ * Use `TypedData` in C-Land.
15
+
1
16
  ## 3.2.1
2
17
 
3
18
  * Ensure the native Gem loads on Windows. Fixes #581.
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 covert 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 the to the connection's encoding and all binary data types are associated to Ruby's `ASCII-8BIT/BINARY` encoding.
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.4 TDS protocol version. Using a lower protocol version will result in these types being returned as strings.
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 [Docker](https://www.docker.com/). Assuming you have [downloaded docker](https://www.docker.com/products/docker) for your platform, you can use [docker-compose](https://docs.docker.com/compose/install/) to run the necessary containers for testing.
404
+ After that, the quickest way to get setup for development is to use the provided devcontainers setup.
405
405
 
406
406
  ```shell
407
- $ docker-compose up -d
407
+ npm install -g @devcontainers/cli
408
+ devcontainer up --workspace-folder .
409
+ devcontainer exec --workspace-folder . bash
408
410
  ```
409
411
 
410
- This will download the official SQL Server for Linux Docker image from [Microsoft](https://hub.docker.com/r/microsoft/mssql-server-linux/). This will also download a [toxiproxy](https://github.com/shopify/toxiproxy) Docker image which we can use to simulate network failures for tests. Basically, it does the following:
412
+ From within the container, you can run the tests using the following command:
411
413
 
412
414
  ```shell
413
- $ docker network create main-network
414
- $ docker pull mcr.microsoft.com/mssql/server:2017-latest
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
- Make sure to run these SQL scripts as SA to get the test database and user installed. If needed, install [sqlcmd as described by Microsoft for your platform](https://learn.microsoft.com/en-us/sql/tools/sqlcmd/sqlcmd-utility?view=sql-server-ver16&tabs=go%2Clinux&pivots=cs1-bash).
419
+ You can customize the environment variables to run the tests against a different environment
421
420
 
422
- ```shell
423
- /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P super01S3cUr3 -i ./test/sql/db-create.sql
424
- /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P super01S3cUr3 -i ./test/sql/db-login.sql
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 our code. Just run `bundle exec standardrb --fix` to format all Ruby files.
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. This 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:
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
@@ -65,3 +65,8 @@ end
65
65
 
66
66
  task build: [:clean, :compile]
67
67
  task default: [:build, :test]
68
+
69
+ task :format do
70
+ system("bundle exec standardrb --fix")
71
+ system('astyle --options=astyle.conf "./ext/*.c" "./ext/*.h"')
72
+ end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.2.1
1
+ 3.4.0
data/astyle.conf ADDED
@@ -0,0 +1,8 @@
1
+ --style=1tbs
2
+ --break-blocks
3
+ --indent-preproc-block
4
+ --indent-preproc-cond
5
+ --indent=spaces=2
6
+ --indent-switches
7
+ --recursive
8
+ --suffix=none