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 +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 +24 -9
- data/CHANGELOG.md +15 -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/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/4.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-mingw-ucrt/bin/defncopy.exe +0 -0
- data/ports/x64-mingw-ucrt/bin/libsybdb-5.dll +0 -0
- data/ports/x64-mingw-ucrt/bin/tsql.exe +0 -0
- data/tasks/native_gem.rake +1 -1
- data/test/bin/restore-from-native-gem.ps1 +7 -1
- data/test/gem_test.rb +23 -28
- data/test/thread_test.rb +1 -9
- data/tiny_tds.gemspec +8 -5
- metadata +46 -20
- 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
data/lib/tiny_tds/bin.rb
CHANGED
|
@@ -50,7 +50,7 @@ module TinyTds
|
|
|
50
50
|
|
|
51
51
|
begin
|
|
52
52
|
ENV["PATH"] = [
|
|
53
|
-
Gem.
|
|
53
|
+
Gem.ports_bin_and_lib_paths,
|
|
54
54
|
old_path
|
|
55
55
|
].flatten.join File::PATH_SEPARATOR
|
|
56
56
|
|
|
@@ -65,7 +65,7 @@ module TinyTds
|
|
|
65
65
|
end
|
|
66
66
|
|
|
67
67
|
def find_exe
|
|
68
|
-
Gem.
|
|
68
|
+
Gem.ports_bin_and_lib_paths.each do |bin|
|
|
69
69
|
@exts.each do |ext|
|
|
70
70
|
f = File.join bin, "#{name}#{ext}"
|
|
71
71
|
return f if File.exist?(f)
|
data/lib/tiny_tds/gem.rb
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
require "rbconfig"
|
|
2
|
-
|
|
3
1
|
module TinyTds
|
|
4
2
|
module Gem
|
|
5
3
|
class << self
|
|
@@ -11,12 +9,14 @@ module TinyTds
|
|
|
11
9
|
File.join(root_path, "ports")
|
|
12
10
|
end
|
|
13
11
|
|
|
14
|
-
def
|
|
15
|
-
Dir.glob(File.join(ports_root_path, "
|
|
12
|
+
def ports_bin_and_lib_paths
|
|
13
|
+
Dir.glob(File.join(ports_root_path, "#{gem_platform.cpu}-#{gem_platform.os}*", "{bin,lib}"))
|
|
16
14
|
end
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def gem_platform
|
|
19
|
+
::Gem::Platform.local
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
end
|
data/lib/tiny_tds.rb
CHANGED
|
@@ -10,8 +10,7 @@ require "tiny_tds/gem"
|
|
|
10
10
|
module TinyTds
|
|
11
11
|
# Is this file part of a fat binary gem with bundled freetds?
|
|
12
12
|
# This path must be enabled by add_dll_directory on Windows.
|
|
13
|
-
|
|
14
|
-
FREETDS_LIB_PATH = Dir[File.expand_path("../ports/#{gplat.cpu}-#{gplat.os}*/{bin,lib}", __dir__)].first
|
|
13
|
+
FREETDS_LIB_PATH = TinyTds::Gem.ports_bin_and_lib_paths.first
|
|
15
14
|
|
|
16
15
|
add_dll_path = proc do |path, &block|
|
|
17
16
|
if RUBY_PLATFORM =~ /(mswin|mingw)/i && path
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/tasks/native_gem.rake
CHANGED
|
@@ -7,7 +7,7 @@ CrossLibraries.each do |xlib|
|
|
|
7
7
|
|
|
8
8
|
RakeCompilerDock.sh <<-EOT, platform: platform
|
|
9
9
|
bundle install &&
|
|
10
|
-
rake native:#{platform} pkg/#{SPEC.full_name}-#{platform}.gem MAKEOPTS=-j`nproc` RUBY_CC_VERSION=#{RakeCompilerDock.set_ruby_cc_version("~>
|
|
10
|
+
rake native:#{platform} pkg/#{SPEC.full_name}-#{platform}.gem MAKEOPTS=-j`nproc` RUBY_CC_VERSION=#{RakeCompilerDock.set_ruby_cc_version("~> 3.0", "~> 4.0")} MAKEFLAGS="V=1"
|
|
11
11
|
EOT
|
|
12
12
|
end
|
|
13
13
|
|
|
@@ -4,7 +4,13 @@ $gemToUnpack = "./tiny_tds-$gemVersion-$env:RUBY_ARCHITECTURE.gem"
|
|
|
4
4
|
Write-Host "Looking to unpack $gemToUnpack"
|
|
5
5
|
gem unpack --target ./tmp "$gemToUnpack"
|
|
6
6
|
|
|
7
|
-
# Restore precompiled code
|
|
7
|
+
# Restore precompiled code (Gem code)
|
|
8
8
|
$source = (Resolve-Path ".\tmp\tiny_tds-$gemVersion-$env:RUBY_ARCHITECTURE\lib\tiny_tds").Path
|
|
9
9
|
$destination = (Resolve-Path ".\lib\tiny_tds").Path
|
|
10
10
|
Get-ChildItem $source -Recurse -Exclude "*.rb" | Copy-Item -Destination {Join-Path $destination $_.FullName.Substring($source.length)}
|
|
11
|
+
|
|
12
|
+
# Restore precompiled code (ports)
|
|
13
|
+
$source = (Resolve-Path ".\tmp\tiny_tds-$gemVersion-$env:RUBY_ARCHITECTURE\ports").Path
|
|
14
|
+
New-Item -ItemType Directory -Path ".\ports" -Force
|
|
15
|
+
$destination = (Resolve-Path ".\ports").Path
|
|
16
|
+
Get-ChildItem $source -Recurse -Exclude "*.rb" | Copy-Item -Destination {Join-Path $destination $_.FullName.Substring($source.length)}
|
data/test/gem_test.rb
CHANGED
|
@@ -7,11 +7,9 @@ class GemTest < Minitest::Spec
|
|
|
7
7
|
describe TinyTds::Gem do
|
|
8
8
|
# We're going to muck with some system globals so lets make sure
|
|
9
9
|
# they get set back later
|
|
10
|
-
original_platform = RbConfig::CONFIG["arch"]
|
|
11
10
|
original_pwd = Dir.pwd
|
|
12
11
|
|
|
13
12
|
after do
|
|
14
|
-
RbConfig::CONFIG["arch"] = original_platform
|
|
15
13
|
Dir.chdir original_pwd
|
|
16
14
|
end
|
|
17
15
|
|
|
@@ -43,56 +41,53 @@ class GemTest < Minitest::Spec
|
|
|
43
41
|
end
|
|
44
42
|
end
|
|
45
43
|
|
|
46
|
-
describe "#
|
|
47
|
-
let(:
|
|
44
|
+
describe "#ports_bin_and_lib_paths" do
|
|
45
|
+
let(:ports_bin_and_lib_paths) { TinyTds::Gem.ports_bin_and_lib_paths }
|
|
48
46
|
|
|
49
47
|
describe "when the ports directories exist" do
|
|
50
|
-
let(:
|
|
51
|
-
ports_host_root = File.join(gem_root, "ports", "
|
|
52
|
-
[
|
|
53
|
-
File.join("a", "bin"),
|
|
54
|
-
File.join("a", "inner", "bin"),
|
|
55
|
-
File.join("b", "bin")
|
|
56
|
-
].map do |p|
|
|
48
|
+
let(:fake_bin_and_lib_path) do
|
|
49
|
+
ports_host_root = File.join(gem_root, "ports", "x86_64-unknown")
|
|
50
|
+
["bin", "lib"].map do |p|
|
|
57
51
|
File.join(ports_host_root, p)
|
|
58
52
|
end
|
|
59
53
|
end
|
|
60
54
|
|
|
61
55
|
before do
|
|
62
|
-
|
|
63
|
-
fake_bin_paths.each do |path|
|
|
56
|
+
fake_bin_and_lib_path.each do |path|
|
|
64
57
|
FileUtils.mkdir_p(path)
|
|
65
58
|
end
|
|
66
59
|
end
|
|
67
60
|
|
|
68
61
|
after do
|
|
69
62
|
FileUtils.remove_entry_secure(
|
|
70
|
-
File.join(gem_root, "ports", "
|
|
63
|
+
File.join(gem_root, "ports", "x86_64-unknown"), true
|
|
71
64
|
)
|
|
72
65
|
end
|
|
73
66
|
|
|
74
67
|
it "should return all the bin directories" do
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
fake_platform = Gem::Platform.new("x86_64-unknown")
|
|
69
|
+
|
|
70
|
+
Gem::Platform.stub(:local, fake_platform) do
|
|
71
|
+
_(ports_bin_and_lib_paths.sort).must_equal fake_bin_and_lib_path.sort
|
|
77
72
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
# should return the same regardless of path
|
|
74
|
+
Dir.chdir "/"
|
|
75
|
+
_(ports_bin_and_lib_paths.sort).must_equal fake_bin_and_lib_path.sort
|
|
76
|
+
end
|
|
81
77
|
end
|
|
82
78
|
end
|
|
83
79
|
|
|
84
80
|
describe "when the ports directories are missing" do
|
|
85
|
-
before do
|
|
86
|
-
RbConfig::CONFIG["arch"] = "fake-host-without-dirs"
|
|
87
|
-
end
|
|
88
|
-
|
|
89
81
|
it "should return no directories" do
|
|
90
|
-
|
|
91
|
-
end
|
|
82
|
+
fake_platform = Gem::Platform.new("x86_64-unknown")
|
|
92
83
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
84
|
+
Gem::Platform.stub(:local, fake_platform) do
|
|
85
|
+
_(ports_bin_and_lib_paths).must_be_empty
|
|
86
|
+
|
|
87
|
+
# should be empty regardless of path
|
|
88
|
+
Dir.chdir "/"
|
|
89
|
+
_(ports_bin_and_lib_paths).must_be_empty
|
|
90
|
+
end
|
|
96
91
|
end
|
|
97
92
|
end
|
|
98
93
|
end
|
data/test/thread_test.rb
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
require "test_helper"
|
|
2
|
-
require "logger"
|
|
3
2
|
require "benchmark"
|
|
4
3
|
|
|
5
4
|
class ThreadTest < TinyTds::TestCase
|
|
6
5
|
describe "Threaded SELECT queries" do
|
|
7
6
|
before do
|
|
8
|
-
@logger = Logger.new $stdout
|
|
9
|
-
@logger.level = Logger::WARN
|
|
10
7
|
@poolsize = 4
|
|
11
8
|
@numthreads = 10
|
|
12
9
|
@query = "waitfor delay '00:00:01'"
|
|
@@ -22,19 +19,14 @@ class ThreadTest < TinyTds::TestCase
|
|
|
22
19
|
x = Benchmark.realtime do
|
|
23
20
|
threads = []
|
|
24
21
|
@numthreads.times do |i|
|
|
25
|
-
start = Time.new
|
|
26
22
|
threads << Thread.new do
|
|
27
|
-
ts = Time.new
|
|
28
23
|
@pool.with { |c| c.execute(@query).do }
|
|
29
|
-
te = Time.new
|
|
30
|
-
@logger.info "Thread #{i} finished in #{te - ts} thread seconds, #{te - start} real seconds"
|
|
31
24
|
end
|
|
32
25
|
end
|
|
33
26
|
threads.each { |t| t.join }
|
|
34
27
|
end
|
|
35
28
|
assert x < @numthreads, "#{x} is not faster than #{@numthreads} seconds"
|
|
36
29
|
mintime = (1.0 * @numthreads / @poolsize).ceil
|
|
37
|
-
@logger.info "#{@numthreads} queries on #{@poolsize} threads: #{x} sec. Minimum time: #{mintime} sec."
|
|
38
30
|
assert x > mintime, "#{x} is not slower than #{mintime} seconds"
|
|
39
31
|
end
|
|
40
32
|
|
|
@@ -65,7 +57,7 @@ class ThreadTest < TinyTds::TestCase
|
|
|
65
57
|
result = client.execute "waitfor delay '00:00:#{delay}'; select db_name()"
|
|
66
58
|
result.each { |r| puts r }
|
|
67
59
|
rescue TinyTds::Error => e
|
|
68
|
-
if e.message
|
|
60
|
+
if e.message.include?("connection timed out")
|
|
69
61
|
exception = true
|
|
70
62
|
end
|
|
71
63
|
end
|
data/tiny_tds.gemspec
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
$LOAD_PATH.push File.expand_path("../lib", __FILE__)
|
|
2
|
-
|
|
2
|
+
version = File.read(File.expand_path("VERSION", __dir__)).strip
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "tiny_tds"
|
|
6
|
-
s.version =
|
|
6
|
+
s.version = version
|
|
7
7
|
s.platform = Gem::Platform::RUBY
|
|
8
8
|
s.authors = ["Ken Collins", "Erik Bryn", "Will Bond"]
|
|
9
9
|
s.email = ["ken@metaskills.net", "will@wbond.net"]
|
|
@@ -18,14 +18,17 @@ Gem::Specification.new do |s|
|
|
|
18
18
|
s.license = "MIT"
|
|
19
19
|
s.required_ruby_version = ">= 2.7.0"
|
|
20
20
|
s.metadata["msys2_mingw_dependencies"] = "freetds"
|
|
21
|
-
s.add_dependency "bigdecimal", "
|
|
21
|
+
s.add_dependency "bigdecimal", ">= 2.0.0"
|
|
22
22
|
s.add_development_dependency "mini_portile2", "~> 2.8.0"
|
|
23
|
-
s.add_development_dependency "rake", "~> 13.
|
|
23
|
+
s.add_development_dependency "rake", "~> 13.2.0"
|
|
24
24
|
s.add_development_dependency "rake-compiler", "~> 1.2"
|
|
25
|
-
s.add_development_dependency "rake-compiler-dock", "~> 1.
|
|
25
|
+
s.add_development_dependency "rake-compiler-dock", "~> 1.11.0"
|
|
26
26
|
s.add_development_dependency "minitest", "~> 5.25"
|
|
27
27
|
s.add_development_dependency "minitest-reporters", "~> 1.6.1"
|
|
28
28
|
s.add_development_dependency "connection_pool", "~> 2.2.0"
|
|
29
29
|
s.add_development_dependency "toxiproxy", "~> 2.0.0"
|
|
30
30
|
s.add_development_dependency "standard", "~> 1.31.0"
|
|
31
|
+
# ostruct can be dropped when updating to Rubocop 1.65+
|
|
32
|
+
s.add_development_dependency "ostruct"
|
|
33
|
+
s.add_development_dependency "benchmark"
|
|
31
34
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tiny_tds
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.4.0
|
|
5
5
|
platform: x64-mingw-ucrt
|
|
6
6
|
authors:
|
|
7
7
|
- Ken Collins
|
|
@@ -9,22 +9,22 @@ authors:
|
|
|
9
9
|
- Will Bond
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: bigdecimal
|
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
|
17
17
|
requirements:
|
|
18
|
-
- - "
|
|
18
|
+
- - ">="
|
|
19
19
|
- !ruby/object:Gem::Version
|
|
20
|
-
version:
|
|
20
|
+
version: 2.0.0
|
|
21
21
|
type: :runtime
|
|
22
22
|
prerelease: false
|
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
|
24
24
|
requirements:
|
|
25
|
-
- - "
|
|
25
|
+
- - ">="
|
|
26
26
|
- !ruby/object:Gem::Version
|
|
27
|
-
version:
|
|
27
|
+
version: 2.0.0
|
|
28
28
|
- !ruby/object:Gem::Dependency
|
|
29
29
|
name: mini_portile2
|
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -45,14 +45,14 @@ dependencies:
|
|
|
45
45
|
requirements:
|
|
46
46
|
- - "~>"
|
|
47
47
|
- !ruby/object:Gem::Version
|
|
48
|
-
version: 13.
|
|
48
|
+
version: 13.2.0
|
|
49
49
|
type: :development
|
|
50
50
|
prerelease: false
|
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
|
52
52
|
requirements:
|
|
53
53
|
- - "~>"
|
|
54
54
|
- !ruby/object:Gem::Version
|
|
55
|
-
version: 13.
|
|
55
|
+
version: 13.2.0
|
|
56
56
|
- !ruby/object:Gem::Dependency
|
|
57
57
|
name: rake-compiler
|
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -73,14 +73,14 @@ dependencies:
|
|
|
73
73
|
requirements:
|
|
74
74
|
- - "~>"
|
|
75
75
|
- !ruby/object:Gem::Version
|
|
76
|
-
version: 1.
|
|
76
|
+
version: 1.11.0
|
|
77
77
|
type: :development
|
|
78
78
|
prerelease: false
|
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
|
80
80
|
requirements:
|
|
81
81
|
- - "~>"
|
|
82
82
|
- !ruby/object:Gem::Version
|
|
83
|
-
version: 1.
|
|
83
|
+
version: 1.11.0
|
|
84
84
|
- !ruby/object:Gem::Dependency
|
|
85
85
|
name: minitest
|
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -151,6 +151,34 @@ dependencies:
|
|
|
151
151
|
- - "~>"
|
|
152
152
|
- !ruby/object:Gem::Version
|
|
153
153
|
version: 1.31.0
|
|
154
|
+
- !ruby/object:Gem::Dependency
|
|
155
|
+
name: ostruct
|
|
156
|
+
requirement: !ruby/object:Gem::Requirement
|
|
157
|
+
requirements:
|
|
158
|
+
- - ">="
|
|
159
|
+
- !ruby/object:Gem::Version
|
|
160
|
+
version: '0'
|
|
161
|
+
type: :development
|
|
162
|
+
prerelease: false
|
|
163
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
164
|
+
requirements:
|
|
165
|
+
- - ">="
|
|
166
|
+
- !ruby/object:Gem::Version
|
|
167
|
+
version: '0'
|
|
168
|
+
- !ruby/object:Gem::Dependency
|
|
169
|
+
name: benchmark
|
|
170
|
+
requirement: !ruby/object:Gem::Requirement
|
|
171
|
+
requirements:
|
|
172
|
+
- - ">="
|
|
173
|
+
- !ruby/object:Gem::Version
|
|
174
|
+
version: '0'
|
|
175
|
+
type: :development
|
|
176
|
+
prerelease: false
|
|
177
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
178
|
+
requirements:
|
|
179
|
+
- - ">="
|
|
180
|
+
- !ruby/object:Gem::Version
|
|
181
|
+
version: '0'
|
|
154
182
|
description: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.
|
|
155
183
|
Developed for the ActiveRecord SQL Server adapter.
|
|
156
184
|
email:
|
|
@@ -163,6 +191,10 @@ extensions: []
|
|
|
163
191
|
extra_rdoc_files: []
|
|
164
192
|
files:
|
|
165
193
|
- ".codeclimate.yml"
|
|
194
|
+
- ".devcontainer/Dockerfile"
|
|
195
|
+
- ".devcontainer/boot.sh"
|
|
196
|
+
- ".devcontainer/compose.yaml"
|
|
197
|
+
- ".devcontainer/devcontainer.json"
|
|
166
198
|
- ".gitattributes"
|
|
167
199
|
- ".github/workflows/ci.yml"
|
|
168
200
|
- ".gitignore"
|
|
@@ -175,9 +207,9 @@ files:
|
|
|
175
207
|
- README.md
|
|
176
208
|
- Rakefile
|
|
177
209
|
- VERSION
|
|
210
|
+
- astyle.conf
|
|
178
211
|
- bin/defncopy-ttds
|
|
179
212
|
- bin/tsql-ttds
|
|
180
|
-
- docker-compose.yml
|
|
181
213
|
- exe/.keep
|
|
182
214
|
- ext/tiny_tds/client.c
|
|
183
215
|
- ext/tiny_tds/client.h
|
|
@@ -192,6 +224,7 @@ files:
|
|
|
192
224
|
- lib/tiny_tds/3.2/tiny_tds.so
|
|
193
225
|
- lib/tiny_tds/3.3/tiny_tds.so
|
|
194
226
|
- lib/tiny_tds/3.4/tiny_tds.so
|
|
227
|
+
- lib/tiny_tds/4.0/tiny_tds.so
|
|
195
228
|
- lib/tiny_tds/bin.rb
|
|
196
229
|
- lib/tiny_tds/client.rb
|
|
197
230
|
- lib/tiny_tds/error.rb
|
|
@@ -204,19 +237,12 @@ files:
|
|
|
204
237
|
- ports/x64-mingw-ucrt/bin/defncopy.exe
|
|
205
238
|
- ports/x64-mingw-ucrt/bin/libsybdb-5.dll
|
|
206
239
|
- ports/x64-mingw-ucrt/bin/tsql.exe
|
|
207
|
-
- setup_cimgruby_dev.sh
|
|
208
|
-
- start_dev.sh
|
|
209
240
|
- tasks/native_gem.rake
|
|
210
241
|
- tasks/package.rake
|
|
211
242
|
- tasks/ports.rake
|
|
212
243
|
- tasks/test.rake
|
|
213
244
|
- test/bin/install-freetds.sh
|
|
214
|
-
- test/bin/install-mssql.ps1
|
|
215
|
-
- test/bin/install-mssqltools.sh
|
|
216
|
-
- test/bin/install-openssl.sh
|
|
217
245
|
- test/bin/restore-from-native-gem.ps1
|
|
218
|
-
- test/bin/setup_tinytds_db.sh
|
|
219
|
-
- test/bin/setup_volume_permissions.sh
|
|
220
246
|
- test/client_test.rb
|
|
221
247
|
- test/gem_test.rb
|
|
222
248
|
- test/result_test.rb
|
|
@@ -244,14 +270,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
244
270
|
version: '3.1'
|
|
245
271
|
- - "<"
|
|
246
272
|
- !ruby/object:Gem::Version
|
|
247
|
-
version:
|
|
273
|
+
version: 4.1.dev
|
|
248
274
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
249
275
|
requirements:
|
|
250
276
|
- - ">="
|
|
251
277
|
- !ruby/object:Gem::Version
|
|
252
278
|
version: '0'
|
|
253
279
|
requirements: []
|
|
254
|
-
rubygems_version:
|
|
280
|
+
rubygems_version: 4.0.3
|
|
255
281
|
specification_version: 4
|
|
256
282
|
summary: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.
|
|
257
283
|
test_files: []
|
data/docker-compose.yml
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
version: '3'
|
|
2
|
-
|
|
3
|
-
networks:
|
|
4
|
-
main-network:
|
|
5
|
-
|
|
6
|
-
services:
|
|
7
|
-
mssql:
|
|
8
|
-
image: mcr.microsoft.com/mssql/server:${MSSQL_VERSION:-2017}-latest
|
|
9
|
-
container_name: sqlserver
|
|
10
|
-
environment:
|
|
11
|
-
ACCEPT_EULA: Y
|
|
12
|
-
MSSQL_SA_PASSWORD: super01S3cUr3
|
|
13
|
-
ports:
|
|
14
|
-
- "1433:1433"
|
|
15
|
-
network_mode: "host"
|
|
16
|
-
|
|
17
|
-
toxiproxy:
|
|
18
|
-
image: shopify/toxiproxy
|
|
19
|
-
container_name: toxiproxy
|
|
20
|
-
command: '/toxiproxy -host=127.0.0.1'
|
|
21
|
-
network_mode: "host"
|
|
22
|
-
|
|
23
|
-
cimgruby:
|
|
24
|
-
image: "cimg/ruby:${RUBY_VERSION:-2.7}"
|
|
25
|
-
container_name: cimg_ruby
|
|
26
|
-
environment:
|
|
27
|
-
TESTOPTS: '-v'
|
|
28
|
-
TINYTDS_UNIT_HOST: '127.0.0.1'
|
|
29
|
-
SA_PASSWORD: super01S3cUr3
|
|
30
|
-
TOXIPROXY_HOST: '127.0.0.1'
|
|
31
|
-
command: tail -F anything
|
|
32
|
-
volumes:
|
|
33
|
-
- .:/home/circleci/project
|
|
34
|
-
network_mode: "host"
|
data/setup_cimgruby_dev.sh
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -x
|
|
4
|
-
set -e
|
|
5
|
-
|
|
6
|
-
# this should mirror the steps outlined in the circleci yml
|
|
7
|
-
echo "Installing mssql-tools..."
|
|
8
|
-
sleep 5
|
|
9
|
-
sudo -E ./test/bin/install-mssqltools.sh
|
|
10
|
-
|
|
11
|
-
echo "Configurating tinytds test database..."
|
|
12
|
-
sleep 5
|
|
13
|
-
./test/bin/setup_tinytds_db.sh
|
|
14
|
-
|
|
15
|
-
echo "Building openssl library..."
|
|
16
|
-
sleep 5
|
|
17
|
-
sudo -E ./test/bin/install-openssl.sh
|
|
18
|
-
|
|
19
|
-
echo "Building freetds library..."
|
|
20
|
-
sleep 5
|
|
21
|
-
sudo -E ./test/bin/install-freetds.sh
|
|
22
|
-
|
|
23
|
-
echo "Installing gems..."
|
|
24
|
-
sleep 5
|
|
25
|
-
bundle install
|
data/start_dev.sh
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -x
|
|
4
|
-
set -e
|
|
5
|
-
|
|
6
|
-
# set volume read/write permissions to work both outside and inside container
|
|
7
|
-
sudo ./test/bin/setup_volume_permissions.sh
|
|
8
|
-
|
|
9
|
-
docker-compose up -d
|
|
10
|
-
echo "Waiting for containers to start..."
|
|
11
|
-
sleep 10
|
|
12
|
-
|
|
13
|
-
# setup circleci ruby container for development
|
|
14
|
-
docker exec cimg_ruby bash -c './setup_cimgruby_dev.sh'
|
|
15
|
-
|
|
16
|
-
# enter container
|
|
17
|
-
set +x
|
|
18
|
-
echo "cimg/ruby container is ready for tiny_tds development.........."
|
|
19
|
-
echo "To enter container run: docker exec -it cimg_ruby /bin/bash"
|
|
20
|
-
echo "To build solution run: docker exec cimg_ruby bash -c 'bundle exec rake build'"
|
|
21
|
-
echo "To test solution run: docker exec cimg_ruby bash -c 'bundle exec rake test'"
|
data/test/bin/install-mssql.ps1
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
param ([int] $Version)
|
|
2
|
-
|
|
3
|
-
$ProgressPreference = 'SilentlyContinue'
|
|
4
|
-
|
|
5
|
-
$DownloadLinkTable = @{
|
|
6
|
-
2017 = "https://go.microsoft.com/fwlink/?linkid=829176";
|
|
7
|
-
2019 = "https://download.microsoft.com/download/7/c/1/7c14e92e-bdcb-4f89-b7cf-93543e7112d1/SQLEXPR_x64_ENU.exe";
|
|
8
|
-
2022 = "https://download.microsoft.com/download/3/8/d/38de7036-2433-4207-8eae-06e247e17b25/SQLEXPR_x64_ENU.exe";
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
$MajorVersionTable = @{
|
|
12
|
-
2017 = 14;
|
|
13
|
-
2019 = 15;
|
|
14
|
-
2022 = 16;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (-not(Test-path "C:\Downloads")) {
|
|
18
|
-
mkdir "C:\Downloads"
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
$sqlInstallationFile = "C:\Downloads\sqlexpress.exe"
|
|
22
|
-
if (-not(Test-path $sqlInstallationFile -PathType leaf)) {
|
|
23
|
-
Write-Host "Downloading SQL Express ..."
|
|
24
|
-
Invoke-WebRequest -Uri $DownloadLinkTable[$Version] -OutFile "C:\Downloads\sqlexpress.exe"
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
Write-Host "Installing SQL Express ..."
|
|
28
|
-
Start-Process -Wait -FilePath "C:\Downloads\sqlexpress.exe" -ArgumentList /qs, /x:"C:\Downloads\setup"
|
|
29
|
-
C:\Downloads\setup\setup.exe /q /ACTION=Install /INSTANCENAME=SQLEXPRESS /FEATURES=SQLEngine /UPDATEENABLED=0 /SQLSVCACCOUNT='NT AUTHORITY\System' /SQLSYSADMINACCOUNTS='BUILTIN\ADMINISTRATORS' /TCPENABLED=1 /NPENABLED=0 /IACCEPTSQLSERVERLICENSETERMS
|
|
30
|
-
|
|
31
|
-
Write-Host "Configuring SQL Express ..."
|
|
32
|
-
stop-service MSSQL`$SQLEXPRESS
|
|
33
|
-
set-itemproperty -path "HKLM:\software\microsoft\microsoft sql server\mssql$($MajorVersionTable[$Version]).SQLEXPRESS\mssqlserver\supersocketnetlib\tcp\ipall" -name tcpdynamicports -value ''
|
|
34
|
-
set-itemproperty -path "HKLM:\software\microsoft\microsoft sql server\mssql$($MajorVersionTable[$Version]).SQLEXPRESS\mssqlserver\supersocketnetlib\tcp\ipall" -name tcpport -value 1433
|
|
35
|
-
set-itemproperty -path "HKLM:\software\microsoft\microsoft sql server\mssql$($MajorVersionTable[$Version]).SQLEXPRESS\mssqlserver\" -name LoginMode -value 2
|
|
36
|
-
|
|
37
|
-
Write-Host "Starting SQL Express ..."
|
|
38
|
-
start-service MSSQL`$SQLEXPRESS
|
|
39
|
-
|
|
40
|
-
Write-Host "Configuring MSSQL for TinyTDS ..."
|
|
41
|
-
& sqlcmd -i './test/sql/db-create.sql'
|
|
42
|
-
& sqlcmd -i './test/sql/db-login.sql'
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -x
|
|
4
|
-
set -e
|
|
5
|
-
|
|
6
|
-
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
|
|
7
|
-
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | sudo tee /etc/apt/sources.list.d/msprod.list
|
|
8
|
-
sudo apt-get update
|
|
9
|
-
sudo ACCEPT_EULA=Y apt-get -y install mssql-tools unixodbc-dev
|
data/test/bin/install-openssl.sh
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -x
|
|
4
|
-
set -e
|
|
5
|
-
|
|
6
|
-
if [ -z "$OPENSSL_VERSION" ]; then
|
|
7
|
-
OPENSSL_VERSION=$(ruby -r "./ext/tiny_tds/extconsts.rb" -e "puts OPENSSL_VERSION")
|
|
8
|
-
fi
|
|
9
|
-
|
|
10
|
-
wget https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
|
|
11
|
-
tar -xzf openssl-$OPENSSL_VERSION.tar.gz
|
|
12
|
-
cd openssl-$OPENSSL_VERSION
|
|
13
|
-
./config --prefix=/opt/local --openssldir=/opt/local
|
|
14
|
-
make
|
|
15
|
-
make install_sw install_ssldirs
|
|
16
|
-
cd ..
|
|
17
|
-
rm -rf openssl-$OPENSSL_VERSION
|
|
18
|
-
rm openssl-$OPENSSL_VERSION.tar.gz
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
set -x
|
|
4
|
-
|
|
5
|
-
sudo groupadd -g 3434 circleci_tinytds
|
|
6
|
-
sudo usermod -a -G circleci_tinytds $USER
|
|
7
|
-
sudo useradd circleci_tinytds -u 3434 -g 3434
|
|
8
|
-
sudo usermod -a -G circleci_tinytds circleci_tinytds
|
|
9
|
-
sudo chgrp -R circleci_tinytds .
|
|
10
|
-
sudo chmod -R g+rwx .
|