ruby-informix 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYRIGHT +1 -1
- data/Changelog +10 -0
- data/README +9 -9
- data/ext/informixc.c +6 -6
- data/ext/informixc.ec +7 -7
- data/lib/informix.rb +12 -16
- 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 +8 -6
data/COPYRIGHT
CHANGED
data/Changelog
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
0.7.3 2010-02-02
|
2
|
+
------------------
|
3
|
+
Bugs fixed:
|
4
|
+
* CursorBase#drop was raising an ArgumentError exception on Ruby 1.8.7
|
5
|
+
|
6
|
+
Caveats:
|
7
|
+
* Database#each and Database#each_hash removed. Use Database#foreach and
|
8
|
+
Database#foreach_hash instead.
|
9
|
+
|
10
|
+
|
1
11
|
0.7.2 2008-11-21
|
2
12
|
------------------
|
3
13
|
Bugs fixed:
|
data/README
CHANGED
@@ -17,6 +17,7 @@ Informix CSDK 2.81 and above, on the following platforms:
|
|
17
17
|
Operating System Architecture
|
18
18
|
-----------------------------------------
|
19
19
|
Solaris SPARC64
|
20
|
+
Mac OS X x86-64
|
20
21
|
GNU/Linux x86, x86-64
|
21
22
|
Windows XP/2000 x86
|
22
23
|
HP-UX 11.11 PA-RISC 2.0 64-bit
|
@@ -53,14 +54,13 @@ http://ruby-informix.rubyforge.org/doc
|
|
53
54
|
|
54
55
|
db = Informix.connect('stores')
|
55
56
|
|
56
|
-
===
|
57
|
+
=== Traversing a table
|
57
58
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
cur.drop # or close, if you want to reopen it later
|
59
|
+
db.each('select * from stock') do |r|
|
60
|
+
# do something with the record
|
61
|
+
end
|
62
62
|
|
63
|
-
===
|
63
|
+
=== Fetching all records from a table
|
64
64
|
|
65
65
|
records = db.cursor('select * from stock') do |cur|
|
66
66
|
cur.open
|
@@ -113,9 +113,9 @@ like DATE, DATETIME, INTERVAL, BOOL, DECIMAL and MONEY
|
|
113
113
|
|
114
114
|
== Recommendations
|
115
115
|
|
116
|
-
*
|
117
|
-
|
118
|
-
*
|
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
119
|
buffers, setting the environment variable FET_BUF_SIZE to up to 32767.
|
120
120
|
|
121
121
|
|
data/ext/informixc.c
CHANGED
@@ -3267,12 +3267,12 @@ rb_statement_call(int argc, VALUE *argv, VALUE self)
|
|
3267
3267
|
|
3268
3268
|
/*
|
3269
3269
|
* call-seq:
|
3270
|
-
* st.
|
3270
|
+
* st.free
|
3271
3271
|
*
|
3272
3272
|
* Frees the statement and the memory associated with it.
|
3273
3273
|
*/
|
3274
3274
|
static VALUE
|
3275
|
-
|
3275
|
+
rb_statement_free(VALUE self)
|
3276
3276
|
{
|
3277
3277
|
cursor_t *c;
|
3278
3278
|
|
@@ -4082,13 +4082,13 @@ rb_cursorbase_close(VALUE self)
|
|
4082
4082
|
|
4083
4083
|
/*
|
4084
4084
|
* call-seq:
|
4085
|
-
* cursor.
|
4085
|
+
* cursor.free => nil
|
4086
4086
|
*
|
4087
4087
|
* Closes the cursor and frees the memory associated with it. The cursor
|
4088
4088
|
* cannot be opened again.
|
4089
4089
|
*/
|
4090
4090
|
static VALUE
|
4091
|
-
|
4091
|
+
rb_cursorbase_free(VALUE self)
|
4092
4092
|
{
|
4093
4093
|
cursor_t *c;
|
4094
4094
|
|
@@ -4409,7 +4409,7 @@ void Init_informixc(void)
|
|
4409
4409
|
rb_define_alloc_func(rb_cStatement, statement_alloc);
|
4410
4410
|
rb_define_method(rb_cStatement, "initialize", rb_statement_initialize, 2);
|
4411
4411
|
rb_define_method(rb_cStatement, "[]", rb_statement_call, -1);
|
4412
|
-
rb_define_method(rb_cStatement, "
|
4412
|
+
rb_define_method(rb_cStatement, "free", rb_statement_free, 0);
|
4413
4413
|
|
4414
4414
|
/*
|
4415
4415
|
* The +CursorBase+ class provides the basic functionality for any cursor.
|
@@ -4419,7 +4419,7 @@ void Init_informixc(void)
|
|
4419
4419
|
rb_define_method(rb_cCursorBase, "id", rb_cursorbase_id, 0);
|
4420
4420
|
rb_define_method(rb_cCursorBase, "open", rb_cursorbase_open, -1);
|
4421
4421
|
rb_define_method(rb_cCursorBase, "close", rb_cursorbase_close, 0);
|
4422
|
-
rb_define_method(rb_cCursorBase, "
|
4422
|
+
rb_define_method(rb_cCursorBase, "free", rb_cursorbase_free, 0);
|
4423
4423
|
|
4424
4424
|
/*
|
4425
4425
|
* The +SequentialCursor+ class adds fetching capabilities and iterators
|
data/ext/informixc.ec
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* Copyright (c) 2006-
|
2
|
+
* Copyright (c) 2006-2010, 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
|
@@ -2537,12 +2537,12 @@ rb_statement_call(int argc, VALUE *argv, VALUE self)
|
|
2537
2537
|
|
2538
2538
|
/*
|
2539
2539
|
* call-seq:
|
2540
|
-
* st.
|
2540
|
+
* st.free
|
2541
2541
|
*
|
2542
2542
|
* Frees the statement and the memory associated with it.
|
2543
2543
|
*/
|
2544
2544
|
static VALUE
|
2545
|
-
|
2545
|
+
rb_statement_free(VALUE self)
|
2546
2546
|
{
|
2547
2547
|
cursor_t *c;
|
2548
2548
|
|
@@ -3056,13 +3056,13 @@ rb_cursorbase_close(VALUE self)
|
|
3056
3056
|
|
3057
3057
|
/*
|
3058
3058
|
* call-seq:
|
3059
|
-
* cursor.
|
3059
|
+
* cursor.free => nil
|
3060
3060
|
*
|
3061
3061
|
* Closes the cursor and frees the memory associated with it. The cursor
|
3062
3062
|
* cannot be opened again.
|
3063
3063
|
*/
|
3064
3064
|
static VALUE
|
3065
|
-
|
3065
|
+
rb_cursorbase_free(VALUE self)
|
3066
3066
|
{
|
3067
3067
|
cursor_t *c;
|
3068
3068
|
|
@@ -3319,7 +3319,7 @@ void Init_informixc(void)
|
|
3319
3319
|
rb_define_alloc_func(rb_cStatement, statement_alloc);
|
3320
3320
|
rb_define_method(rb_cStatement, "initialize", rb_statement_initialize, 2);
|
3321
3321
|
rb_define_method(rb_cStatement, "[]", rb_statement_call, -1);
|
3322
|
-
rb_define_method(rb_cStatement, "
|
3322
|
+
rb_define_method(rb_cStatement, "free", rb_statement_free, 0);
|
3323
3323
|
|
3324
3324
|
/*
|
3325
3325
|
* The +CursorBase+ class provides the basic functionality for any cursor.
|
@@ -3329,7 +3329,7 @@ void Init_informixc(void)
|
|
3329
3329
|
rb_define_method(rb_cCursorBase, "id", rb_cursorbase_id, 0);
|
3330
3330
|
rb_define_method(rb_cCursorBase, "open", rb_cursorbase_open, -1);
|
3331
3331
|
rb_define_method(rb_cCursorBase, "close", rb_cursorbase_close, 0);
|
3332
|
-
rb_define_method(rb_cCursorBase, "
|
3332
|
+
rb_define_method(rb_cCursorBase, "free", rb_cursorbase_free, 0);
|
3333
3333
|
|
3334
3334
|
/*
|
3335
3335
|
* The +SequentialCursor+ class adds fetching capabilities and iterators
|
data/lib/informix.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2008, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
2
|
+
# Copyright (c) 2008-2010, 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.7.
|
35
|
+
VERSION = "0.7.3"
|
36
36
|
VERSION.freeze
|
37
37
|
|
38
38
|
# Shortcut to create a +Database+ object connected to +dbname+ as
|
@@ -110,7 +110,7 @@ module Informix
|
|
110
110
|
# Shortcut to create a +Statement+ object from +query+.
|
111
111
|
#
|
112
112
|
# The +Statement+ object is passed to the block if it's given, and
|
113
|
-
# automatically
|
113
|
+
# automatically released when the block terminates, returning
|
114
114
|
# the value of the block.
|
115
115
|
#
|
116
116
|
# +query+ may contain '?' placeholders for input parameters;
|
@@ -132,7 +132,7 @@ module Informix
|
|
132
132
|
Statement.new(self, query, &block)
|
133
133
|
end
|
134
134
|
|
135
|
-
# Shortcut to create, <b>execute and
|
135
|
+
# Shortcut to create, <b>execute and release</b> a +Statement+ object from
|
136
136
|
# +query+.
|
137
137
|
#
|
138
138
|
# +query+ may contain '?' placeholders for input parameters;
|
@@ -156,7 +156,7 @@ module Informix
|
|
156
156
|
# Shortcut to create a cursor object based on +query+ using +options+.
|
157
157
|
#
|
158
158
|
# The cursor object is passed to the block if it's given, and
|
159
|
-
# automatically
|
159
|
+
# automatically released when the block terminates, returning
|
160
160
|
# the value of the block.
|
161
161
|
#
|
162
162
|
# +query+ may contain '?' placeholders for input parameters.
|
@@ -182,7 +182,7 @@ module Informix
|
|
182
182
|
# +query+ using +options+. The records are retrieved as arrays.
|
183
183
|
#
|
184
184
|
# The cursor object is passed to the block and
|
185
|
-
# automatically
|
185
|
+
# automatically released when the block terminates. Returns __self__.
|
186
186
|
#
|
187
187
|
# +query+ may contain '?' placeholders for input parameters.
|
188
188
|
#
|
@@ -209,8 +209,6 @@ module Informix
|
|
209
209
|
self
|
210
210
|
end
|
211
211
|
|
212
|
-
alias each foreach
|
213
|
-
|
214
212
|
# Similar to +Database#foreach+, except that retrieves records as hashes
|
215
213
|
# instead of arrays.
|
216
214
|
#
|
@@ -226,8 +224,6 @@ module Informix
|
|
226
224
|
self
|
227
225
|
end
|
228
226
|
|
229
|
-
alias each_hash foreach_hash
|
230
|
-
|
231
227
|
# Shortcut to create a +Slob+ object.
|
232
228
|
#
|
233
229
|
# The +Slob+ object is passed to the block if it's given, and
|
@@ -272,7 +268,7 @@ module Informix
|
|
272
268
|
# Creates a +Statement+ object from +query+.
|
273
269
|
#
|
274
270
|
# The +Statement+ object is passed to the block if it's given, and
|
275
|
-
# automatically
|
271
|
+
# automatically released when the block terminates, returning
|
276
272
|
# the value of the block.
|
277
273
|
#
|
278
274
|
# +query+ may contain '?' placeholders for input parameters;
|
@@ -284,7 +280,7 @@ module Informix
|
|
284
280
|
begin
|
285
281
|
yield stmt
|
286
282
|
ensure
|
287
|
-
stmt.
|
283
|
+
stmt.free
|
288
284
|
end
|
289
285
|
end
|
290
286
|
end # class Statement
|
@@ -332,7 +328,7 @@ module Informix
|
|
332
328
|
# Shortcut to create a cursor object based on +query+ using +options+.
|
333
329
|
#
|
334
330
|
# The cursor object is passed to the block if it's given, and
|
335
|
-
# automatically
|
331
|
+
# automatically released when the block terminates, returning
|
336
332
|
# the value of the block.
|
337
333
|
#
|
338
334
|
# +options+ can be a Hash object with the following possible keys:
|
@@ -348,7 +344,7 @@ module Informix
|
|
348
344
|
begin
|
349
345
|
yield cur
|
350
346
|
ensure
|
351
|
-
cur.
|
347
|
+
cur.free
|
352
348
|
end
|
353
349
|
end
|
354
350
|
|
@@ -356,7 +352,7 @@ module Informix
|
|
356
352
|
# using +options+ in a single step.
|
357
353
|
#
|
358
354
|
# The cursor object is passed to the block if it's given, and
|
359
|
-
# automatically
|
355
|
+
# automatically released when the block terminates, returning
|
360
356
|
# the value of the block.
|
361
357
|
#
|
362
358
|
# +options+ can be a Hash object with the following possible keys:
|
@@ -377,7 +373,7 @@ module Informix
|
|
377
373
|
begin
|
378
374
|
yield cur
|
379
375
|
ensure
|
380
|
-
cur.
|
376
|
+
cur.free
|
381
377
|
end
|
382
378
|
end
|
383
379
|
end # module Cursor
|
data/lib/informix/exceptions.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#--
|
2
|
-
# Copyright (c) 2008, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
2
|
+
# Copyright (c) 2008-2010, 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, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
2
|
+
# Copyright (c) 2008-2010, 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, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
2
|
+
# Copyright (c) 2008-2010, 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, Gerardo Santana Gomez Garrido <gerardo.santana@gmail.com>
|
2
|
+
# Copyright (c) 2008-2010, 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,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-informix
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gerardo Santana Gomez Garrido
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2010-02-02 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -42,7 +42,9 @@ files:
|
|
42
42
|
- README
|
43
43
|
- ext/informixc.c
|
44
44
|
has_rdoc: true
|
45
|
-
homepage: http://
|
45
|
+
homepage: http://ruby-informix.rubyforge.org/
|
46
|
+
licenses: []
|
47
|
+
|
46
48
|
post_install_message:
|
47
49
|
rdoc_options:
|
48
50
|
- --title
|
@@ -72,9 +74,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
74
|
requirements: []
|
73
75
|
|
74
76
|
rubyforge_project: ruby-informix
|
75
|
-
rubygems_version: 1.
|
77
|
+
rubygems_version: 1.3.5
|
76
78
|
signing_key:
|
77
|
-
specification_version:
|
79
|
+
specification_version: 3
|
78
80
|
summary: Ruby library for IBM Informix
|
79
81
|
test_files: []
|
80
82
|
|