sqlanywhere-ffi 1.0.2 → 1.0.3

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.
@@ -18,7 +18,7 @@ class SQLAnywhere::SQLAnywhereInterface
18
18
  attach_function :sqlany_connect, [:pointer, :string], :int
19
19
 
20
20
  def sqlany_error(connection)
21
- size = SQLAnywhere::ERROR_SIZE
21
+ size = 255
22
22
  buffer = FFI::MemoryPointer.new(:char, size, false)
23
23
  code = sqlany_error_ connection, buffer, size
24
24
  return code, buffer.read_string
@@ -110,4 +110,7 @@ class SQLAnywhere::SQLAnywhereInterface
110
110
 
111
111
  # http://dcx.sybase.com/1200/en/dbprogramming/programming-sacpp-sacapi-h-fil-sqlany-num-params-met.html
112
112
  attach_function :sqlany_num_params, [:pointer], :int
113
+
114
+ # http://dcx.sybase.com/1200/en/dbprogramming/programming-sacpp-sacapi-h-fil-sqlany-affected-rows-met.html
115
+ attach_function :sqlany_affected_rows, [:pointer], :int
113
116
  end
@@ -1,5 +1,7 @@
1
+ gem 'ffi', '>=1.3.1'
1
2
  require 'ffi'
2
3
 
4
+
3
5
  class SQLAnywhere
4
6
  API_VERSION_1 = 1
5
7
  API_VERSION_2 = 2
@@ -2,19 +2,37 @@ Gem::Specification.new do |s|
2
2
  s.name = "sqlanywhere-ffi"
3
3
  s.summary = "A low-lever driver that allows Ruby code to interface with SQL Anywhere databases"
4
4
  s.description = <<-DESCRIPTION
5
+ This library is meant to be compatible with the sqlanywhere gem.
6
+ The only difference should be that sqlanywhere-ffi doesn't return magic numbers, but instead uses symbols.
5
7
  This library wraps the functionality provided by the SQL Anywhere DBCAPI library.
6
8
  This driver is intended to be a base-level library to be used by interface libraries such as Ruby-DBI and ActiveRecord.
7
9
  This driver can be used with SQL Anywhere 10 and later versions.
8
10
  DESCRIPTION
9
- s.version = "1.0.2"
11
+ s.version = "1.0.3"
10
12
  s.author = "Chris Couzens"
11
13
  s.email = "ccouzens@gmail.com"
12
- s.files = Dir['**/**']
14
+ s.files = %w{
15
+ README.md
16
+ sqlanywhere-ffi.gemspec
17
+ lib/bind_param.rb
18
+ lib/sql_anywhere_interface.rb
19
+ lib/data_value.rb
20
+ lib/sqlanywhere.rb
21
+ lib/api.rb
22
+ lib/data_info.rb
23
+ lib/column_info.rb
24
+ lib/bind_param_info.rb
25
+ lib/bool.rb
26
+ test/test_iq.sql
27
+ test/test.sql
28
+ test/sqlanywhere_test.rb
29
+ LICENSE
30
+ }
13
31
  s.executables = []
14
32
  s.test_files = Dir["test/sqlanywhere_test.rb"]
15
33
  s.has_rdoc = false
16
34
  s.add_dependency 'ffi', '>= 1.3.1'
17
- s.homepage = 'https://github.com/in4systems/sqlanywhere'
35
+ s.homepage = 'https://github.com/ccouzens/sqlanywhere-ffi'
18
36
  s.requirements = <<-REQUIREMENTS
19
37
  DBCAPI should be installed.
20
38
  http://www.sybase.co.uk/detail?id=1087327
@@ -73,7 +73,7 @@ class SQLAnywhere_Test < Test::Unit::TestCase
73
73
  end
74
74
  @conn = @api.sqlany_new_connection()
75
75
  assert_not_nil @conn
76
- conn_str = "UID=dba;PWD=sql;ENG=syb11_in4_cc;DBF=E:\\test.db;CS=UTF-8;LINKS=ShMem,TCPIP(IP=PINE)"
76
+ conn_str = "eng=test;uid=dba;pwd=sql"
77
77
  assert_succeeded @api.sqlany_connect(@conn, conn_str)
78
78
  end
79
79
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqlanywhere-ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-22 00:00:00.000000000 Z
12
+ date: 2013-01-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -27,33 +27,33 @@ dependencies:
27
27
  - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.3.1
30
- description: ! " This library wraps the functionality provided by the SQL Anywhere
31
- DBCAPI library.\n This driver is intended to be a base-level library to be used
32
- by interface libraries such as Ruby-DBI and ActiveRecord.\n This driver can be
33
- used with SQL Anywhere 10 and later versions.\n"
30
+ description: ! " This library is meant to be compatible with the sqlanywhere gem.\n
31
+ \ The only difference should be that sqlanywhere-ffi doesn't return magic numbers,
32
+ but instead uses symbols.\n This library wraps the functionality provided by
33
+ the SQL Anywhere DBCAPI library.\n This driver is intended to be a base-level
34
+ library to be used by interface libraries such as Ruby-DBI and ActiveRecord.\n This
35
+ driver can be used with SQL Anywhere 10 and later versions.\n"
34
36
  email: ccouzens@gmail.com
35
37
  executables: []
36
38
  extensions: []
37
39
  extra_rdoc_files: []
38
40
  files:
39
- - CHANGELOG
40
- - lib/column_info.rb
41
+ - README.md
42
+ - sqlanywhere-ffi.gemspec
41
43
  - lib/bind_param.rb
42
- - lib/sqlanywhere.rb
43
- - lib/api.rb
44
44
  - lib/sql_anywhere_interface.rb
45
45
  - lib/data_value.rb
46
+ - lib/sqlanywhere.rb
47
+ - lib/api.rb
48
+ - lib/data_info.rb
49
+ - lib/column_info.rb
46
50
  - lib/bind_param_info.rb
47
51
  - lib/bool.rb
48
- - lib/data_info.rb
49
- - Gemfile
50
- - README.md
51
- - test/test.sql
52
52
  - test/test_iq.sql
53
+ - test/test.sql
53
54
  - test/sqlanywhere_test.rb
54
- - sqlanywhere-ffi.gemspec
55
55
  - LICENSE
56
- homepage: https://github.com/in4systems/sqlanywhere
56
+ homepage: https://github.com/ccouzens/sqlanywhere-ffi
57
57
  licenses: []
58
58
  post_install_message:
59
59
  rdoc_options: []
data/CHANGELOG DELETED
@@ -1,34 +0,0 @@
1
- =CHANGE LOG
2
-
3
- =====0.1.5 -- 2010/01/25
4
- - Updated library to use DBCAPI 2.0
5
- - Changed test suite to correctly test BIT and TINYINT types
6
- - Added support for Ruby 1.9.1
7
-
8
- =====0.1.4 -- 2009/03/25
9
- - Changed Rakefile to automatically create lib directory
10
- - Fixed bug that tried to build native extensions on binary distsributions
11
-
12
- =====0.1.3 -- 2008/12/31
13
- - Removed 'hint file' in lib directory
14
- - Added extensions to gemspec to force a local compile
15
-
16
- =====0.1.2 -- 2008/12/18
17
- - Fixed bug when trying to read input value from OUTPUT parameter
18
- - Added error checking to C2RB
19
- - Fixed Rake to handle .bundle on OSX
20
-
21
- =====0.1.1 -- 2008/11/06
22
- - Created a source gem rake task
23
- - Created a 'hint' file if the source gem is used directly
24
- - Changed file permissions on archives
25
- - Changed archives to be specific to platform (.zip on windows, .tar.gz
26
- otherwise)
27
- - Changed default rake task to only build library, not gem
28
- - Added a gem rake task
29
-
30
- =====0.1.0 -- 2008/10/15
31
- - Initial Release
32
- - Wraps DBCAPI functionality
33
- - Includes a simple unit test suite
34
-
data/Gemfile DELETED
@@ -1,3 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gem 'ffi', '>= 1.3.1'