tiny_tds 2.1.2 → 3.0.0
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 +5 -5
- data/.github/workflows/ci.yml +470 -0
- data/.gitignore +2 -0
- data/CHANGELOG.md +39 -1
- data/Gemfile +0 -7
- data/ISSUE_TEMPLATE.md +1 -1
- data/README.md +50 -59
- data/Rakefile +15 -10
- data/VERSION +1 -1
- data/docker-compose.yml +34 -0
- data/ext/tiny_tds/client.c +100 -59
- data/ext/tiny_tds/client.h +5 -3
- data/ext/tiny_tds/extconf.rb +38 -16
- data/ext/tiny_tds/extconsts.rb +4 -10
- data/ext/tiny_tds/result.c +52 -45
- data/ext/tiny_tds/tiny_tds_ext.c +4 -1
- data/lib/tiny_tds/gem.rb +1 -6
- data/setup_cimgruby_dev.sh +25 -0
- data/start_dev.sh +21 -0
- data/tasks/native_gem.rake +15 -6
- data/tasks/ports/freetds.rb +1 -6
- data/tasks/ports/libiconv.rb +0 -17
- data/tasks/ports/openssl.rb +2 -18
- data/tasks/ports/recipe.rb +16 -4
- data/tasks/ports.rake +61 -40
- data/test/bin/install-mssql.ps1 +42 -0
- data/test/bin/install-mssqltools.sh +9 -0
- data/test/bin/setup_tinytds_db.sh +7 -0
- data/test/bin/setup_volume_permissions.sh +10 -0
- data/test/client_test.rb +101 -59
- data/test/gem_test.rb +25 -28
- data/test/result_test.rb +130 -182
- data/test/schema_test.rb +366 -388
- data/test/sql/db-create.sql +18 -0
- data/test/sql/db-login.sql +38 -0
- data/test/test_helper.rb +63 -31
- data/test/thread_test.rb +1 -1
- data/tiny_tds.gemspec +10 -7
- metadata +70 -52
- data/.travis.yml +0 -24
- data/BACKERS.md +0 -32
- data/appveyor.yml +0 -51
- data/test/appveyor/dbsetup.ps1 +0 -27
- data/test/appveyor/dbsetup.sql +0 -9
- data/test/bin/setup.sh +0 -19
- data/test/schema/sqlserver_2000.sql +0 -140
- data/test/schema/sqlserver_2005.sql +0 -140
- data/test/schema/sqlserver_2014.sql +0 -140
- data/test/schema/sqlserver_2016.sql +0 -140
- data/test/schema/sybase_ase.sql +0 -138
- /data/test/schema/{sqlserver_2008.sql → sqlserver_2017.sql} +0 -0
@@ -0,0 +1,18 @@
|
|
1
|
+
:ON ERROR EXIT
|
2
|
+
|
3
|
+
PRINT 'RUNNING DB-CREATE.SQL, CREATING TINYTDS TEST DATABASE';
|
4
|
+
IF NOT EXISTS(SELECT * FROM sys.databases WHERE name = 'tinytdstest')
|
5
|
+
BEGIN
|
6
|
+
CREATE DATABASE [tinytdstest];
|
7
|
+
END
|
8
|
+
GO
|
9
|
+
|
10
|
+
IF EXISTS (SELECT name FROM master.dbo.sysdatabases WHERE name LIKE 'tinytdstest')
|
11
|
+
BEGIN
|
12
|
+
PRINT 'TINY TDS TEST DB SUCCESSFULY CREATED';
|
13
|
+
END
|
14
|
+
ELSE
|
15
|
+
BEGIN
|
16
|
+
THROW 51000, 'TINY TDS TEST DB CREATION FAILED', 1;
|
17
|
+
END
|
18
|
+
GO
|
@@ -0,0 +1,38 @@
|
|
1
|
+
:ON ERROR EXIT
|
2
|
+
|
3
|
+
PRINT 'RUNNING DB-LOGIN.SQL';
|
4
|
+
|
5
|
+
PRINT 'CREATING TINYTDS TEST LOGIN';
|
6
|
+
IF NOT EXISTS (select name from sys.server_principals where name like 'tinytds')
|
7
|
+
BEGIN
|
8
|
+
CREATE LOGIN [tinytds] WITH PASSWORD = '', CHECK_POLICY = OFF, DEFAULT_DATABASE = [tinytdstest];
|
9
|
+
END
|
10
|
+
GO
|
11
|
+
|
12
|
+
IF EXISTS (select name from sys.server_principals where name like 'tinytds')
|
13
|
+
BEGIN
|
14
|
+
PRINT 'TINY TDS TEST LOGIN SUCCESSFULY CREATED';
|
15
|
+
END
|
16
|
+
ELSE
|
17
|
+
BEGIN
|
18
|
+
THROW 51000, 'TINY TDS TEST LOGIN CREATION FAILED', 1;
|
19
|
+
END
|
20
|
+
GO
|
21
|
+
|
22
|
+
USE [tinytdstest];
|
23
|
+
IF NOT EXISTS (select name from sys.database_principals where name LIKE 'tinytds')
|
24
|
+
BEGIN
|
25
|
+
CREATE USER [tinytds] FOR LOGIN [tinytds];
|
26
|
+
EXEC sp_addrolemember N'db_owner', N'tinytds';
|
27
|
+
END
|
28
|
+
GO
|
29
|
+
|
30
|
+
IF EXISTS (select name from sys.database_principals where name LIKE 'tinytds')
|
31
|
+
BEGIN
|
32
|
+
PRINT 'TINY TDS TEST USER SUCCESSFULY CREATED';
|
33
|
+
END
|
34
|
+
ELSE
|
35
|
+
BEGIN
|
36
|
+
THROW 51000, 'TINY TDS TEST USER CREATION FAILED', 1;
|
37
|
+
END
|
38
|
+
GO
|
data/test/test_helper.rb
CHANGED
@@ -2,8 +2,12 @@
|
|
2
2
|
require 'bundler' ; Bundler.require :development, :test
|
3
3
|
require 'tiny_tds'
|
4
4
|
require 'minitest/autorun'
|
5
|
+
require 'toxiproxy'
|
5
6
|
|
6
|
-
|
7
|
+
require "minitest/reporters"
|
8
|
+
Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new, Minitest::Reporters::JUnitReporter.new]
|
9
|
+
|
10
|
+
TINYTDS_SCHEMAS = ['sqlserver_2017', 'sqlserver_azure'].freeze
|
7
11
|
|
8
12
|
module TinyTds
|
9
13
|
class TestCase < MiniTest::Spec
|
@@ -11,7 +15,7 @@ module TinyTds
|
|
11
15
|
class << self
|
12
16
|
|
13
17
|
def current_schema
|
14
|
-
ENV['TINYTDS_SCHEMA'] || '
|
18
|
+
ENV['TINYTDS_SCHEMA'] || 'sqlserver_2017'
|
15
19
|
end
|
16
20
|
|
17
21
|
TINYTDS_SCHEMAS.each do |schema|
|
@@ -19,11 +23,6 @@ module TinyTds
|
|
19
23
|
schema == self.current_schema
|
20
24
|
end
|
21
25
|
end
|
22
|
-
|
23
|
-
def sqlserver?
|
24
|
-
current_schema =~ /sqlserver/
|
25
|
-
end
|
26
|
-
|
27
26
|
end
|
28
27
|
|
29
28
|
after { close_client }
|
@@ -40,20 +39,13 @@ module TinyTds
|
|
40
39
|
self.class.current_schema
|
41
40
|
end
|
42
41
|
|
43
|
-
def sqlserver?
|
44
|
-
self.class.sqlserver?
|
45
|
-
end
|
46
|
-
|
47
42
|
def close_client(client=@client)
|
48
43
|
client.close if defined?(client) && client.is_a?(TinyTds::Client)
|
49
44
|
end
|
50
45
|
|
51
46
|
def new_connection(options={})
|
52
47
|
client = TinyTds::Client.new(connection_options(options))
|
53
|
-
if
|
54
|
-
client.execute("SET ANSINULL ON").do
|
55
|
-
return client
|
56
|
-
elsif sqlserver_azure?
|
48
|
+
if sqlserver_azure?
|
57
49
|
client.execute('SET ANSI_NULLS ON').do
|
58
50
|
client.execute('SET CURSOR_CLOSE_ON_COMMIT OFF').do
|
59
51
|
client.execute('SET ANSI_NULL_DFLT_ON ON').do
|
@@ -93,7 +85,7 @@ module TinyTds
|
|
93
85
|
end
|
94
86
|
|
95
87
|
def assert_client_works(client)
|
96
|
-
client.execute("SELECT 'client_works' as [client_works]").each.must_equal [{'client_works' => 'client_works'}]
|
88
|
+
_(client.execute("SELECT 'client_works' as [client_works]").each).must_equal [{'client_works' => 'client_works'}]
|
97
89
|
end
|
98
90
|
|
99
91
|
def assert_new_connections_work
|
@@ -153,24 +145,13 @@ module TinyTds
|
|
153
145
|
loader.execute(drop_sql).do
|
154
146
|
loader.execute(schema_sql).do
|
155
147
|
loader.execute(sp_sql).do
|
148
|
+
loader.execute(sp_error_sql).do
|
149
|
+
loader.execute(sp_several_prints_sql).do
|
156
150
|
loader.close
|
157
151
|
true
|
158
152
|
end
|
159
153
|
|
160
154
|
def drop_sql
|
161
|
-
sybase_ase? ? drop_sql_sybase : drop_sql_microsoft
|
162
|
-
end
|
163
|
-
|
164
|
-
def drop_sql_sybase
|
165
|
-
%|IF EXISTS(
|
166
|
-
SELECT 1 FROM sysobjects WHERE type = 'U' AND name = 'datatypes'
|
167
|
-
) DROP TABLE datatypes
|
168
|
-
IF EXISTS(
|
169
|
-
SELECT 1 FROM sysobjects WHERE type = 'P' AND name = 'tinytds_TestReturnCodes'
|
170
|
-
) DROP PROCEDURE tinytds_TestReturnCodes|
|
171
|
-
end
|
172
|
-
|
173
|
-
def drop_sql_microsoft
|
174
155
|
%|IF EXISTS (
|
175
156
|
SELECT TABLE_NAME
|
176
157
|
FROM INFORMATION_SCHEMA.TABLES
|
@@ -181,7 +162,15 @@ module TinyTds
|
|
181
162
|
IF EXISTS (
|
182
163
|
SELECT name FROM sysobjects
|
183
164
|
WHERE name = 'tinytds_TestReturnCodes' AND type = 'P'
|
184
|
-
) DROP PROCEDURE tinytds_TestReturnCodes
|
165
|
+
) DROP PROCEDURE tinytds_TestReturnCodes
|
166
|
+
IF EXISTS (
|
167
|
+
SELECT name FROM sysobjects
|
168
|
+
WHERE name = 'tinytds_TestPrintWithError' AND type = 'P'
|
169
|
+
) DROP PROCEDURE tinytds_TestPrintWithError
|
170
|
+
IF EXISTS (
|
171
|
+
SELECT name FROM sysobjects
|
172
|
+
WHERE name = 'tinytds_TestSeveralPrints' AND type = 'P'
|
173
|
+
) DROP PROCEDURE tinytds_TestSeveralPrints|
|
185
174
|
end
|
186
175
|
|
187
176
|
def sp_sql
|
@@ -191,6 +180,21 @@ module TinyTds
|
|
191
180
|
RETURN(420) |
|
192
181
|
end
|
193
182
|
|
183
|
+
def sp_error_sql
|
184
|
+
%|CREATE PROCEDURE tinytds_TestPrintWithError
|
185
|
+
AS
|
186
|
+
PRINT 'hello'
|
187
|
+
RAISERROR('Error following print', 16, 1)|
|
188
|
+
end
|
189
|
+
|
190
|
+
def sp_several_prints_sql
|
191
|
+
%|CREATE PROCEDURE tinytds_TestSeveralPrints
|
192
|
+
AS
|
193
|
+
PRINT 'hello 1'
|
194
|
+
PRINT 'hello 2'
|
195
|
+
PRINT 'hello 3'|
|
196
|
+
end
|
197
|
+
|
194
198
|
def find_value(id, column, query_options={})
|
195
199
|
query_options[:timezone] ||= :utc
|
196
200
|
sql = "SELECT [#{column}] FROM [datatypes] WHERE [id] = #{id}"
|
@@ -212,6 +216,34 @@ module TinyTds
|
|
212
216
|
client.execute("ROLLBACK TRANSACTION").do
|
213
217
|
end
|
214
218
|
|
219
|
+
def init_toxiproxy
|
220
|
+
# In order for toxiproxy to work for local docker instances of mssql, the containers must be on the same network
|
221
|
+
# and the host used below must match the mssql container name so toxiproxy knows where to proxy to.
|
222
|
+
# localhost from the perspective of toxiproxy's container is its own container an *not* the mssql container it needs to proxy to.
|
223
|
+
# docker-compose.yml handles this automatically for us. In instances where someone is using their own local mssql container they'll
|
224
|
+
# need to set up the networks manually and set TINYTDS_UNIT_HOST to their mssql container name
|
225
|
+
# For anything other than localhost just use the environment config
|
226
|
+
toxi_host = ENV['TOXIPROXY_HOST'] || 'localhost'
|
227
|
+
toxi_api_port = 8474
|
228
|
+
toxi_test_port = 1234
|
229
|
+
Toxiproxy.host = "http://#{toxi_host}:#{toxi_api_port}"
|
230
|
+
|
231
|
+
toxi_upstream_host = ENV['TINYTDS_UNIT_HOST_TEST'] || ENV['TINYTDS_UNIT_HOST'] || 'localhost'
|
232
|
+
toxi_upstream_port = ENV['TINYTDS_UNIT_PORT'] || 1433
|
233
|
+
|
234
|
+
puts "\n-------------------------"
|
235
|
+
puts "Toxiproxy api listener: #{toxi_host}:#{toxi_api_port}"
|
236
|
+
puts "Toxiproxy unit test listener: #{toxi_host}:#{toxi_test_port}"
|
237
|
+
puts "Toxiproxy upstream sqlserver: #{toxi_upstream_host}:#{toxi_upstream_port}"
|
238
|
+
puts '-------------------------'
|
239
|
+
|
240
|
+
Toxiproxy.populate([
|
241
|
+
{
|
242
|
+
name: "sqlserver_test",
|
243
|
+
listen: "#{toxi_host}:#{toxi_test_port}",
|
244
|
+
upstream: "#{toxi_upstream_host}:#{toxi_upstream_port}"
|
245
|
+
}
|
246
|
+
])
|
247
|
+
end
|
215
248
|
end
|
216
249
|
end
|
217
|
-
|
data/test/thread_test.rb
CHANGED
@@ -49,7 +49,7 @@ class ThreadTest < TinyTds::TestCase
|
|
49
49
|
begin
|
50
50
|
result = client.execute "select dbname()"
|
51
51
|
result.each { |r| puts r }
|
52
|
-
rescue Exception =>
|
52
|
+
rescue Exception => _e
|
53
53
|
# We are throwing an error on purpose here since 0.6.1 would
|
54
54
|
# segfault on errors thrown in threads
|
55
55
|
end
|
data/tiny_tds.gemspec
CHANGED
@@ -18,12 +18,15 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.rdoc_options = ['--charset=UTF-8']
|
19
19
|
s.extensions = ['ext/tiny_tds/extconf.rb']
|
20
20
|
s.license = 'MIT'
|
21
|
-
s.required_ruby_version = '>= 2.
|
21
|
+
s.required_ruby_version = '>= 2.7.0'
|
22
22
|
s.metadata['msys2_mingw_dependencies'] = 'freetds'
|
23
|
-
s.
|
24
|
-
s.add_development_dependency '
|
25
|
-
s.add_development_dependency 'rake
|
26
|
-
s.add_development_dependency 'rake-compiler
|
27
|
-
s.add_development_dependency '
|
28
|
-
s.add_development_dependency '
|
23
|
+
s.add_dependency 'bigdecimal', '~> 3'
|
24
|
+
s.add_development_dependency 'mini_portile2', '~> 2.5.0'
|
25
|
+
s.add_development_dependency 'rake', '~> 13.0.0'
|
26
|
+
s.add_development_dependency 'rake-compiler', '~> 1.2'
|
27
|
+
s.add_development_dependency 'rake-compiler-dock', '~> 1.4.0'
|
28
|
+
s.add_development_dependency 'minitest', '~> 5.14.0'
|
29
|
+
s.add_development_dependency 'minitest-reporters', '~> 1.6.1'
|
30
|
+
s.add_development_dependency 'connection_pool', '~> 2.2.0'
|
31
|
+
s.add_development_dependency 'toxiproxy', '~> 2.0.0'
|
29
32
|
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:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ken Collins
|
@@ -10,92 +10,134 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2024-12-15 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: bigdecimal
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - "~>"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - "~>"
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '3'
|
15
29
|
- !ruby/object:Gem::Dependency
|
16
30
|
name: mini_portile2
|
17
31
|
requirement: !ruby/object:Gem::Requirement
|
18
32
|
requirements:
|
19
33
|
- - "~>"
|
20
34
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
35
|
+
version: 2.5.0
|
22
36
|
type: :development
|
23
37
|
prerelease: false
|
24
38
|
version_requirements: !ruby/object:Gem::Requirement
|
25
39
|
requirements:
|
26
40
|
- - "~>"
|
27
41
|
- !ruby/object:Gem::Version
|
28
|
-
version:
|
42
|
+
version: 2.5.0
|
29
43
|
- !ruby/object:Gem::Dependency
|
30
44
|
name: rake
|
31
45
|
requirement: !ruby/object:Gem::Requirement
|
32
46
|
requirements:
|
33
47
|
- - "~>"
|
34
48
|
- !ruby/object:Gem::Version
|
35
|
-
version:
|
49
|
+
version: 13.0.0
|
36
50
|
type: :development
|
37
51
|
prerelease: false
|
38
52
|
version_requirements: !ruby/object:Gem::Requirement
|
39
53
|
requirements:
|
40
54
|
- - "~>"
|
41
55
|
- !ruby/object:Gem::Version
|
42
|
-
version:
|
56
|
+
version: 13.0.0
|
43
57
|
- !ruby/object:Gem::Dependency
|
44
58
|
name: rake-compiler
|
45
59
|
requirement: !ruby/object:Gem::Requirement
|
46
60
|
requirements:
|
47
61
|
- - "~>"
|
48
62
|
- !ruby/object:Gem::Version
|
49
|
-
version: '1.
|
63
|
+
version: '1.2'
|
50
64
|
type: :development
|
51
65
|
prerelease: false
|
52
66
|
version_requirements: !ruby/object:Gem::Requirement
|
53
67
|
requirements:
|
54
68
|
- - "~>"
|
55
69
|
- !ruby/object:Gem::Version
|
56
|
-
version: '1.
|
70
|
+
version: '1.2'
|
57
71
|
- !ruby/object:Gem::Dependency
|
58
72
|
name: rake-compiler-dock
|
59
73
|
requirement: !ruby/object:Gem::Requirement
|
60
74
|
requirements:
|
61
75
|
- - "~>"
|
62
76
|
- !ruby/object:Gem::Version
|
63
|
-
version:
|
77
|
+
version: 1.4.0
|
64
78
|
type: :development
|
65
79
|
prerelease: false
|
66
80
|
version_requirements: !ruby/object:Gem::Requirement
|
67
81
|
requirements:
|
68
82
|
- - "~>"
|
69
83
|
- !ruby/object:Gem::Version
|
70
|
-
version:
|
84
|
+
version: 1.4.0
|
71
85
|
- !ruby/object:Gem::Dependency
|
72
86
|
name: minitest
|
73
87
|
requirement: !ruby/object:Gem::Requirement
|
74
88
|
requirements:
|
75
89
|
- - "~>"
|
76
90
|
- !ruby/object:Gem::Version
|
77
|
-
version:
|
91
|
+
version: 5.14.0
|
78
92
|
type: :development
|
79
93
|
prerelease: false
|
80
94
|
version_requirements: !ruby/object:Gem::Requirement
|
81
95
|
requirements:
|
82
96
|
- - "~>"
|
83
97
|
- !ruby/object:Gem::Version
|
84
|
-
version:
|
98
|
+
version: 5.14.0
|
99
|
+
- !ruby/object:Gem::Dependency
|
100
|
+
name: minitest-reporters
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - "~>"
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 1.6.1
|
106
|
+
type: :development
|
107
|
+
prerelease: false
|
108
|
+
version_requirements: !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - "~>"
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 1.6.1
|
85
113
|
- !ruby/object:Gem::Dependency
|
86
114
|
name: connection_pool
|
87
115
|
requirement: !ruby/object:Gem::Requirement
|
88
116
|
requirements:
|
89
117
|
- - "~>"
|
90
118
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
119
|
+
version: 2.2.0
|
92
120
|
type: :development
|
93
121
|
prerelease: false
|
94
122
|
version_requirements: !ruby/object:Gem::Requirement
|
95
123
|
requirements:
|
96
124
|
- - "~>"
|
97
125
|
- !ruby/object:Gem::Version
|
98
|
-
version:
|
126
|
+
version: 2.2.0
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: toxiproxy
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - "~>"
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: 2.0.0
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - "~>"
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: 2.0.0
|
99
141
|
description: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.
|
100
142
|
Developed for the ActiveRecord SQL Server adapter.
|
101
143
|
email:
|
@@ -110,10 +152,9 @@ extra_rdoc_files: []
|
|
110
152
|
files:
|
111
153
|
- ".codeclimate.yml"
|
112
154
|
- ".gitattributes"
|
155
|
+
- ".github/workflows/ci.yml"
|
113
156
|
- ".gitignore"
|
114
157
|
- ".rubocop.yml"
|
115
|
-
- ".travis.yml"
|
116
|
-
- BACKERS.md
|
117
158
|
- CHANGELOG.md
|
118
159
|
- CODE_OF_CONDUCT.md
|
119
160
|
- Gemfile
|
@@ -122,9 +163,9 @@ files:
|
|
122
163
|
- README.md
|
123
164
|
- Rakefile
|
124
165
|
- VERSION
|
125
|
-
- appveyor.yml
|
126
166
|
- bin/defncopy-ttds
|
127
167
|
- bin/tsql-ttds
|
168
|
+
- docker-compose.yml
|
128
169
|
- exe/.keep
|
129
170
|
- ext/tiny_tds/client.c
|
130
171
|
- ext/tiny_tds/client.h
|
@@ -144,6 +185,8 @@ files:
|
|
144
185
|
- patches/freetds/1.00.27/0001-mingw_missing_inet_pton.diff
|
145
186
|
- patches/freetds/1.00.27/0002-Don-t-use-MSYS2-file-libws2_32.diff
|
146
187
|
- patches/libiconv/1.14/1-avoid-gets-error.patch
|
188
|
+
- setup_cimgruby_dev.sh
|
189
|
+
- start_dev.sh
|
147
190
|
- tasks/native_gem.rake
|
148
191
|
- tasks/package.rake
|
149
192
|
- tasks/ports.rake
|
@@ -152,26 +195,24 @@ files:
|
|
152
195
|
- tasks/ports/openssl.rb
|
153
196
|
- tasks/ports/recipe.rb
|
154
197
|
- tasks/test.rake
|
155
|
-
- test/appveyor/dbsetup.ps1
|
156
|
-
- test/appveyor/dbsetup.sql
|
157
198
|
- test/benchmark/query.rb
|
158
199
|
- test/benchmark/query_odbc.rb
|
159
200
|
- test/benchmark/query_tinytds.rb
|
160
201
|
- test/bin/install-freetds.sh
|
202
|
+
- test/bin/install-mssql.ps1
|
203
|
+
- test/bin/install-mssqltools.sh
|
161
204
|
- test/bin/install-openssl.sh
|
162
|
-
- test/bin/
|
205
|
+
- test/bin/setup_tinytds_db.sh
|
206
|
+
- test/bin/setup_volume_permissions.sh
|
163
207
|
- test/client_test.rb
|
164
208
|
- test/gem_test.rb
|
165
209
|
- test/result_test.rb
|
166
210
|
- test/schema/1px.gif
|
167
|
-
- test/schema/
|
168
|
-
- test/schema/sqlserver_2005.sql
|
169
|
-
- test/schema/sqlserver_2008.sql
|
170
|
-
- test/schema/sqlserver_2014.sql
|
171
|
-
- test/schema/sqlserver_2016.sql
|
211
|
+
- test/schema/sqlserver_2017.sql
|
172
212
|
- test/schema/sqlserver_azure.sql
|
173
|
-
- test/schema/sybase_ase.sql
|
174
213
|
- test/schema_test.rb
|
214
|
+
- test/sql/db-create.sql
|
215
|
+
- test/sql/db-login.sql
|
175
216
|
- test/test_helper.rb
|
176
217
|
- test/thread_test.rb
|
177
218
|
- tiny_tds.gemspec
|
@@ -189,38 +230,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
189
230
|
requirements:
|
190
231
|
- - ">="
|
191
232
|
- !ruby/object:Gem::Version
|
192
|
-
version: 2.
|
233
|
+
version: 2.7.0
|
193
234
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
194
235
|
requirements:
|
195
236
|
- - ">="
|
196
237
|
- !ruby/object:Gem::Version
|
197
238
|
version: '0'
|
198
239
|
requirements: []
|
199
|
-
|
200
|
-
rubygems_version: 2.6.8
|
240
|
+
rubygems_version: 3.1.6
|
201
241
|
signing_key:
|
202
242
|
specification_version: 4
|
203
243
|
summary: TinyTDS - A modern, simple and fast FreeTDS library for Ruby using DB-Library.
|
204
|
-
test_files:
|
205
|
-
- test/appveyor/dbsetup.ps1
|
206
|
-
- test/appveyor/dbsetup.sql
|
207
|
-
- test/benchmark/query.rb
|
208
|
-
- test/benchmark/query_odbc.rb
|
209
|
-
- test/benchmark/query_tinytds.rb
|
210
|
-
- test/bin/install-freetds.sh
|
211
|
-
- test/bin/install-openssl.sh
|
212
|
-
- test/bin/setup.sh
|
213
|
-
- test/client_test.rb
|
214
|
-
- test/gem_test.rb
|
215
|
-
- test/result_test.rb
|
216
|
-
- test/schema/1px.gif
|
217
|
-
- test/schema/sqlserver_2000.sql
|
218
|
-
- test/schema/sqlserver_2005.sql
|
219
|
-
- test/schema/sqlserver_2008.sql
|
220
|
-
- test/schema/sqlserver_2014.sql
|
221
|
-
- test/schema/sqlserver_2016.sql
|
222
|
-
- test/schema/sqlserver_azure.sql
|
223
|
-
- test/schema/sybase_ase.sql
|
224
|
-
- test/schema_test.rb
|
225
|
-
- test/test_helper.rb
|
226
|
-
- test/thread_test.rb
|
244
|
+
test_files: []
|
data/.travis.yml
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
sudo: required
|
2
|
-
cache: bundler
|
3
|
-
services:
|
4
|
-
- docker
|
5
|
-
env:
|
6
|
-
global:
|
7
|
-
- PATH=/opt/local/bin:$PATH
|
8
|
-
- TESTOPTS="-v"
|
9
|
-
- TINYTDS_UNIT_HOST=localhost
|
10
|
-
rvm:
|
11
|
-
- 2.1.9
|
12
|
-
- 2.2.5
|
13
|
-
- 2.3.1
|
14
|
-
before_install:
|
15
|
-
- docker info
|
16
|
-
- sudo ./test/bin/install-openssl.sh
|
17
|
-
- sudo ./test/bin/install-freetds.sh
|
18
|
-
- sudo ./test/bin/setup.sh
|
19
|
-
install:
|
20
|
-
- gem install bundler
|
21
|
-
- bundle --version
|
22
|
-
- bundle install
|
23
|
-
script:
|
24
|
-
- bundle exec rake
|
data/BACKERS.md
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# Backers
|
2
|
-
|
3
|
-
You can join in supporting TinyTDS and the Rails SQL Server Adapter development by [pledging on Patreon](https://www.patreon.com/metaskills)! Backers in the same pledge level appear in the order of pledge date.
|
4
|
-
|
5
|
-
### $2000
|
6
|
-
|
7
|
-
[It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611218)
|
8
|
-
|
9
|
-
|
10
|
-
### $500
|
11
|
-
|
12
|
-
[It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611209)
|
13
|
-
|
14
|
-
|
15
|
-
### $250
|
16
|
-
|
17
|
-
[It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611199)
|
18
|
-
|
19
|
-
|
20
|
-
### $100
|
21
|
-
|
22
|
-
[It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611196)
|
23
|
-
|
24
|
-
|
25
|
-
### $50+
|
26
|
-
|
27
|
-
[It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611186)
|
28
|
-
|
29
|
-
|
30
|
-
### $10+
|
31
|
-
|
32
|
-
[It could be you!](https://www.patreon.com/bePatron?c=765225&rid=1611149)
|
data/appveyor.yml
DELETED
@@ -1,51 +0,0 @@
|
|
1
|
-
init:
|
2
|
-
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
|
3
|
-
- SET PATH=C:\MinGW\msys\1.0\bin;%PATH%
|
4
|
-
- SET RAKEOPT=-rdevkit
|
5
|
-
- SET TESTOPTS='-v'
|
6
|
-
- SET MAKE=make V=1
|
7
|
-
clone_depth: 5
|
8
|
-
skip_tags: true
|
9
|
-
skip_branch_with_pr: true
|
10
|
-
matrix:
|
11
|
-
fast_finish: true
|
12
|
-
install:
|
13
|
-
# Output debugging info
|
14
|
-
- ps: Update-AppveyorBuild -Version "$(Get-Content $env:appveyor_build_folder\VERSION).$env:appveyor_build_number"
|
15
|
-
- perl --version
|
16
|
-
- ruby --version
|
17
|
-
- gem --version
|
18
|
-
|
19
|
-
# Set up project prerequisits
|
20
|
-
- bundle install
|
21
|
-
- bundle exec rake ports
|
22
|
-
build: off
|
23
|
-
branches:
|
24
|
-
except:
|
25
|
-
- /dev.*/
|
26
|
-
test_script:
|
27
|
-
- timeout /t 4 /nobreak > NUL
|
28
|
-
- powershell -File "%APPVEYOR_BUILD_FOLDER%\test\appveyor\dbsetup.ps1"
|
29
|
-
- timeout /t 4 /nobreak > NUL
|
30
|
-
- ps: Start-Service 'MSSQL$SQL2014'
|
31
|
-
- timeout /t 4 /nobreak > NUL
|
32
|
-
- sqlcmd -S ".\SQL2014" -U sa -P Password12! -i %APPVEYOR_BUILD_FOLDER%\test\appveyor\dbsetup.sql
|
33
|
-
- bundle exec rake ports build test TINYTDS_UNIT_HOST_TEST=localhost TINYTDS_UNIT_DATASERVER="localhost\SQL2014" TINYTDS_SCHEMA=sqlserver_2014 TDSVER=7.1
|
34
|
-
- bundle exec rake ports build test TINYTDS_UNIT_HOST_TEST=localhost TINYTDS_UNIT_DATASERVER="localhost\SQL2014" TINYTDS_SCHEMA=sqlserver_2014
|
35
|
-
- ps: Stop-Service 'MSSQL$SQL2014'
|
36
|
-
- ps: Start-Service 'MSSQL$SQL2012SP1'
|
37
|
-
- timeout /t 4 /nobreak > NUL
|
38
|
-
- sqlcmd -S ".\SQL2012SP1" -U sa -P Password12! -i %APPVEYOR_BUILD_FOLDER%\test\appveyor\dbsetup.sql
|
39
|
-
- bundle exec rake ports build test TINYTDS_UNIT_HOST_TEST=localhost TINYTDS_UNIT_DATASERVER="localhost\SQL2012SP1" TINYTDS_SCHEMA=sqlserver_2014
|
40
|
-
environment:
|
41
|
-
CI_AZURE_HOST:
|
42
|
-
secure: 8ydpYysZYKEBKvp6plKlYfepH98/zAuT27FFCaJ9Sss=
|
43
|
-
TINYTDS_UNIT_AZURE_PASS:
|
44
|
-
secure: fYKSKV4v+36OFQp2nZdX4DfUpgmy5cm0wuR73cgdmEk=
|
45
|
-
matrix:
|
46
|
-
- ruby_version: "24-x64"
|
47
|
-
- ruby_version: "24"
|
48
|
-
- ruby_version: "22-x64"
|
49
|
-
- ruby_version: "22"
|
50
|
-
on_failure:
|
51
|
-
- find -name compile.log | xargs cat
|
data/test/appveyor/dbsetup.ps1
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
|
2
|
-
Write-Output "Setting up..."
|
3
|
-
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo") | Out-Null
|
4
|
-
[reflection.assembly]::LoadWithPartialName("Microsoft.SqlServer.SqlWmiManagement") | Out-Null
|
5
|
-
|
6
|
-
Write-Output "Setting variables..."
|
7
|
-
$serverName = $env:COMPUTERNAME
|
8
|
-
$instances = @('SQL2012SP1', 'SQL2014', 'SQL2016')
|
9
|
-
$smo = 'Microsoft.SqlServer.Management.Smo.'
|
10
|
-
$wmi = new-object ($smo + 'Wmi.ManagedComputer')
|
11
|
-
|
12
|
-
Write-Output "Configure Instances..."
|
13
|
-
foreach ($instance in $instances) {
|
14
|
-
Write-Output "Instance $instance ..."
|
15
|
-
Write-Output "Enable TCP/IP and port 1433..."
|
16
|
-
$uri = "ManagedComputer[@Name='$serverName']/ServerInstance[@Name='$instance']/ServerProtocol[@Name='Tcp']"
|
17
|
-
$tcp = $wmi.GetSmoObject($uri)
|
18
|
-
$tcp.IsEnabled = $true
|
19
|
-
foreach ($ipAddress in $Tcp.IPAddresses) {
|
20
|
-
$ipAddress.IPAddressProperties["TcpDynamicPorts"].Value = ""
|
21
|
-
$ipAddress.IPAddressProperties["TcpPort"].Value = "1433"
|
22
|
-
}
|
23
|
-
$tcp.Alter()
|
24
|
-
}
|
25
|
-
|
26
|
-
Set-Service SQLBrowser -StartupType Manual
|
27
|
-
Start-Service SQLBrowser
|
data/test/appveyor/dbsetup.sql
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
CREATE DATABASE [tinytdstest];
|
2
|
-
GO
|
3
|
-
CREATE LOGIN [tinytds] WITH PASSWORD = '', CHECK_POLICY = OFF, DEFAULT_DATABASE = [tinytdstest];
|
4
|
-
GO
|
5
|
-
USE [tinytdstest];
|
6
|
-
CREATE USER [tinytds] FOR LOGIN [tinytds];
|
7
|
-
GO
|
8
|
-
EXEC sp_addrolemember N'db_owner', N'tinytds';
|
9
|
-
GO
|
data/test/bin/setup.sh
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
set -x
|
4
|
-
set -e
|
5
|
-
|
6
|
-
tag=2017-GA
|
7
|
-
|
8
|
-
docker pull metaskills/mssql-server-linux-tinytds:$tag
|
9
|
-
|
10
|
-
container=$(docker ps -a -q --filter ancestor=metaskills/mssql-server-linux-tinytds:$tag)
|
11
|
-
if [[ -z $container ]]; then
|
12
|
-
docker run -p 1433:1433 -d metaskills/mssql-server-linux-tinytds:$tag && sleep 10
|
13
|
-
exit
|
14
|
-
fi
|
15
|
-
|
16
|
-
container=$(docker ps -q --filter ancestor=metaskills/mssql-server-linux-tinytds:$tag)
|
17
|
-
if [[ -z $container ]]; then
|
18
|
-
docker start $container && sleep 10
|
19
|
-
fi
|