ruby-informix 0.8.0 → 0.8.2
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 +7 -0
- data/COPYRIGHT +1 -1
- data/Changelog +11 -0
- data/README.md +143 -0
- data/ext/extconf.rb +12 -13
- data/ext/informixc.c +266 -259
- data/ext/informixc.ec +14 -7
- data/lib/informix.rb +2 -2
- data/lib/informix/exceptions.rb +1 -1
- data/lib/informix/interval.rb +1 -1
- data/lib/informix/scrollcursor.rb +1 -1
- data/lib/informix/seqcursor.rb +1 -1
- metadata +36 -43
- data/README +0 -142
data/ext/informixc.ec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (c) 2006-
|
2
|
+
* Copyright (c) 2006-2017, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
3
3
|
* All rights reserved.
|
4
4
|
*
|
5
5
|
* Redistribution and use in source and binary forms, with or without
|
@@ -2015,12 +2015,19 @@ rb_database_initialize(int argc, VALUE *argv, VALUE self)
|
|
2015
2015
|
into :c_version from systables where tabid = 1;
|
2016
2016
|
|
2017
2017
|
|
2018
|
-
|
2019
|
-
|
2020
|
-
|
2021
|
-
|
2022
|
-
|
2023
|
-
|
2018
|
+
server_type = rb_str_new2(c_version.server_type);
|
2019
|
+
major = rb_str_new2(c_version.major);
|
2020
|
+
minor = rb_str_new2(c_version.minor);
|
2021
|
+
os = rb_str_new2(c_version.os);
|
2022
|
+
level = rb_str_new2(c_version.level);
|
2023
|
+
full = rb_str_new2(c_version.full);
|
2024
|
+
|
2025
|
+
OBJ_FREEZE(server_type);
|
2026
|
+
OBJ_FREEZE(major);
|
2027
|
+
OBJ_FREEZE(minor);
|
2028
|
+
OBJ_FREEZE(os);
|
2029
|
+
OBJ_FREEZE(level);
|
2030
|
+
OBJ_FREEZE(full);
|
2024
2031
|
|
2025
2032
|
version = rb_struct_new(rb_cIfxVersion, server_type, major, minor, os,
|
2026
2033
|
level, full, NULL);
|
data/lib/informix.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2008-
|
2
|
+
# Copyright (c) 2008-2017, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without
|
@@ -32,7 +32,7 @@ require 'informix/seqcursor'
|
|
32
32
|
require 'informix/scrollcursor'
|
33
33
|
|
34
34
|
module Informix
|
35
|
-
VERSION = "0.8.
|
35
|
+
VERSION = "0.8.2"
|
36
36
|
VERSION.freeze
|
37
37
|
|
38
38
|
# Shortcut to create a +Database+ object connected to +dbname+ as
|
data/lib/informix/exceptions.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2008-
|
2
|
+
# Copyright (c) 2008-2017, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without
|
data/lib/informix/interval.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2008-
|
2
|
+
# Copyright (c) 2008-2017, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2008-
|
2
|
+
# Copyright (c) 2008-2017, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without
|
data/lib/informix/seqcursor.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2008-
|
2
|
+
# Copyright (c) 2008-2017, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
3
3
|
# All rights reserved.
|
4
4
|
#
|
5
5
|
# Redistribution and use in source and binary forms, with or without
|
metadata
CHANGED
@@ -1,28 +1,29 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-informix
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
version: 0.8.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.8.2
|
6
5
|
platform: ruby
|
7
|
-
authors:
|
6
|
+
authors:
|
8
7
|
- Gerardo Santana Gomez Garrido
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
|
13
|
-
date: 2012-04-18 00:00:00 Z
|
11
|
+
date: 2017-04-26 00:00:00.000000000 Z
|
14
12
|
dependencies: []
|
15
|
-
|
16
13
|
description: Ruby library for connecting to IBM Informix 7 and above
|
17
14
|
email: gerardo.santana@gmail.com
|
18
15
|
executables: []
|
19
|
-
|
20
|
-
|
16
|
+
extensions:
|
17
|
+
- ext/extconf.rb
|
18
|
+
extra_rdoc_files:
|
19
|
+
- README.md
|
20
|
+
- ext/informixc.c
|
21
|
+
files:
|
22
|
+
- COPYRIGHT
|
23
|
+
- Changelog
|
24
|
+
- README.md
|
21
25
|
- ext/extconf.rb
|
22
|
-
extra_rdoc_files:
|
23
|
-
- README
|
24
26
|
- ext/informixc.c
|
25
|
-
files:
|
26
27
|
- ext/informixc.ec
|
27
28
|
- lib/informix.rb
|
28
29
|
- lib/informix/exceptions.rb
|
@@ -36,46 +37,38 @@ files:
|
|
36
37
|
- test/test_insert.rb
|
37
38
|
- test/test_select.rb
|
38
39
|
- test/testcase.rb
|
39
|
-
- COPYRIGHT
|
40
|
-
- Changelog
|
41
|
-
- README
|
42
|
-
- ext/informixc.c
|
43
|
-
- ext/extconf.rb
|
44
40
|
homepage: http://ruby-informix.rubyforge.org/
|
45
|
-
licenses:
|
46
|
-
|
41
|
+
licenses:
|
42
|
+
- BSD-3-Clause
|
43
|
+
metadata: {}
|
47
44
|
post_install_message:
|
48
|
-
rdoc_options:
|
49
|
-
- --title
|
45
|
+
rdoc_options:
|
46
|
+
- "--title"
|
50
47
|
- Ruby/Informix -- Ruby library for IBM Informix
|
51
|
-
- --exclude
|
48
|
+
- "--exclude"
|
52
49
|
- test
|
53
|
-
- --exclude
|
50
|
+
- "--exclude"
|
54
51
|
- extconf.rb
|
55
|
-
- --inline-source
|
56
|
-
- --line-numbers
|
57
|
-
- --main
|
58
|
-
- README
|
59
|
-
require_paths:
|
52
|
+
- "--inline-source"
|
53
|
+
- "--line-numbers"
|
54
|
+
- "--main"
|
55
|
+
- README.md
|
56
|
+
require_paths:
|
60
57
|
- lib
|
61
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
-
|
63
|
-
requirements:
|
58
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
64
60
|
- - ">="
|
65
|
-
- !ruby/object:Gem::Version
|
66
|
-
version:
|
67
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
|
-
|
69
|
-
requirements:
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
63
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
70
65
|
- - ">="
|
71
|
-
- !ruby/object:Gem::Version
|
72
|
-
version:
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
73
68
|
requirements: []
|
74
|
-
|
75
69
|
rubyforge_project: ruby-informix
|
76
|
-
rubygems_version:
|
70
|
+
rubygems_version: 2.6.11
|
77
71
|
signing_key:
|
78
|
-
specification_version:
|
72
|
+
specification_version: 4
|
79
73
|
summary: Ruby library for IBM Informix
|
80
74
|
test_files: []
|
81
|
-
|
data/README
DELETED
@@ -1,142 +0,0 @@
|
|
1
|
-
= Ruby/Informix -- Ruby library for connecting to IBM Informix.
|
2
|
-
|
3
|
-
== Motivation
|
4
|
-
The situation that started it all [link][http://santanatechnotes.blogspot.com/2006/03/informix-driver-for-ruby.html].
|
5
|
-
|
6
|
-
== Download
|
7
|
-
|
8
|
-
The latest version of Ruby/Informix can be found at:
|
9
|
-
|
10
|
-
http://rubyforge.org/projects/ruby-informix
|
11
|
-
|
12
|
-
== Supported platforms
|
13
|
-
|
14
|
-
Ruby/Informix has been tested succesfully with Informix 7 and above, and
|
15
|
-
Informix CSDK 2.81 and above, on the following platforms:
|
16
|
-
|
17
|
-
Operating System Architecture
|
18
|
-
-----------------------------------------
|
19
|
-
Solaris SPARC64
|
20
|
-
Mac OS X x86-64
|
21
|
-
GNU/Linux x86, x86-64
|
22
|
-
Windows XP/2000 x86
|
23
|
-
HP-UX 11.11 PA-RISC 2.0 64-bit
|
24
|
-
|
25
|
-
Send me an e-mail if you have [un]succesfully tested Ruby/Informix on another
|
26
|
-
platform.
|
27
|
-
|
28
|
-
== Installation
|
29
|
-
|
30
|
-
=== Requirements
|
31
|
-
|
32
|
-
* Informix CSDK 2.81 or above
|
33
|
-
|
34
|
-
If you want to build Ruby/Informix instead of installing a precompiled gem,
|
35
|
-
you will also need:
|
36
|
-
|
37
|
-
* Microsoft Visual Studio 6.0, for Windows or
|
38
|
-
* an ANSI C compiler, for UNIX and Linux
|
39
|
-
|
40
|
-
=== Rubygem installation
|
41
|
-
|
42
|
-
gem install ruby-informix
|
43
|
-
|
44
|
-
== Documentation
|
45
|
-
|
46
|
-
RDoc and ri documentation is automatically installed. It can also be found
|
47
|
-
online at:
|
48
|
-
|
49
|
-
http://ruby-informix.rubyforge.org/doc
|
50
|
-
|
51
|
-
== Examples
|
52
|
-
|
53
|
-
=== Connecting to a database
|
54
|
-
|
55
|
-
db = Informix.connect('stores')
|
56
|
-
|
57
|
-
=== Traversing a table
|
58
|
-
|
59
|
-
db.foreach('select * from stock') do |r|
|
60
|
-
# do something with the record
|
61
|
-
end
|
62
|
-
|
63
|
-
=== Fetching all records from a table
|
64
|
-
|
65
|
-
records = db.cursor('select * from stock') do |cur|
|
66
|
-
cur.open
|
67
|
-
cur.fetch_all
|
68
|
-
end
|
69
|
-
|
70
|
-
=== Inserting records
|
71
|
-
|
72
|
-
stmt = db.prepare('insert into state values(?, ?)')
|
73
|
-
stmt.execute('CA', 'California')
|
74
|
-
stmt.call('NM', 'New Mexico')
|
75
|
-
stmt['TX', 'Texas']
|
76
|
-
|
77
|
-
=== Iterating over a table using a hash (shortcut)
|
78
|
-
|
79
|
-
db.foreach_hash('select * from customers') do |cust|
|
80
|
-
puts "#{cust['firstname']} #{cust['lastname']}"
|
81
|
-
end
|
82
|
-
|
83
|
-
More examples can be found at:
|
84
|
-
|
85
|
-
http://ruby-informix.rubyforge.org/examples.html
|
86
|
-
|
87
|
-
|
88
|
-
== Data types supported
|
89
|
-
|
90
|
-
Informix Ruby
|
91
|
-
-----------------------------------------------------------------------------
|
92
|
-
SMALLINT, INT, INT8, FLOAT, Numeric
|
93
|
-
SERIAL, SERIAL8
|
94
|
-
CHAR, NCHAR, VARCHAR, NVARCHAR String
|
95
|
-
DATE Date
|
96
|
-
DATETIME Time
|
97
|
-
INTERVAL Informix::IntervalYTM, Informix::IntervalDTS
|
98
|
-
DECIMAL, MONEY BigDecimal
|
99
|
-
BOOL TrueClass, FalseClass
|
100
|
-
BYTE, TEXT StringIO, String
|
101
|
-
CLOB, BLOB Informix::Slob
|
102
|
-
|
103
|
-
|
104
|
-
NULL values can be inserted and are retrieved as +nil+.
|
105
|
-
|
106
|
-
Any IO-like object that provides a read method, e.g. StringIO or File objects,
|
107
|
-
can be used to insert data in BYTE or TEXT fields. Data retrieved from
|
108
|
-
BYTE and TEXT fields are stored in String objects.
|
109
|
-
|
110
|
-
Strings can be used where Informix accepts them for non-character data types,
|
111
|
-
like DATE, DATETIME, INTERVAL, BOOL, DECIMAL and MONEY
|
112
|
-
|
113
|
-
|
114
|
-
== Recommendations
|
115
|
-
|
116
|
-
* Use blocks to release Informix resources automatically as soon as possible.
|
117
|
-
Alternatively, use #free.
|
118
|
-
* You can optimize cursor execution by changing the size of fetch and insert
|
119
|
-
buffers, setting the environment variable FET_BUF_SIZE to up to 32767.
|
120
|
-
|
121
|
-
|
122
|
-
== Support
|
123
|
-
|
124
|
-
Feel free to send me bug reports, feature requests, comments, patches or
|
125
|
-
questions directly to my mailbox or the following forums:
|
126
|
-
|
127
|
-
* Online forums at Rubyforge [link][http://rubyforge.org/forum/?group_id=1378]
|
128
|
-
* Mailing list [link][http://rubyforge.org/mailman/listinfo/ruby-informix-misc]
|
129
|
-
|
130
|
-
|
131
|
-
== Presentations and articles about Ruby/Informix
|
132
|
-
|
133
|
-
* "Talking with Perl, PHP, Python, Ruby to IDS" [link][http://www.informix-zone.com/informix-script-dbapi], Eric Herber, The Informix Zone.
|
134
|
-
* "Informix on Rails" [link][http://www.ibm.com/developerworks/blogs/page/gbowerman?entry=informix_on_rails], Guy Bowerman, IBM developerWorks Blogs: Informix Application Development.
|
135
|
-
* "Ruby/Informix, and the Ruby Common client" [link][http://www.ibm.com/developerworks/blogs/page/gbowerman?entry=ruby_informix_and_the_ruby], Guy Bowerman, IBM developerWorks Blogs: Informix Application Development.
|
136
|
-
* "Using IBM Informix Dynamic Server on Microsoft Windows, Part 6" [link][http://www.ibm.com/developerworks/offers/lp/demos/summary/usingids6.html], Akmal B. Chaudhri, IBM developerWorks: On demand demos.
|
137
|
-
|
138
|
-
== License
|
139
|
-
|
140
|
-
Ruby/Informix is available under the three-clause BSD license
|
141
|
-
|
142
|
-
:include: COPYRIGHT
|