
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
ruby-mysql-ext
Advanced tools
= ruby-mysql
== Description
MySQL connector for Ruby.
== Installation
ruby setup.rb
=== Gem Installation
gem install ruby-mysql
== Features/Problems
Ruby だけで書かれているのでコンパイル不要です。
Ruby 1.9.x の M17N に対応しています。
MySQL/Ruby 2.8.x とほぼ互換があります。
== Synopsis
使用例:
my = Mysql.connect('hostname', 'username', 'password', 'dbname') my.query("select col1, col2 from tblname").each do |col1, col2| p col1, col2 end stmt = my.prepare('insert into tblname (col1,col2) values (?,?)') stmt.execute 123, 'abc'
== Incompatible with MySQL/Ruby 2.8.x
Ruby 1.8.x ではシフトJISのような安全でないマルチバイト文字セットに対して Mysql#escape_string を使用すると例外が発生します。
いくつかのメソッドがありません: Mysql#debug, Mysql#change_user, Mysql#create_db, Mysql#drop_db, Mysql#dump_debug_info, Mysql#ssl_set, Mysql#reconnect
Mysql#options でサポートしているオプションは次のものだけです: Mysql::INIT_COMMAND, Mysql::OPT_CONNECT_TIMEOUT, Mysql::OPT_LOCAL_INFILE, Mysql::OPT_READ_TIMEOUT, Mysql::OPT_WRITE_TIMEOUT, Mysql::SET_CHARSET_NAME. これら以外を指定すると "option not implementted" という warning が標準エラー出力に出力されます。
Mysql#use_result は Mysql#store_result と同じです。つまりサーバーから一気に結果セットを読み込みます。
== Improvement from MySQL/Ruby 2.8.x
Ruby 1.9.x の M17N に対応しています。 mysqld へのクエリ文字列やプリペアドステートメントで与える値は mysqld との接続の文字コードに自動的に変換されます。 mysqld からの結果文字列は接続文字コードとして取り出されます。
Mysql::Result, Mysql::Stmt が Enumerable を include しています。
ブロックなしの Mysql::Result#each, each_hash Mysql::Stmt#each, each_hash が Enumerator を返します。
Mysql#charset= で接続 charset を指定できます。
Mysql::Error だけでなく、エラー種別ごとにエラークラスが用意されてます。たとえば、構文エラーの場合は Mysql::ServerError::ParseError など。これらのエラーは Mysql::Error の継承クラスです。
== Copyright
Author :: TOMITA Masahiro tommy@tmtm.org Copyright :: Copyright (c) 2009-2012 TOMITA Masahiro License :: Ruby's
FAQs
Unknown package
We found that ruby-mysql-ext demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.