Socket
Book a DemoInstallSign in
Socket

mysql-pr

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-pr

2.9.11
bundlerRubygems
Version published
Maintainers
2
Created
Source

= mysql-pr

== Description

Pure Ruby MySQL connector.

== Features/Problems

  • Ruby だけで書かれているのでコンパイル不要です。

  • Ruby 1.9.x の M17N に対応しています。

  • MySQL/Ruby 2.8.x とほぼ互換があります。

== Synopsis

使用例:

my = MysqlPR.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のような安全でないマルチバイト文字セットに対して MysqlPR#escape_string を使用すると例外が発生します。

  • いくつかのメソッドがありません: MysqlPR#debug, MysqlPR#change_user, MysqlPR#create_db, MysqlPR#drop_db, MysqlPR#dump_debug_info, MysqlPR#ssl_set, MysqlPR#reconnect

  • MysqlPR#options でサポートしているオプションは次のものだけです: MysqlPR::INIT_COMMAND, MysqlPR::OPT_CONNECT_TIMEOUT, MysqlPR::OPT_LOCAL_INFILE, MysqlPR::OPT_READ_TIMEOUT, MysqlPR::OPT_WRITE_TIMEOUT, MysqlPR::SET_CHARSET_NAME. これら以外を指定すると "option not implementted" という warning が標準エラー出力に出力されます。

  • MysqlPR#use_result は MysqlPR#store_result と同じです。つまりサーバーから一気に結果セットを読み込みます。

== Improvement from MySQL/Ruby 2.8.x

  • Ruby 1.9.x の M17N に対応しています。 mysqld へのクエリ文字列やプリペアドステートメントで与える値は mysqld との接続の文字コードに自動的に変換されます。 mysqld からの結果文字列は接続文字コードとして取り出されます。

  • MysqlPR::Result, MysqlPR::Stmt が Enumerable を include しています。

  • ブロックなしの MysqlPR::Result#each, each_hash MysqlPR::Stmt#each, each_hash が Enumerator を返します。

  • MysqlPR#charset= で接続 charset を指定できます。

  • MysqlPR::Error だけでなく、エラー種別ごとにエラークラスが用意されてます。たとえば、構文エラーの場合は MysqlPR::ServerError::ParseError など。これらのエラーは MysqlPR::Error の継承クラスです。

== Copyright

Authors :: TOMITA Masahiro tommy@tmtm.org, Alex Jokela alex@camulus.com Copyright :: Copyright (c) 2009-2012 TOMITA Masahiro, Copyright (c) 2012 Alex Jokela License :: Ruby's

FAQs

Package last updated on 27 Jun 2012

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.