tiny_tds 3.2.1-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 +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 +17 -5
- data/CHANGELOG.md +7 -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/3.1/tiny_tds.so +0 -0
- data/lib/tiny_tds/3.2/tiny_tds.so +0 -0
- data/lib/tiny_tds/3.3/tiny_tds.so +0 -0
- data/lib/tiny_tds/3.4/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/x86_64-linux-musl/bin/defncopy +0 -0
- data/ports/x86_64-linux-musl/bin/tsql +0 -0
- data/ports/x86_64-linux-musl/lib/libsybdb.so.5 +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: 0f7c55eda74ec1ecc1e3359f005ee9929aaf8645dc2b8a74d2c9ed8bbd49755f
|
4
|
+
data.tar.gz: ae0764af31a10d9c8b886e81e914b917171cf6255cbea1d59b13a17451b6d8b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
+
}
|
data/.github/workflows/ci.yml
CHANGED
@@ -292,9 +292,12 @@ jobs:
|
|
292
292
|
fail-fast: false
|
293
293
|
matrix:
|
294
294
|
ruby-version:
|
295
|
-
|
296
|
-
|
297
|
-
-
|
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"
|
@@ -555,8 +558,8 @@ jobs:
|
|
555
558
|
run: |
|
556
559
|
ruby -e "require 'tiny_tds'; puts TinyTds::Gem.root_path"
|
557
560
|
|
558
|
-
|
559
|
-
name:
|
561
|
+
formatting:
|
562
|
+
name: Code formatting
|
560
563
|
runs-on: ubuntu-22.04
|
561
564
|
steps:
|
562
565
|
- uses: actions/checkout@v4
|
@@ -569,3 +572,12 @@ jobs:
|
|
569
572
|
- name: Check standardrb
|
570
573
|
shell: bash
|
571
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
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
|