tiny_tds 3.2.1-x86_64-linux-gnu → 3.4.0-x86_64-linux-gnu

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.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer/Dockerfile +21 -0
  3. data/.devcontainer/boot.sh +6 -0
  4. data/.devcontainer/compose.yaml +40 -0
  5. data/.devcontainer/devcontainer.json +30 -0
  6. data/.github/workflows/ci.yml +24 -9
  7. data/CHANGELOG.md +15 -0
  8. data/README.md +17 -33
  9. data/Rakefile +5 -0
  10. data/VERSION +1 -1
  11. data/astyle.conf +8 -0
  12. data/ext/tiny_tds/client.c +163 -64
  13. data/ext/tiny_tds/extconsts.rb +2 -2
  14. data/ext/tiny_tds/result.c +171 -42
  15. data/ext/tiny_tds/result.h +2 -2
  16. data/ext/tiny_tds/tiny_tds_ext.c +2 -1
  17. data/lib/tiny_tds/3.0/tiny_tds.so +0 -0
  18. data/lib/tiny_tds/3.1/tiny_tds.so +0 -0
  19. data/lib/tiny_tds/3.2/tiny_tds.so +0 -0
  20. data/lib/tiny_tds/3.3/tiny_tds.so +0 -0
  21. data/lib/tiny_tds/3.4/tiny_tds.so +0 -0
  22. data/lib/tiny_tds/4.0/tiny_tds.so +0 -0
  23. data/lib/tiny_tds/bin.rb +2 -2
  24. data/lib/tiny_tds/gem.rb +6 -6
  25. data/lib/tiny_tds.rb +1 -2
  26. data/ports/x86_64-linux-gnu/bin/defncopy +0 -0
  27. data/ports/x86_64-linux-gnu/bin/tsql +0 -0
  28. data/ports/x86_64-linux-gnu/lib/libsybdb.so.5 +0 -0
  29. data/tasks/native_gem.rake +1 -1
  30. data/test/bin/restore-from-native-gem.ps1 +7 -1
  31. data/test/gem_test.rb +23 -28
  32. data/test/thread_test.rb +1 -9
  33. data/tiny_tds.gemspec +8 -5
  34. metadata +47 -22
  35. data/docker-compose.yml +0 -34
  36. data/lib/tiny_tds/2.7/tiny_tds.so +0 -0
  37. data/setup_cimgruby_dev.sh +0 -25
  38. data/start_dev.sh +0 -21
  39. data/test/bin/install-mssql.ps1 +0 -42
  40. data/test/bin/install-mssqltools.sh +0 -9
  41. data/test/bin/install-openssl.sh +0 -18
  42. data/test/bin/setup_tinytds_db.sh +0 -7
  43. 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.ports_bin_paths,
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.ports_bin_paths.each do |bin|
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 ports_bin_paths
15
- Dir.glob(File.join(ports_root_path, "**", "bin"))
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
- def ports_lib_paths
19
- Dir.glob(File.join(ports_root_path, "**", "lib"))
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
- gplat = ::Gem::Platform.local
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
@@ -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("~> 2.7", "~> 3.0")} MAKEFLAGS="V=1"
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 "#ports_bin_paths" do
47
- let(:ports_bin_paths) { TinyTds::Gem.ports_bin_paths }
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(:fake_bin_paths) do
51
- ports_host_root = File.join(gem_root, "ports", "fake-host-with-dirs")
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
- RbConfig::CONFIG["arch"] = "fake-host-with-dirs"
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", "fake-host-with-dirs"), true
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
- _(ports_bin_paths.sort).must_equal fake_bin_paths.sort
76
- end
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
- it "should return all the bin directories regardless of cwd" do
79
- Dir.chdir "/"
80
- _(ports_bin_paths.sort).must_equal fake_bin_paths.sort
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
- _(ports_bin_paths).must_be_empty
91
- end
82
+ fake_platform = Gem::Platform.new("x86_64-unknown")
92
83
 
93
- it "should return no directories regardless of cwd" do
94
- Dir.chdir "/"
95
- _(ports_bin_paths).must_be_empty
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 == "Adaptive Server connection timed out"
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
- require "tiny_tds/version"
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 = TinyTds::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", "~> 3"
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.0.0"
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.9.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.2.1
4
+ version: 3.4.0
5
5
  platform: x86_64-linux-gnu
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: 2025-04-10 00:00:00.000000000 Z
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: '3'
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: '3'
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.0.0
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.0.0
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.9.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.9.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
@@ -188,12 +220,12 @@ files:
188
220
  - ext/tiny_tds/tiny_tds_ext.c
189
221
  - ext/tiny_tds/tiny_tds_ext.h
190
222
  - lib/tiny_tds.rb
191
- - lib/tiny_tds/2.7/tiny_tds.so
192
223
  - lib/tiny_tds/3.0/tiny_tds.so
193
224
  - lib/tiny_tds/3.1/tiny_tds.so
194
225
  - lib/tiny_tds/3.2/tiny_tds.so
195
226
  - lib/tiny_tds/3.3/tiny_tds.so
196
227
  - lib/tiny_tds/3.4/tiny_tds.so
228
+ - lib/tiny_tds/4.0/tiny_tds.so
197
229
  - lib/tiny_tds/bin.rb
198
230
  - lib/tiny_tds/client.rb
199
231
  - lib/tiny_tds/error.rb
@@ -206,19 +238,12 @@ files:
206
238
  - ports/x86_64-linux-gnu/bin/defncopy
207
239
  - ports/x86_64-linux-gnu/bin/tsql
208
240
  - ports/x86_64-linux-gnu/lib/libsybdb.so.5
209
- - setup_cimgruby_dev.sh
210
- - start_dev.sh
211
241
  - tasks/native_gem.rake
212
242
  - tasks/package.rake
213
243
  - tasks/ports.rake
214
244
  - tasks/test.rake
215
245
  - test/bin/install-freetds.sh
216
- - test/bin/install-mssql.ps1
217
- - test/bin/install-mssqltools.sh
218
- - test/bin/install-openssl.sh
219
246
  - test/bin/restore-from-native-gem.ps1
220
- - test/bin/setup_tinytds_db.sh
221
- - test/bin/setup_volume_permissions.sh
222
247
  - test/client_test.rb
223
248
  - test/gem_test.rb
224
249
  - test/result_test.rb
@@ -243,17 +268,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
243
268
  requirements:
244
269
  - - ">="
245
270
  - !ruby/object:Gem::Version
246
- version: '2.7'
271
+ version: '3.0'
247
272
  - - "<"
248
273
  - !ruby/object:Gem::Version
249
- version: 3.5.dev
274
+ version: 4.1.dev
250
275
  required_rubygems_version: !ruby/object:Gem::Requirement
251
276
  requirements:
252
277
  - - ">="
253
278
  - !ruby/object:Gem::Version
254
279
  version: 3.3.22
255
280
  requirements: []
256
- rubygems_version: 3.6.2
281
+ rubygems_version: 4.0.3
257
282
  specification_version: 4
258
283
  summary: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.
259
284
  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"
Binary file
@@ -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'"
@@ -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
@@ -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,7 +0,0 @@
1
- #!/usr/bin/env bash
2
-
3
- set -x
4
- set -e
5
-
6
- /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -i ./test/sql/db-create.sql
7
- /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -i ./test/sql/db-login.sql
@@ -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 .