File: README.ja

package info (click to toggle)
mysql-ruby 2.4.5-6.1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 192 kB
  • ctags: 17
  • sloc: ruby: 206; makefile: 68
file content (465 lines) | stat: -rw-r--r-- 11,828 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
# $Id: README.ja,v 1.9 2003/08/09 15:48:30 tommy Exp $

MySQL Ruby Module ver2.4.5

 MySQL  Ruby API ǤMySQL  C API ȤۤƱεǽޤ

[ɬפʤ]

MySQL 3.23.54 ʾ
Ruby 1.6.8 ʾ

ʳǤ make Ǥ뤫⤷ޤ󤬡ǧƤޤMySQL  
3.21.x, 3.22.x Ǥ make Ǥ褦ˤĤǤƤޤ :-X

[饤]

Υץ Ruby 饤󥹤˽ޤ

[󥹥ȡ]

¹ԤƤ

	% ruby extconf.rb
  ޤ
	% ruby extconf.rb --with-mysql-dir=/usr/local/mysql
  ޤ
	% ruby extconf.rb --with-mysql-config

	% make

extconf.rb ˤϼΥץǤޤ

    --with-mysql-include=<dir>
	MySQL ΤإåեξȤ /usr/local/include 
	ǥ쥯ȥꤷޤ

    --with-mysql-lib=<dir>
	MySQL Υ饤֥ξȤ /usr/local/lib Υǥ쥯
	ȥꤷޤ

    --with-mysql-dir=<dir>
	--with-mysql-include=<dir>/include, --with-mysql-lib=<dir>/lib 
	ƱǤ

    --with-mysql-config[=/path/to/mysql_config]
	mysql_config ޥɤη̤饳ѥѥ᡼ޤ

ǴñʥƥȤǤޤ

	% ruby -I. ./test.rb hostname user passwd

test.rb Ϳ hostname, user, passwd  MySQL ФȡΥо
ǥǡ١뤳ȤǤ桼ѥɤꤷƤ

ʤСѡ桼ǥ󥹥ȡ뤷Ƥ

	# make install

:

1. ƥȻ˥饤֥ libmysqlclient ĤʤȤ顼Ф
   ϡmake ˥饤֥ξꤹɬפޤΤ褦
    make ƤߤƤ
	% env LD_RUN_PATH=<libmysqlclient.soξ> make

2. ƥå饤֥ libmysqlclient.a ѤϡĤ
   饤֥꤬ɬפˤʤ礬ޤ̤襷ܥΥ顼Ф
    extconf.rb Ρhave_library('m')סhave_library('z')פͭ
   ˤƤ

[Ȥ]

᥽å̾ C API δؿ mysql_ ƬΤƱǤ᥽
ɤλˡŪб C API ؿƱͤǤΤǡܺ٤ MySQL 
ޥ˥奢򸫤Ƥ

᥽åǥ顼ȯ MysqlError 㳰ȯޤ

ä˰̣Τ֤ͤʤؿ self ֤ޤ

require "mysql"
	mysql ⥸塼ɤޤ

[Mysql 饹]

  MySQL 뤿Υ饹Ǥ

 饹᥽å

    init()
	Mysql 饹֥Ȥ֤ޤmysqld ³Ϥޤ
	Mysql#options() ɬפʾϡƤ˹Ԥʤޤ

    real_connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil)
    connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil)
    new(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil)
	mysqld ³Mysql 饹֥Ȥ֤ޤ
	flag  C API ΤΤƱǤ
	) Mysql::CLIENT_FOUND_ROWS

    escape_string(str)
    quote(str)
	insert, update Ѥʸ򥯥Ȥޤ

    get_client_info()
    client_info()
	饤ȥСʸ֤ޤ

    debug(str)
	C API mysql_debug() Ʊ

 ֥ȥ᥽å

    options(opt, val=nil)
	C API  mysql_options() ƱǤopt ˻ꤹ C
	API  MYSQL_ ƬΤǤ
	) Mysql::OPT_CONNECT_TIMEOUT

    real_connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil)
    connect(host=nil, user=nil, passwd=nil, db=nil, port=nil, sock=nil, flag=nil)
	Mysql::real_connect() ƱǤMysql::init() ֥
	Ȥ򥵡Ф³뤿˻Ѥޤ

    affected_rows()
	ƶ줿Կ֤ޤ

    change_user(user=nil, passwd=nil, db=nil)
	³桼ѹޤ

    character_set_name()
	ߤʸåȤ֤ޤ

    close()
	³Ǥޤ

    create_db(db)
	ǡ١ޤ

    drop_db(db)
	ǡ١˴ޤ

    dump_debug_info()
	C API mysql_dump_debug_info() Ʊ

    errno()
	顼ֹ֤ޤ

    error()
	顼å֤ޤ

    escape_string(str)
    quote(str)
	insert, update Ѥʸ򥯥Ȥޤ
	C API  mysql_real_escape_string() Ʊ

    field_count()
	Ǹ˼¹Ԥ줿ι֤ܿޤ

    get_host_info()
    host_info()
	³ʸ֤ޤ

    get_proto_info()
    proto_info()
	³ץȥС֤ͤޤ

    get_server_info()
    server_info()
	ФΥСʸ֤ޤ

    info()
	ľΥξʸ֤ޤä˾󤬤ʤ nil 
	֤ޤ

    insert_id()
	Ǹ줿 AUTO_INCREMENT ܤ֤ͤޤ	

    kill(id)
	id ǻꤷåɤ򻦤ޤ

    list_dbs(db=nil)
	ǡ١ΰ֤ޤ

    list_fields(table, field=nil)
	ơ֥ιܾΰ򼨤 MysqlRes 饹֥Ȥ
	ޤ

    list_processes()
	оθߤΥåɤΰ򼨤 MysqlRes 饹֥
	֤ޤ

    list_tables(table=nil)
	ơ֥ΰ֤ޤ

    ping()
	ФƤ뤫ɤåޤ

    query(q)
	¹ԤޤRuby ǤʸĹȽǤǤΤǡ
	real_query() Ϥޤ
	꤬̤֤硢ưŪ store_result() ¹Ԥơ
	MysqlRes 饹֥Ȥ֤ޤ
	query_with_result  false ꤵƤСstore_result() 
	¹Ԥޤ

    refresh(r)
	ФΥ䥭åեå夷ޤ

    reload()
	ơ֥ɤ߹ߤޤ

    select_db(db)
	ǡ١򤷤ޤ

    shutdown()
	Фߤޤ

    stat()
	Фξ֤ʸ֤ޤ

    store_result()
	η̤ MysqlRes 饹֥Ȥ֤ޤ

    thread_id()
	ߤ³ΥåID֤ޤ

    use_result()
	η̤ MysqlRes 饹֥Ȥ֤ޤ

 ֥ѿ

    query_with_result
	true ꤹ query()  store_result() ¹Ԥơ
	MysqlRes 饹֥Ȥ֤ޤfalse ꤹȤư
	ϹԤޤ󡣥ǥեȤ true Ǥ

[MysqlRes 饹]

  ̤Υ饹Ǥ

 ֥ȥ᥽å

    free()
	̥ơ֥ѥޤ

    data_seek(offset)
	ߤιԤΰ֤ offset ܤιԤˤޤ

    fetch_field()
	ߤιܤ MysqlField 饹֥Ȥ֤ޤ˸ƤФ
	ϼιܤ֤ޤ

    fetch_fields()
	Τɽ MysqlField 饹֥Ȥ֤ޤ

    fetch_field_direct(fieldnr)
	fieldnr ܤιܤ MysqlField 饹֥Ȥ֤ޤ

    fetch_lengths()
	ߤιԤγƹͤĹ֤ޤ

    fetch_row()
	̤ΣԤ֤ޤ˸ƤФ줿ϼιԤ֤ޤ
	ͤϹͤǤ

    fetch_hash(with_table=false)
	̤ΣԤ֤ޤ˸ƤФ줿ϼιԤ֤ޤ
	ͤϹ̾򥭡ȤͤΥϥåǤ
	with_table  true ξϥ˥ơ֥̾ղä졢
	"ơ֥̾.̾" ȤΥˤʤޤ

    field_seek(offset)
	ߤι֤ܰ offset ܤιܤˤޤ

    field_tell()
	ߤιܤΰ֤֤ޤ

    num_fields()
	֤ܿޤ

    num_rows()
	֤ޤ

    row_seek(offset)
	ߤιԤΰ֤ꤷޤoffset ɽ row_tell() 
	ͤǤ

    row_tell()
	ߤιԤΰ֤ɽ֤ޤ

 ƥ졼

    each() {|x| }
	̤γƹԤȤ {} 򷫤֤ޤx ϹͤǤ

    each_hash(with_table=false) {|x| }
	̤γƹԤȤ {} 򷫤֤ޤx Ϲ̾򥭡Ȥ
	ͤΥϥåǤ
	with_table  true ξϥ˥ơ֥̾ղä졢
	"ơ֥̾.̾" ȤΥˤʤޤ

[MysqlField 饹]

  ܤξܺ٤ɽ饹ǤC API Ȱۤʤꡢ֥Ȥ MysqlRes 
  Ω¸ߤΤǡMysqlRes 饹֥Ȥ줿Ǥ
  ѤǤޤΤ C API Ѥޤ

 ֥ѿ(ɤ߽ФΤ)

    name		̾
    table		ơ֥̾
    def			ǥե
    type		ܤη
    length		ܤĹ
    max_length		ιͤκĹ
    flags		ե饰
    decimals		

 ֥ȥ᥽å

    hash()
	嵭ѿ̾򥭡Ȥϥå֤ޤ
	) obj.name == obj.hash['name']

    inspect()
	ʸ "#<MysqlField:̾>" ֤ޤ

    type б C API ΤΤ FIELD_ ƬΤǤ
    ) MysqlField::TYPE_STRING

    flag б C API ΤΤƱǤ
    ) MysqlField::BLOB_FLAG

[MysqlError 饹]

  MySQL Υ顼ɽ魯饹ǤMySQL Υ顼ȯ㳰
  ޤ

 ֥ѿ(ɤ߽ФΤ)

    error		顼å
    errno		顼ֹ

    errno б C API ΤΤƱǤ
    ) MysqlError::CR_UNKNOWN_HOST

[]

  2003-08-10	2.4.5
    extconf.rb: MySQL 4.1 б
    mysql.c.in: Ruby 1.8 б

  2003-02-23	2.4.4a
    extconf.rb  Ruby 1.8.0 б

  2003-01-29	2.4.4
    Mysql::OPT_LOCAL_INFILE ɲá
    extconf.rb  --with-mysql-config ץɲ
    extconf.rb ˼ʥ饤֥ưФ褦ˤ

  2003-01-05	2.4.3c
    Ѹ README βǡPaul DuBois ˴ա

  2002-12-24	2.4.3b
    extconf.rb  Ruby 1.6.8 б

  2002-11-07	2.4.3a
    顼ʣ뤳ȤХ

  2002-09-10	2.4.3
    ER_ ǻϤޤ륨顼ˤб
    errmsg.h  mysqld_error.h 鼫ưŪ˥顼褦
      ˤ

  2002-01-07	2.4.2
    MySQL 4.0 б
    uint  unsigned int ѹmswinбˡ

  2001-12-02	2.4.1
    פ extern Cygiwnбˡ
    extconf.rb Υץѹ

  2001-10-12	2.4.0
    Ruby 1.7 б
    Mysql::debug(), Mysql#change_user(), Mysql#character_set_name(),
      Mysql#dump_debug_info() ɲá

  2001-03-25	2.3.2a
    t/50update.rb Ƚˡѹ

  2001-03-19	2.3.2
    (20) MysqlRes ֥Ȥ顢Ū GC 
      褦ˤ
    Mysql#escape_string(), Mysql#quote() 
      mysql_real_escape_string() Ѥ褦ˤ

  2000-09-02	2.3.1
    Mysql#initialize() ɲ(Ruby 1.6 б)

  2000-07-22	2.3.0
    MysqlRes#free() ɲá
    Mysql#initialize(), MysqlRes#initialize() ͭˤ
    true ֤Ƥ᥽åɤself ֤褦ˤ

  2000-05-27	2.2.1a
    test.rb ǥѥ᡼Ǥ褦ˤ

  2000-05-10	2.2.1
    ǡ١Υǡֱ줿ʸѹ
    ƥȥץɲá

  1999-09-28	2.2.0
    Mysql::init(), Mysql#options(), Mysql#real_connect() ɲá
    Mysql#field_count ɲá

  1999-09-24	2.1.7
    MySQL 3.22.26 б
    MysqlField#inspect() ɲá

  1999-06-17	2.1.6
    fetch_field 뤳Ȥä

  1999-06-12	2.1.5
    Ruby 1.3.x бȾüä

  1999-05-30	2.1.4
    Ruby 1.3.x б

  1999-04-13	2.1.3
    fetch_hash/each_hash ΰοְäƤ
    fetch_hash/each_hash  true ꤷι̾礱Ƥ
    NULLͤιܤ fetch_hash/each_hash ưä

  1999-02-01	2.1.2
    Mysql#refresh()  Mysql::REFRESH_* ɲá
    MySQL 3.21.xx ˤб(Ĥ)

  1999-01-24	2.1.1
    MysqlError#error(), MysqlError#errno() ɲá
    MysqlError::CR_* ɲá

  1999-01-17	2.1
    fetch_hash, each_hash  C ˰ư
    MysqlField#hash() ɲá
    escape_string, get_client_info 򥪥֥ȥ᥽åɤȤƤ
      Ȥ褦ˤ

  1998-11-29	2.0.1
    fetch_hash, each_hash  with_table ɲá
    äѤ get_* ᥽å̾ C API Ʊˤ
    mysql-compat.rb  alias ǽľ
    Mysql  CLIENT_*  MysqlField ˤʤäƤ

  1998-11-15	2.0
    ᥽å̾ C API Ʊˤ
    C++ Ǥ̤褦˽ľ

  1998-08-13	1.0
    С

[]

  e-mail: ȤߤޤҤ <tommy@tmtm.org>
  http://www.tmtm.org/mysql/