tiny_tds 3.2.0-x86_64-linux-musl → 3.3.0-x86_64-linux-musl

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: 6f297f493ca8dc8ba53674da403082c598fb3f72f9705159e43b9f615f5785d9
4
- data.tar.gz: 9c1ed81e5a58b54e3faeaeb7595892214c5440b0b1909f1e8763afc426c44ea9
3
+ metadata.gz: 0f7c55eda74ec1ecc1e3359f005ee9929aaf8645dc2b8a74d2c9ed8bbd49755f
4
+ data.tar.gz: ae0764af31a10d9c8b886e81e914b917171cf6255cbea1d59b13a17451b6d8b3
5
5
  SHA512:
6
- metadata.gz: 1fc1a21e2dfcc115c2c8cea407be7fd263d6a6d5f0ed3f6565b8177ba2db7475f5987aebccdc650326e37989de237cfcb49630b669d6ae2fae084f1866b56e6c
7
- data.tar.gz: 4f385281b6e7c13aea05ce985a05bc5b1c890658f31045244af4f265ff82937d80d4a2132508556bd0d6e7705aa2c6dc8c70475da24a6250f123a00f6a535ccf
6
+ metadata.gz: a1cfa12f05905da8c06d7e3df908f02ba701224d655a345c8318eacd2b2189dc508859692992cc6c24e9de22cac265f4cde1943bff8a4e93e3a821dbaac1109f
7
+ data.tar.gz: eb6ac2f1d82a0ee5d04328c5e6640d98874029c284f4a6881c834a0042431626682cc835ae0274e711a05e826c8a62a291458e63062ec212d553001fa3bcb860
@@ -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
+ }
@@ -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
- - "2.7"
312
- - "3.0"
313
- - "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"
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-$(cat VERSION)-${{ matrix.platform }}.gem &&
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
- standardrb:
578
- name: standardrb
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 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.0
1
+ 3.3.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