diff --git a/reference/pdo/pdo/connect.xml b/reference/pdo/pdo/connect.xml index d5a9f72c9b..42be67ddaa 100644 --- a/reference/pdo/pdo/connect.xml +++ b/reference/pdo/pdo/connect.xml @@ -5,7 +5,7 @@ PDO::connect - Connect to a database and return a PDO subclass for drivers that support it + データベースに接続しドライバが対応する PDO サブクラスを返す @@ -18,9 +18,9 @@ arraynulloptions&null; - Creates an instance of a PDO subclass for the - database being connection if it exists, - otherwise return a generic PDO instance. + 接続するデータベースに対応する PDO サブクラスが + 存在する場合そのインスタンスを、 + 存在しない場合は汎用的な PDO インスタンスを作成します。 @@ -31,9 +31,9 @@ &reftitle.returnvalues; - Returns an instance of a PDO subclass for the - corresponding PDO driver if it exists, - or a generic PDO instance. + 接続するデータベースに対応する PDO サブクラスが + 存在する場合そのインスタンス、 + または汎用的な PDO インスタンスを返します。 diff --git a/reference/pdo/pdo/construct.xml b/reference/pdo/pdo/construct.xml index b6d294693b..09eb6bb6c5 100644 --- a/reference/pdo/pdo/construct.xml +++ b/reference/pdo/pdo/construct.xml @@ -112,7 +112,6 @@ &reftitle.errors; - PDO::__construct は、 指定されたデータベースへの接続に失敗した場合、 PDO::ATTR_ERRMODE が設定されているかどうかに関わらず、 PDOException をスローします。 diff --git a/reference/pdo_dblib/pdo-dblib.xml b/reference/pdo_dblib/pdo-dblib.xml index 35153e0c8c..fa41b1e658 100644 --- a/reference/pdo_dblib/pdo-dblib.xml +++ b/reference/pdo_dblib/pdo-dblib.xml @@ -3,7 +3,7 @@ - The Pdo\Dblib class + Pdo\Dblib クラス Pdo\Dblib @@ -12,8 +12,7 @@
&reftitle.intro; - A PDO subclass representing a connection using - the DBLib PDO driver. + DBLib PDO ドライバによる接続を示す PDO サブクラスです。
diff --git a/reference/pdo_firebird/constants.xml b/reference/pdo_firebird/constants.xml index fee51f4331..65d984f440 100644 --- a/reference/pdo_firebird/constants.xml +++ b/reference/pdo_firebird/constants.xml @@ -11,7 +11,7 @@ - Pdo\Firebird::ATTR_DATE_FORMAT &Alias;。 + Pdo\Firebird::ATTR_DATE_FORMAT &Alias; @@ -22,7 +22,7 @@ - Pdo\Firebird::ATTR_DATE_FORMAT &Alias;。 + Pdo\Firebird::ATTR_TIME_FORMAT &Alias; @@ -33,7 +33,7 @@ - Pdo\Firebird::ATTR_TIMESTAMP_FORMAT &Alias;。 + Pdo\Firebird::ATTR_TIMESTAMP_FORMAT &Alias; diff --git a/reference/pdo_firebird/pdo-firebird.xml b/reference/pdo_firebird/pdo-firebird.xml index 49294f3232..6cceeb0700 100644 --- a/reference/pdo_firebird/pdo-firebird.xml +++ b/reference/pdo_firebird/pdo-firebird.xml @@ -1,9 +1,9 @@ - + - The Pdo\Firebird class + Pdo\Firebird クラス Pdo\Firebird @@ -12,8 +12,7 @@
&reftitle.intro; - A PDO subclass representing a connection using - the Firebird PDO driver. + Firebird PDO ドライバによる接続を示す PDO サブクラスです。
@@ -110,7 +109,7 @@ Pdo\Firebird::ATTR_DATE_FORMAT - Sets the date format. + 日付フォーマットを設定します。 @@ -118,7 +117,7 @@ Pdo\Firebird::ATTR_TIME_FORMAT - Sets the time format. + 時刻フォーマットを設定します。 @@ -126,7 +125,7 @@ Pdo\Firebird::ATTR_TIMESTAMP_FORMAT - Sets the timestamp format. + タイムスタンプフォーマットを設定します。 @@ -134,10 +133,10 @@ Pdo\Firebird::TRANSACTION_ISOLATION_LEVEL - Attribute to sets the transaction isolation level. - This can be one of Pdo\Firebird::READ_COMMITTED, - Pdo\Firebird::REPEATABLE_READ, - or Pdo\Firebird::SERIALIZABLE. + トランザクション分離レベルを設定します。 + Pdo\Firebird::READ_COMMITTED、 + Pdo\Firebird::REPEATABLE_READ、 + または Pdo\Firebird::SERIALIZABLE のいずれかです。 @@ -145,9 +144,9 @@ Pdo\Firebird::READ_COMMITTED - Flag denoting the ANSI transaction isolation - level is read commited. - This is the default behavior. + ANSI トランザクション分離レベルが + Read Committed であることを示すフラグです。 + これがデフォルトの動作です。 @@ -155,9 +154,9 @@ Pdo\Firebird::REPEATABLE_READ - Flag denoting the ANSI transaction isolation - level is repeatable read. - This corresponds to Firebird's "snapshot" isolation level. + ANSI トランザクション分離レベルが + Repeatable Read であることを示すフラグです。 + Firebird の "snapshot" 分離レベルに相当します。 @@ -165,9 +164,9 @@ Pdo\Firebird::SERIALIZABLE - Flag denoting the ANSI transaction isolation - level is serializable. - This corresponds to Firebird's "snapshot table stability" isolation level. + ANSI トランザクション分離レベルが + Serializeable であることを示すフラグです。 + Firebird の "snapshot table stability" 分離レベルに相当します。 @@ -175,9 +174,9 @@ Pdo\Firebird::WRITABLE_TRANSACTION - Boolean attribute used to toggle the transaction access mode between - READ ONLY and READ WRITE. - By default, it is &true; indicating READ WRITE. + ブール値で、トランザクションアクセスモードを + READ ONLY または READ WRITE に設定します。 + デフォルトは &true; で、READ WRITE を表します。 diff --git a/reference/pdo_firebird/pdo/firebird/getapiversion.xml b/reference/pdo_firebird/pdo/firebird/getapiversion.xml index ca061a8b2f..932258ccce 100644 --- a/reference/pdo_firebird/pdo/firebird/getapiversion.xml +++ b/reference/pdo_firebird/pdo/firebird/getapiversion.xml @@ -5,7 +5,7 @@ Pdo\Firebird::getApiVersion - Get the API version + APIバージョンを取得する @@ -15,8 +15,8 @@ - Returns the Firebird API version as defined by the C constant - FB_API_VER in ibase.h. + ibase.h 内で C 定数 FB_API_VER として定義されている + Firebird API のバージョンを返します。 @@ -28,7 +28,7 @@ &reftitle.returnvalues; - Returns the FireBird API as an int. + FireBird API のバージョンを int 型で返します。 diff --git a/reference/pdo_mysql/configure.xml b/reference/pdo_mysql/configure.xml index f190f320a7..6a69824529 100644 --- a/reference/pdo_mysql/configure.xml +++ b/reference/pdo_mysql/configure.xml @@ -50,9 +50,10 @@ $ ./configure --with-pdo-mysql --with-mysql-sock=/var/mysql/mysql.sock
- SSL サポートを有効にするには、適切な PDO_MySQL 定数 + SSL サポートを有効にするには、適切な + Pdo\Mysql::ATTR_SSL_* を指定します。これは MySQL C API 関数 mysql_ssl_set() - をコールするのと同じ意味になります。また、SSL を PDO::setAttribute + をコールするのと同じ意味になります。また、SSL を PDO::setAttribute で有効にすることはできません。というのも、この時点ではすでに接続が確立されてしまっているからです。 MySQL のドキュメントで SSL を使った MySQL への接続 について確認しましょう。 diff --git a/reference/pdo_mysql/constants.xml b/reference/pdo_mysql/constants.xml index e55db2e836..e311bfa82e 100644 --- a/reference/pdo_mysql/constants.xml +++ b/reference/pdo_mysql/constants.xml @@ -9,33 +9,12 @@ PDO::MYSQL_ATTR_USE_BUFFERED_QUERY - (bool) + (int) - デフォルトでは、全てのステートメントが - バッファモード. - で実行されます。 - この値を &false; に設定すると、 - PDO オブジェクトの場合、 - MySQL ドライバは非バッファモードを使います。 + Pdo\Mysql::ATTR_USE_BUFFERED_QUERY &Alias; - - MySQL の非バッファモードを使う - -setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false); -$unbufferedResult = $pdo->query("SELECT Name FROM City"); -foreach ($unbufferedResult as $row) { - echo $row['Name'] . PHP_EOL; -} -?> -]]> - - - @@ -44,46 +23,32 @@ foreach ($unbufferedResult as $row) { (int) - - LOAD LOCAL INFILE を有効にします。 - - - この定数を使うのは、新しいデータベースハンドルを作るときの - driver_options 配列内だけであることに注意しましょう。 - + + Pdo\Mysql::ATTR_LOCAL_INFILE &Alias; + PDO::MYSQL_ATTR_LOCAL_INFILE_DIRECTORY - (string) + (int) - - LOCAL DATA 文によるファイルのロードを、 - ここで指定したディレクトリに制限する機能を有効にします。 + + Pdo\Mysql::ATTR_LOCAL_INFILE_DIRECTORY &Alias; PHP 8.1.0 以降で利用可能です。 - - - この定数を使うのは、新しいデータベースハンドルを作るときの - driver_options 配列内だけであることに注意しましょう。 - + PDO::MYSQL_ATTR_INIT_COMMAND - (string) + (int) - - MySQL サーバーへの接続時に実行するコマンドを指定します。 - 再接続の際には自動的に再実行されます。 - - - この定数を使うのは、新しいデータベースハンドルを作るときの - driver_options 配列内だけであることに注意しましょう。 - + + Pdo\Mysql::ATTR_INIT_COMMAND &Alias; + @@ -92,12 +57,9 @@ foreach ($unbufferedResult as $row) { (int) - - my.cnf ではなく、 - 指定した名前のファイルからオプションを読み込みます。 - このオプションは、mysqlnd を使っている場合は利用できません。 - mysqlnd は mysql の設定ファイルを読んでいないからです。 - + + Pdo\Mysql::ATTR_READ_DEFAULT_FILE &Alias; + @@ -106,13 +68,9 @@ foreach ($unbufferedResult as $row) { (int) - - my.cnf あるいは - 別のファイル (MYSQL_READ_DEFAULT_FILE - で指定したもの) の中の、指定した名前のグループからオプションを読み込みます。 - このオプションは、mysqlnd を使っている場合は利用できません。 - mysqlnd は mysql の設定ファイルを読んでいないからです。 - + + Pdo\Mysql::ATTR_READ_DEFAULT_GROUP &Alias; + @@ -121,10 +79,9 @@ foreach ($unbufferedResult as $row) { (int) - - バッファの最大サイズ。デフォルトは 1 MiB です。 - mysqlnd を指定してコンパイルした場合は、この定数はサポートされていません。 - + + Pdo\Mysql::ATTR_MAX_BUFFER_SIZE &Alias; + @@ -133,9 +90,9 @@ foreach ($unbufferedResult as $row) { (int) - - プリペアドステートメントではなく、直接クエリを実行します。 - + + PDO::ATTR_EMULATE_PREPARES &Alias; + @@ -144,9 +101,9 @@ foreach ($unbufferedResult as $row) { (int) - - 変更された行数ではなく、見つかった (マッチした) 行数を返します。 - + + Pdo\Mysql::ATTR_FOUND_ROWS &Alias; + @@ -155,10 +112,9 @@ foreach ($unbufferedResult as $row) { (int) - - 関数名の後に続く空白を許可します。 - すべての関数名を予約語にします。 - + + Pdo\Mysql::ATTR_IGNORE_SPACE &Alias; + @@ -167,9 +123,21 @@ foreach ($unbufferedResult as $row) { (int) - - ネットワーク通信の圧縮を有効にします。 - + + Pdo\Mysql::ATTR_COMPRESS &Alias; + + + + + + + PDO::MYSQL_ATTR_SERVER_PUBLIC_KEY + (int) + + + + Pdo\Mysql::ATTR_SERVER_PUBLIC_KEY &Alias; + @@ -179,9 +147,9 @@ foreach ($unbufferedResult as $row) { (int) - - SSL 認証局のファイルパス。 - + + Pdo\Mysql::ATTR_SSL_CA &Alias; + @@ -191,10 +159,9 @@ foreach ($unbufferedResult as $row) { (int) - - 信頼済みのSSL認証局の証明書が入ったディレクトリパス。 - 証明書は、PEM フォーマットで格納されています。 - + + Pdo\Mysql::ATTR_SSL_CAPATH &Alias; + @@ -204,9 +171,9 @@ foreach ($unbufferedResult as $row) { (int) - - SSL 証明書のファイルパス。 - + + Pdo\Mysql::ATTR_SSL_CERT &Alias; + @@ -216,11 +183,9 @@ foreach ($unbufferedResult as $row) { (int) - - SSL 暗号化に使うひとつ以上の暗号の一覧。 - OpenSSL で有効なフォーマットで指定します。 - 例: DHE-RSA-AES256-SHA:AES128-SHA - + + Pdo\Mysql::ATTR_SSL_CIPHER &Alias; + @@ -230,9 +195,9 @@ foreach ($unbufferedResult as $row) { (int) - - SSL キーのファイルパス。 - + + Pdo\Mysql::ATTR_SSL_KEY &Alias; + @@ -242,13 +207,9 @@ foreach ($unbufferedResult as $row) { (int) - - サーバーの SSL 証明書の検証を無効にする方法を提供します。 - このオプションは、mysqlnd でのみ利用可能です。 - - - &version.exists.asof; 7.0.18 および PHP 7.1.4. - + + Pdo\Mysql::ATTR_SSL_VERIFY_SERVER_CERT &Alias; + @@ -258,14 +219,9 @@ foreach ($unbufferedResult as $row) { (int) - - &false; にすると、PDO::prepare - や PDO::query でのマルチクエリの実行を無効にします。 - - - この定数が使えるのは、データベースハンドルを新規作成する際の driver_options - 配列内だけであることに注意しましょう。 - + + Pdo\Mysql::ATTR_MULTI_STATEMENTS &Alias; + diff --git a/reference/pdo_mysql/pdo-mysql.xml b/reference/pdo_mysql/pdo-mysql.xml index f503b2b52c..8affebdc06 100644 --- a/reference/pdo_mysql/pdo-mysql.xml +++ b/reference/pdo_mysql/pdo-mysql.xml @@ -1,9 +1,9 @@ - + - The Pdo\Mysql class + Pdo\Mysql クラス Pdo\Mysql @@ -12,26 +12,25 @@
&reftitle.intro; - A PDO subclass representing a connection using - the MySQL PDO driver. + MySQL PDO ドライバによる接続を示す PDO サブクラスです。 - This driver supports a dedicated SQL query parser for the MySQL dialect. - It can handle the following: + このドライバは MySQL 方言向けに専用の SQL クエリパーサーをサポートしています。 + 次のものを処理可能です: - Single and double-quoted literals with both doubling and backslash as escaping mechanisms + シングルクオートやダブルクオートで囲まれたリテラルでのクオートの二重化やバックスラッシュによるエスケープ - Backtick literals with doubling as escaping mechanism + バッククオートで囲まれたリテラルでのクオートの二重化によるエスケープ - Two-dashes, C-style comments, and Hash-comments. + 2 つのハイフン、C スタイルのコメント、# によるコメント @@ -198,13 +197,14 @@ Pdo\Mysql::ATTR_USE_BUFFERED_QUERY - By default all statements are executed in - buffered mode. - If this attribute is set to &false; on a - Pdo\Mysql object, - the MySQL driver will use the unbuffered mode. + デフォルトでは、全てのステートメントが + バッファモード + で実行されます。 + この値を &false; に設定すると、 + Pdo\Mysql オブジェクトの + MySQL ドライバは非バッファモードを使います。 - Setting MySQL unbuffered mode + MySQL の非バッファモードを使う Pdo\Mysql::ATTR_LOCAL_INFILE - Enable LOAD LOCAL INFILE. + LOAD LOCAL INFILE を有効にします。 - Can only be used in the driver_options - array when constructing a new database handle. + この定数を使えるのは、新しいデータベースハンドルを作るときの + driver_options 配列内に限ります。 @@ -239,9 +239,9 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_LOCAL_INFILE_DIRECTORY - Allows restricting LOCAL DATA loading to files located in this - designated directory. - Available as of PHP 8.1.0. + LOCAL DATA 文によるファイルのロードを、 + ここで指定したディレクトリのみに制限します。 + PHP 8.1.0 以降で利用可能です。 @@ -252,8 +252,8 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_INIT_COMMAND - Command to execute when connecting to the MySQL server. - Will automatically be re-executed when reconnecting. + MySQL サーバーへの接続時に実行するコマンドを指定します。 + 再接続の際には自動的に再実行されます。 @@ -264,13 +264,13 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_READ_DEFAULT_FILE - Read options from the named option file instead of from - my.cnf. + my.cnf ではなく、 + 指定した名前のファイルからオプションを読み込みます。 - This option is not available if mysqlnd is used, - because mysqlnd does not read the mysql configuration files. + このオプションは、mysqlnd を使っている場合は利用できません。 + mysqlnd は mysql の設定ファイルを読んでいないからです。 @@ -279,14 +279,14 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_READ_DEFAULT_GROUP - Read options from the named group from my.cnf or - the file specified with - Pdo\Mysql::ATTR_READ_DEFAULT_FILE. + my.cnf あるいは + 別のファイル (Pdo\Mysql::ATTR_READ_DEFAULT_FILE + で指定したもの) の中の、指定した名前のグループからオプションを読み込みます。 - This option is not available if mysqlnd is used, - because mysqlnd does not read the mysql configuration files. + このオプションは、mysqlnd を使っている場合は利用できません。 + mysqlnd は mysql の設定ファイルを読んでいないからです。 @@ -295,7 +295,7 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_COMPRESS - Enable network communication compression. + ネットワーク通信の圧縮を有効にします。 @@ -303,7 +303,7 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_DIRECT_QUERY - &Alias; PDO::ATTR_EMULATE_PREPARES. + PDO::ATTR_EMULATE_PREPARES &Alias; @@ -311,8 +311,8 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_FOUND_ROWS - Return the number of found (matched) rows, - not the number of changed rows. + 変更された行数ではなく、 + 見つかった (マッチした) 行数を返します。 @@ -323,8 +323,8 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_IGNORE_SPACE - Permit spaces after SQL function names. - Makes all SQL functions names reserved words. + 関数名の後に続く空白を許可します。 + すべての関数名が予約語になります。 @@ -335,11 +335,11 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_MAX_BUFFER_SIZE - Maximum buffer size. Defaults to 1 MiB. + バッファの最大サイズ。デフォルトは 1 MiB です。 - This constant is not supported when compiled against mysqlnd. + mysqlnd を指定してコンパイルした場合は、この定数はサポートされていません。 @@ -348,9 +348,9 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_MULTI_STATEMENTS - Disables multi query execution in both - PDO::prepare and - PDO::query when set to &false;. + &false; にすると、 + PDO::prepareや + PDO::query でのマルチクエリの実行を無効にします。 @@ -361,7 +361,7 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_SERVER_PUBLIC_KEY - RSA public key file used with the SHA-256 based authentication. + SHA-256 ベースの認証で使用する RSA 公開鍵ファイル。 @@ -372,7 +372,7 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_SSL_KEY - The file path to the SSL key. + SSL キーのファイルパス。 @@ -383,7 +383,7 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_SSL_CERT - The file path to the SSL certificate. + SSL 証明書のファイルパス。 @@ -394,7 +394,7 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_SSL_CA - The file path to the SSL certificate authority. + SSL 認証局のファイルパス。 @@ -405,9 +405,9 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_SSL_CAPATH - The file path to the directory that contains the trusted - SSL CA certificates, - which are stored in PEM format. + 信頼済みの + SSL CA 証明書が入ったディレクトリパス。 + 証明書は、PEM フォーマットで格納されています。 @@ -418,9 +418,9 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_SSL_CIPHER - A list of one or more permissible ciphers to use for - SSL encryption, in a format understood by OpenSSL. - For example: DHE-RSA-AES256-SHA:AES128-SHA + SSL 暗号化に使うひとつ以上の暗号の一覧。 + OpenSSL で有効なフォーマットで指定します。 + 例: DHE-RSA-AES256-SHA:AES128-SHA @@ -431,12 +431,12 @@ foreach ($unbufferedResult as $row) { Pdo\Mysql::ATTR_SSL_VERIFY_SERVER_CERT - Provides a way to disable verification of the server SSL certificate. - Available as of PHP 7.0.18 and PHP 7.1.4. + サーバーの SSL 証明書の検証を無効にする方法を提供します。 + PHP 7.0.18 および PHP 7.1.4 以降で使用できます。 - This option is available only with mysqlnd. + このオプションは、mysqlnd でのみ利用可能です。 diff --git a/reference/pdo_mysql/pdo/mysql/getwarningcount.xml b/reference/pdo_mysql/pdo/mysql/getwarningcount.xml index 7a42ea4eb0..0696ce7a3f 100644 --- a/reference/pdo_mysql/pdo/mysql/getwarningcount.xml +++ b/reference/pdo_mysql/pdo/mysql/getwarningcount.xml @@ -5,7 +5,7 @@ Pdo\Mysql::getWarningCount - Returns the number of warnings from the last executed query + 最後に実行したクエリの警告の数を返す @@ -15,12 +15,12 @@ - Returns the number of warnings from the last executed query. + 最後に実行したクエリの警告の数を返します。 - For retrieving warning messages the following SQL command can be used: - SHOW WARNINGS [limit row_count]. + 警告メッセージを取得するには、次の SQL コマンドを使用できます: + SHOW WARNINGS [limit row_count] @@ -33,14 +33,14 @@ &reftitle.returnvalues; - Returns an int representing the number of warnings generated by the last query. + 最後に実行したクエリで発生した警告の数を int で返します。 &reftitle.examples; - <methodname>Pdo\Mysql::getWarningCount</methodname> example + <methodname>Pdo\Mysql::getWarningCount</methodname> の例 int) - - このオプションは、ODBC のカーソルライブラリが使うかを制御します。 - ODBC カーソルライブラリは、ドライバが実装していない高度なODBCの機能 - (例: スクロール可能なブロックカーソル) をいくつかサポートします。 - サポートしている値は以下の通りです: - - - - PDO::ODBC_SQL_USE_IF_NEEDED (デフォルト): - ODBC カーソルライブラリを必要な時に使います。 - - - - - PDO::ODBC_SQL_USE_DRIVER: - ODBC カーソルライブラリを使いません。 - - - - - PDO::ODBC_SQL_USE_ODBC: - ODBC カーソルライブラリを常に使います。 - - - - + + Pdo\Odbc::ATTR_USE_CURSOR_LIBRARY &Alias; + + + + + + PDO::ODBC_SQL_USE_IF_NEEDED + (int) + + + + Pdo\Odbc::SQL_USE_IF_NEEDED &Alias; + + + + + + PDO::ODBC_SQL_USE_DRIVER + (int) + + + + Pdo\Odbc::SQL_USE_DRIVER &Alias; + + + + + + PDO::ODBC_SQL_USE_ODBC + (int) + + + + Pdo\Odbc::SQL_USE_ODBC &Alias; + @@ -57,15 +67,9 @@ (bool) - - Windows のみ有効です。 - &true; の場合、UTF-16 でエンコードされた文字データ( - CHAR, - VARCHAR, LONGVARCHAR) を - データベースから読み取ったり、書き込んだりする際に UTF-8 に変換します。 - &false; の場合(デフォルト)、 - エンコーディングの変換はドライバが行う可能性があります。 - + + Pdo\Odbc::ATTR_ASSUME_UTF8 &Alias; + diff --git a/reference/pdo_odbc/pdo-odbc.xml b/reference/pdo_odbc/pdo-odbc.xml index 6d5f0a548f..8857d4be51 100644 --- a/reference/pdo_odbc/pdo-odbc.xml +++ b/reference/pdo_odbc/pdo-odbc.xml @@ -1,9 +1,9 @@ - + - The Pdo\Odbc class + Pdo\Odbc クラス Pdo\Odbc @@ -12,8 +12,7 @@
&reftitle.intro; - A PDO subclass representing a connection using - the ODBC PDO driver. + ODBC PDO ドライバによる接続を示す PDO サブクラスです。
@@ -88,18 +87,18 @@ Pdo\Odbc::ATTR_USE_CURSOR_LIBRARY - This option controls whether the ODBC cursor library is used. - The ODBC cursor library supports some advanced ODBC features - (e.g. block scrollable cursors), - which may not be implemented by the driver. - The following values are supported: + このオプションは、ODBC のカーソルライブラリが使うかを制御します。 + ODBC カーソルライブラリは、ドライバが実装していない高度なODBCの機能 + (例: スクロール可能なブロックカーソル) + をいくつかサポートします。 + サポートしている値は次の通りです: Pdo\Odbc::SQL_USE_IF_NEEDED - Use the ODBC cursor library when needed. - This is the default. + 必要な場合にのみ ODBC カーソルライブラリを使用します。 + これがデフォルトです。 @@ -107,7 +106,7 @@ Pdo\Odbc::SQL_USE_DRIVER - Never use the ODBC cursor library. + ODBC カーソルライブラリを使用しません。 @@ -115,7 +114,7 @@ Pdo\Odbc::SQL_USE_ODBC - Always use the ODBC cursor library. + 常に ODBC カーソルライブラリを使用します。 @@ -127,11 +126,11 @@ Pdo\Odbc::ATTR_ASSUME_UTF8 - Windows only. - If &true;, UTF-16 encoded character data (CHAR, - VARCHAR and LONGVARCHAR) - is converted to UTF-8 when reading from or writing data to the database. - If &false; (the default), character encoding conversion may be done by the driver. + Windows のみ有効です。 + &true; の場合、UTF-16 でエンコードされた文字データ(CHAR, + VARCHAR, LONGVARCHAR) を + データベースから読み取ったり、書き込んだりする際に UTF-8 に変換します。 + &false; の場合(デフォルト)、エンコーディングの変換はドライバが行う可能性があります。 diff --git a/reference/pdo_pgsql/PDO/pgsql/copyfromarray.xml b/reference/pdo_pgsql/PDO/pgsql/copyfromarray.xml index 235c1882d7..2019e69a36 100644 --- a/reference/pdo_pgsql/PDO/pgsql/copyfromarray.xml +++ b/reference/pdo_pgsql/PDO/pgsql/copyfromarray.xml @@ -1,11 +1,11 @@ - + Pdo\Pgsql::copyFromArray - Copy data from a PHP array into a table + PHP の配列から、データをテーブルにコピーする @@ -19,9 +19,9 @@ stringnullfields&null; - Copies data from rows array to table - tableName using separator - as fields delimiter and fields list. + rows 配列からデータをテーブル + tableName にコピーします。その際、separator を + フィールドのデリミタ、そして fields のリストを使います。 @@ -32,7 +32,7 @@ tableName - String containing table name. + テーブル名を含む文字列 @@ -40,8 +40,7 @@ rows - An indexed array of strings with fields - separated by separator. + separator で区切られたフィールドの文字列の配列 @@ -49,8 +48,8 @@ separator - Delimiter used to separate fields in an entry of the - rows array. + rows 配列の各要素の中で + フィールドを分割するためのデリミタ @@ -58,7 +57,7 @@ nullAs - How to interpret SQL NULL values. + SQLの NULL 値をどのように扱うかを指定します @@ -66,7 +65,7 @@ fields - List of fields to insert. + 挿入するフィールドの一覧 diff --git a/reference/pdo_pgsql/PDO/pgsql/copyfromfile.xml b/reference/pdo_pgsql/PDO/pgsql/copyfromfile.xml index 0f4b2116c9..260e02cede 100644 --- a/reference/pdo_pgsql/PDO/pgsql/copyfromfile.xml +++ b/reference/pdo_pgsql/PDO/pgsql/copyfromfile.xml @@ -1,11 +1,11 @@ - + Pdo\Pgsql::copyFromFile - Copy data from file into table + ファイルからデータをテーブルにコピーする @@ -19,9 +19,9 @@ stringnullfields&null; - Copies data from file specified by filename - into table tableName using - separator as fields delimiter and fields list + filename で指定されたファイルからデータを + テーブル tableName にコピーします。その際、 + separator をフィールドのデリミタ、そして fields のリストを使います。 @@ -35,7 +35,7 @@ filename - Filename containing the data to import. + インポートするデータを含むファイル名 diff --git a/reference/pdo_pgsql/PDO/pgsql/copytoarray.xml b/reference/pdo_pgsql/PDO/pgsql/copytoarray.xml index 34c5e8d78b..30a74390ad 100644 --- a/reference/pdo_pgsql/PDO/pgsql/copytoarray.xml +++ b/reference/pdo_pgsql/PDO/pgsql/copytoarray.xml @@ -5,7 +5,7 @@ Pdo\Pgsql::copyToArray - Copy data from database table into PHP array + データベーステーブルからのデータをPHPの配列にコピーする @@ -18,7 +18,7 @@ stringnullfields&null; - Copies data from tableName into array using delimiter as fields delimiter and fields list + tableName のデータを配列にコピーします。その際、separator をフィールドのデリミタ、そして fields のリストを使います。 @@ -38,7 +38,7 @@ fields - List of fields to export. + エクスポートするフィールドの一覧 @@ -48,7 +48,7 @@ &reftitle.returnvalues; - Returns an array of rows,&return.falseforfailure;. + 行の配列を返します。&return.falseforfailure; diff --git a/reference/pdo_pgsql/PDO/pgsql/copytofile.xml b/reference/pdo_pgsql/PDO/pgsql/copytofile.xml index 782185a1f3..c09e197b43 100644 --- a/reference/pdo_pgsql/PDO/pgsql/copytofile.xml +++ b/reference/pdo_pgsql/PDO/pgsql/copytofile.xml @@ -1,11 +1,11 @@ - + Pdo\Pgsql::copyToFile - Copy data from table into file + テーブルのデータをファイルにコピーする @@ -19,9 +19,9 @@ stringnullfields&null; - Copies data from table into file specified by filename - using separator as fields delimiter and - fields list. + filename で指定されたファイルに、テーブルからデータをコピーします。 + その際、separator をフィールドのデリミタ、そして + fields のリストを使います。 @@ -35,7 +35,7 @@ filename - Filename to export data. + エキスポートするファイル名 @@ -49,7 +49,7 @@ fields - List of fields to insert. + 挿入するフィールドの一覧 diff --git a/reference/pdo_pgsql/PDO/pgsql/escapeidentifier.xml b/reference/pdo_pgsql/PDO/pgsql/escapeidentifier.xml index d141f3e8ff..8842adec6d 100644 --- a/reference/pdo_pgsql/PDO/pgsql/escapeidentifier.xml +++ b/reference/pdo_pgsql/PDO/pgsql/escapeidentifier.xml @@ -5,7 +5,7 @@ Pdo\Pgsql::escapeIdentifier - Escapes a string for use as an SQL identifier + SQL識別子として使用するために文字列をエスケープする @@ -15,10 +15,10 @@ stringinput - Escapes a string for use as an SQL identifier, such as a table, column, or function name. - This is useful when a user-supplied identifier might contain special characters - that would otherwise not be interpreted as part of the identifier by the SQL parser, - or when the identifier might contain upper case characters whose case should be preserved. + テーブル名、カラム名、または関数名など、SQL の識別子として使用する文字列をエスケープします。 + これは、ユーザーから提供された識別子が特殊文字を含むため、 + SQLパーサーが識別子の一部として解釈できない場合や、 + 大文字を含む識別子でそれを保持したい場合に有用です。 @@ -29,7 +29,7 @@ input - A string containing text to be escaped. + エスケープ対象の文字列(string) @@ -39,14 +39,14 @@ &reftitle.returnvalues; - A string containing the escaped data. + エスケープされた文字列(string) を返します。 &reftitle.examples; - <methodname>Pdo\Pgsql::escapeIdentifier</methodname> example + <methodname>Pdo\Pgsql::escapeIdentifier</methodname> の例 - + Pdo\Pgsql::getNotify - Get asynchronous notification + 非同期に通知を取得する @@ -16,7 +16,7 @@ inttimeoutMilliseconds0 - Returns a result set representing a pending asynchronous notification. + 保留中の非同期な通知を示す結果セットを返します。 @@ -27,8 +27,8 @@ fetchMode - The format the result set should be returned as, - one of the following constants: + 結果セットを返すフォーマット。 + 次のいずれかの定数: PDO::FETCH_DEFAULT PDO::FETCH_BOTH @@ -42,7 +42,7 @@ timeoutMilliseconds - The length of time to wait for a response, in milliseconds. + レスポンスを待つ時間の長さ。ミリ秒で指定します。 @@ -52,29 +52,27 @@ &reftitle.returnvalues; - If one or more notifications is pending, returns a single row, - with fields message and pid, - otherwise returns &false;. + ひとつ以上の通知が保留中だった場合、 + messagepid のフィールドを含む1行を返します。 + そうでなければ &false; を返します。 &reftitle.errors; - A ValueError is thrown if - fetchMode is not one of the valid + fetchMode が有効な PDO::FETCH_* - constants. + 定数のいずれでもない場合、ValueError がスローされます。 - A ValueError is thrown if - timeoutMilliseconds is less than 0. + timeoutMilliseconds0 未満の場合、 + ValueError がスローされます。 - A E_WARNING is raised when - timeoutMilliseconds is greater than the value - that can be contained in a signed 32-bit integer, in which case it will be - the maximum value of a signed 32-bit integer. + timeoutMilliseconds が符号付き32ビットの整数に + 収まらない場合、E_WARNING が発生し、 + その値は符号付き32ビットの整数の最大値に丸められます。 diff --git a/reference/pdo_pgsql/PDO/pgsql/getpid.xml b/reference/pdo_pgsql/PDO/pgsql/getpid.xml index 5be3bb55df..7762cc4e36 100644 --- a/reference/pdo_pgsql/PDO/pgsql/getpid.xml +++ b/reference/pdo_pgsql/PDO/pgsql/getpid.xml @@ -5,7 +5,7 @@ Pdo\Pgsql::getPid - Get the PID of the backend process handling this connection + 接続を処理するバックエンドプロセスのPIDを取得する @@ -15,9 +15,9 @@ - Returns the PID of the backend process handling this connection. - Note that the PID belongs to a process executing on the database server host, - not the local host. + この接続を処理するバックエンドプロセスのPIDを返します。 + このPIDはローカルホストではなく、データベースサーバーが稼働するホスト上のプロセスを示す点に + 注意してください。 @@ -29,7 +29,7 @@ &reftitle.returnvalues; - Returns the PID as an int. + サーバーのPIDを int として返します。 diff --git a/reference/pdo_pgsql/PDO/pgsql/lobcreate.xml b/reference/pdo_pgsql/PDO/pgsql/lobcreate.xml index a95420eeda..7dfa7ff3d5 100644 --- a/reference/pdo_pgsql/PDO/pgsql/lobcreate.xml +++ b/reference/pdo_pgsql/PDO/pgsql/lobcreate.xml @@ -1,11 +1,11 @@ - + Pdo\Pgsql::lobCreate - Creates a new large object + 新しいラージオブジェクトを作成する @@ -15,30 +15,31 @@ - Pdo\Pgsql::lobCreate creates a large object - and returns the OID which refers to it. - It can be opened to read or write data with - Pdo\Pgsql::lobOpen. + Pdo\Pgsql::lobCreate は、 + ラージオブジェクトを作成してその OID を返します。 + このオブジェクトに対するデータの読み書きは、 + Pdo\Pgsql::lobOpen を使用します。 - The OID can be stored in columns of type OID and be used to reference - the large object, without causing the row to grow arbitrarily large. - The large object will continue to live in the database until it - is removed by calling Pdo\Pgsql::lobUnlink. + OID は OID 型のカラムに格納され、 + ラージオブジェクトを参照するために使用されます。 + これにより、行のサイズがどんどん拡大してしまうことを防ぎます。 + ラージオブジェクトは Pdo\Pgsql::lobUnlink を + コールして削除するまで、データベースに残り続けます。 - Large objects are cumbersome to use. - Indeed, it is required that Pdo\Pgsql::lobUnlink - is called prior to deleting the last row referencing the OID in the entire database; - otherwise, unreferenced large objects will remain on the server indefinitely. - Moreover, large objects have no access controls. - An alternative is the bytea column type, which can be up to 1GB in size, - and this column type transparently manages the storage for optimal row size. + ラージオブジェクトの取り扱いは複雑です。 + オブジェクトの OID を参照している行をデータベースから削除する際には、 + 必ず事前に PDO::pgsqlLOBUnlinkをコールしなければなりません。 + そうしないと、どこからも参照されないラージオブジェクトが、サーバに残り続けてしまうでしょう。 + さらに、ラージオブジェクトにはアクセス権を設定できません。 + 代替として、bytea 型のカラムも検討ください。最近のバージョンの PostgreSQL では + bytea 型のカラムに最大 1GBまで保存でき、行サイズを最適化したうえでデータを透過的に扱うことができます。 - This function, and all manipulations of the large object, - must be called and carried out within a transaction. + この関数を含むラージオブジェクトへの全ての操作は + トランザクション内で行わなければなりません。 @@ -51,19 +52,19 @@ &reftitle.returnvalues; - Returns the OID of the newly created large object on success, - &return.falseforfailure;. + 成功した場合、新しく作成されたラージオブジェクトの OID、 + &return.falseforfailure;。 &reftitle.examples; - <methodname>Pdo\Pgsql::lobCreate</methodname> example + <methodname>Pdo\Pgsql::lobCreate</methodname> の例 - This example creates a new large object and copies the contents - of a file into it. - The OID is then stored into a table. + この例では、新しいラージオブジェクトを作成し、 + ファイルの内容をそこにコピーします。その後、 + OID がテーブルに保存されます。 Pdo\Pgsql::lobOpen - Opens an existing large object stream + 既存のラージオブジェクトのストリームをオープンする @@ -16,11 +16,11 @@ stringmode"rb" - Pdo\Pgsql::lobOpen opens a stream to access - the data referenced by oid. - All usual filesystem functions, such as fread, - fwrite or fgets can be used - to manipulate the contents of the stream. + Pdo\Pgsql::lobOpen は、oid + が指すデータにアクセスするためのストリームをオープンします。 + freadfwrite および + fgets などの通常のファイルシステム関数を使用して、 + ストリームの内容を操作することができます。 @@ -34,7 +34,7 @@ oid - A large object identifier. + ラージオブジェクトの ID。 @@ -42,8 +42,8 @@ mode - If mode is r, open the stream for reading. - If mode is w, open the stream for writing. + モードが r の場合、読み込み用のストリームをオープンします。 + モードが w の場合、書き込み用のストリームをオープンします。 @@ -53,26 +53,26 @@ &reftitle.returnvalues; - Returns a stream resource on success,&return.falseforfailure;. + 成功した場合にストリームリソース、&return.falseforfailure;。 &reftitle.errors; - When does this function issue E_* level errors, - and/or throw Exceptions. + 何らかの問題が発生した場合、E_* レベルのエラー + または Exception をスローします。 &reftitle.examples; - <methodname>Pdo\Pgsql::lobOpen</methodname> example + <methodname>Pdo\Pgsql::lobOpen</methodname> の例 - Following on from the Pdo\Pgsql::lobCreate - example, this code snippet retrieves the large object from - the database and outputs it to the browser. + Pdo\Pgsql::lobCreate の例に続き、 + このコードはデータベースからラージオブジェクトを取得し + ブラウザに出力します。 - + Pdo\Pgsql::lobUnlink - Deletes the large object + ラージオブジェクトを削除する @@ -15,7 +15,7 @@ stringoid - Deletes a large object from the database identified by OID. + OID が指すラージオブジェクトをデータベースから削除します。 @@ -29,7 +29,7 @@ oid - A large object identifier. + ラージオブジェクトの ID。 @@ -46,12 +46,12 @@ &reftitle.examples; - <methodname>Pdo\Pgsql::lobUnlink</methodname> example + <methodname>Pdo\Pgsql::lobUnlink</methodname> の例 - This example unlinks a large object from the database prior to deleting - the row that references it from the blobs table are used in the examples of - Pdo\Pgsql::lobCreate and - Pdo\Pgsql::lobOpen. + Pdo\Pgsql::lobCreate および + Pdo\Pgsql::lobOpen の例で使用した blob + テーブルからラージオブジェクトを参照している行を削除する前に、 + この例ではラージオブジェクトをデータベースから削除します。 Pdo\Pgsql::setNoticeCallback - Set a callback to handle notice and warning messages generated by the backend + バックエンドが生成する通知および警告メッセージを処理するコールバックを設定する @@ -15,11 +15,11 @@ callablenullcallback - Set a callback to handle notice and warning messages generated by the backend. - This includes messages emitted by PostgreSQL itself, - as well as those raised by user-defined SQL functions using RAISE. - Please note that the actual receipt of these messages - depends on the backend setting client_min_messages. + バックエンドが生成する通知および警告メッセージを処理するためのコールバックを設定します。 + これには、PostgreSQL 本体が出力するメッセージや、 + ユーザー定義 SQL 関数で RAISE されたメッセージも含まれます。 + これらのメッセージを実際に受信できるかは、バックエンド側の設定 + client_min_messages に依存する点に注意してください。 @@ -30,10 +30,10 @@ callback - If &null; is passed, the handler is reset to its default state. + &null; を渡すと、ハンドラはデフォルトの状態にリセットされます。 - Otherwise, the handler is a callback with the following signature: + それ以外の場合、ハンドラは次のシグネチャを持つコールバック関数です: voidhandler stringmessage @@ -43,7 +43,7 @@ message - A message generated by the backend. + バックエンドが生成したメッセージ @@ -64,11 +64,10 @@ &reftitle.examples; - <methodname>Pdo\Pgsql::setNoticeCallback</methodname> example + <methodname>Pdo\Pgsql::setNoticeCallback</methodname> の例 exec('CREATE TABLE parent(id int primary key)'); diff --git a/reference/pdo_pgsql/PDO/pgsqlCopyFromArray.xml b/reference/pdo_pgsql/PDO/pgsqlCopyFromArray.xml index f873b8e17c..3855808ab6 100644 --- a/reference/pdo_pgsql/PDO/pgsqlCopyFromArray.xml +++ b/reference/pdo_pgsql/PDO/pgsqlCopyFromArray.xml @@ -4,78 +4,23 @@ PDO::pgsqlCopyFromArray - PHP の配列から、データをテーブルにコピーする + + Pdo\Pgsql::copyFromArray &Alias; + &reftitle.description; - public bool PDO::pgsqlCopyFromArray - stringtable_name + public boolPDO::pgsqlCopyFromArray + stringtableName arrayrows - stringdelimiter"\t" - stringnull_as"\\\\N" - stringfields + stringseparator"\t" + stringnullAs"\\\\N" + stringnullfields&null; - - rows 配列からデータをテーブル table_name にコピーします。 - その際、delimiter をフィールドのデリミタ、そして fields のリストを使います。 - - - - - &reftitle.parameters; - - - - table_name - - - テーブル名を含む文字列 - - - - - rows - - - delimiter で区切られたフィールドの文字列の配列 - - - - - delimiter - - - rows 配列で使われているデリミタ - - - - - null_as - - - どのように null 値を扱うかを指定します - - - - - fields - - - 挿入するフィールドの一覧 - - - - - - - - - &reftitle.returnvalues; - - 成功したら &true; を返します。 - &return.falseforfailure; - + + &info.method.alias; Pdo\Pgsql::copyFromArray. + - - + + - The Pdo\pgsql class - Pdo\pgsql + Pdo\Pgsql クラス + Pdo\Pgsql @@ -12,37 +12,36 @@
&reftitle.intro; - A PDO subclass representing a connection using - the PostgreSQL PDO driver. + PostgreSQL PDO ドライバによる接続を示す PDO サブクラスです。 - This driver supports a dedicated SQL query parser for the PostgreSQL dialect. - It can handle the following: + このドライバは PostgreSQL 方言向けに専用の SQL クエリパーサーをサポートしています。 + 次のものを処理可能です: - Single and double-quoted literals, with doubling as escaping mechanism + シングルクオートやダブルクオートで囲まれたリテラルでのクオートの二重化によるエスケープ - C-style “escape” string literals + C スタイルの「エスケープ」文字列リテラル - Dollar-quoted string literals + ドル記号で囲まれた文字列リテラル - Two-dashes and C-style comments (non-nested). + 2 つのハイフンとネストされていない C スタイルのコメント - Support for ?? as escape sequence for the - ? operator. + ? 演算子のエスケープシーケンスとしての + ?? のサポート @@ -137,10 +136,10 @@ Pdo\Pgsql::ATTR_DISABLE_PREPARES - Send the query and the parameters to the server together in a single - call, avoiding the need to create a named prepared statement separately. - If the query is only going to be executed once this can reduce latency by - avoiding an unnecessary server round-trip. + SQL文とパラメータを一緒に、一回のコールでサーバーに送信します。 + これによって、名前付きのプリペアドステートメントを別々に作ることを避けられます。 + SQL文が一度しか実行されない場合、 + 不要なサーバーとの通信を避けられるので、レイテンシを抑えることができます。 @@ -148,9 +147,9 @@ Pdo\Pgsql::ATTR_RESULT_MEMORY_SIZE - Returns the amount of memory, in bytes, allocated to the specified - query result PDOStatement instance, - or &null; if no results exist before the query is executed. + 指定されたクエリ結果 PDOStatement + インスタンスに割り当てられたメモリ使用量をバイト単位で返します。 + クエリ実行前で結果が存在しない場合は &null; を返します。 diff --git a/reference/pdo_sqlite/PDO/sqlite/createaggregate.xml b/reference/pdo_sqlite/PDO/sqlite/createaggregate.xml index ffe8e5394b..9c3eec30e0 100644 --- a/reference/pdo_sqlite/PDO/sqlite/createaggregate.xml +++ b/reference/pdo_sqlite/PDO/sqlite/createaggregate.xml @@ -1,12 +1,12 @@ - + Pdo\Sqlite::createAggregate - Registers an aggregating user-defined function for use in SQL statements + SQL 文で使用するユーザー定義集約関数を登録する @@ -20,18 +20,18 @@ intnumArgs-1 - This method is similar to Pdo\Sqlite::createFunction - except that it registers functions that can be used to calculate a - result aggregated across all the rows of a query. + このメソッドは Pdo\Sqlite::createFunction + と似ていますが、クエリのすべての行を集約する関数を登録する点が + 異なります。 - The key difference between this method and + この関数と Pdo\Sqlite::createFunction - is that two functions are required to manage the aggregate. + の最大の違いは、集約関数の登録には 2 つの関数が必要であるということです。 - By using this method it is possible to override native SQL functions. + このメソッドを使用してネイティブ SQL 関数を上書きすることができます。 @@ -43,7 +43,7 @@ name - The name of the function used in SQL statements. + SQL 文で使用する関数の名前。 @@ -51,11 +51,11 @@ step - Callback function called for each row of the result set. - The callback should accumulate the result and store it in the aggregation context. + 結果セットの各行を処理するコールバック関数。 + この関数は、結果を蓄積して集約コンテキストに保存しなければなりません。 - This function need to be defined as: + 定義は次のとおりです: mixedstep mixedcontext @@ -68,9 +68,9 @@ context - &null; for the first row; on subsequent rows it will have the value - that was previously returned from the step function; you should use - this to maintain the aggregate state. + 最初の行では &null; + 2行目以降では、この関数が前回返した値です。 + この値で集約の状態を管理します。 @@ -78,7 +78,7 @@ rownumber - The current row number. + 現在の行番号 @@ -86,7 +86,7 @@ value - The first argument passed to the aggregate. + 集約関数に渡されるはじめの引数 @@ -94,14 +94,14 @@ values - Further arguments passed to the aggregate. + 集約関数に渡されるふたつめ以降の引数 - The return value of this function will be used as the - context argument in the next call of the step or - finalize functions. + この関数の戻り値を、次の関数呼び出し、または + ファイナライズ関数のcontext 引数として + 使います。 @@ -109,14 +109,14 @@ finalize - Callback function to aggregate the "stepped" data from each row. - Once all the rows have been processed, this function will be called, - and it should then take the data from the aggregation context and return the result. - This callback function should return a type understood by SQLite - (i.e. scalar type). + すべての行が処理された後で呼び出されるコールバック関数。 + ここでは、集約コンテキストからデータを取得して結果を返します。 + この関数が返す値は、SQLite が理解できる形式 (すなわち + スカラー型) + でなければなりません。 - This function need to be defined as: + 定義は次のとおりです: mixedfini mixedcontext @@ -127,7 +127,7 @@ context - Holds the return value from the very last call to the step function. + ステップ関数の最後の戻り値 @@ -135,13 +135,13 @@ rowcount - Holds the number of rows over which the aggregate was performed. + ステップ関数が処理した行数 - The return value of this function will be used as the return value for - the aggregate. + この関数の戻り値が、 + 集約関数全体の戻り値となります。 @@ -149,8 +149,8 @@ numArgs - Hint to the SQLite parser if the callback function accepts a - predetermined number of arguments. + コールバック関数があらかじめ定義済みの引数を受け取る場合に、 + SQLite のパーサに渡すヒント。 @@ -169,28 +169,28 @@ <methodname>Pdo\Sqlite::createAggregate</methodname> example - In this example we will create a custom aggregate function named - max_length that can be used in SQL queries. + この例では、SQLクエリの中で使用できる + max_length という名前のユーザー定義集約関数を作成しています。 - In this example, we are creating an aggregating function, - named max_length, that will calculate the length - of the longest string in one of the columns of the table. - For each row, the max_len_step function is called and - passed a $context parameter. - The context parameter is just like any other PHP variable and be set to - hold an array or even an object. - In this example, we are using it to hold the maximum length we have seen so far; - if the $string has a length longer than the current maximum, - we update the context to hold this new maximum length. + この例では、max_length という集約関数を + 作成しています。この関数はテーブルの特定のカラム内で + 最も長い文字列の長さを計算します。 + 各行に対し max_len_step 関数が呼ばれ、 + その際に $context パラメータが渡されます。 + この context パラメータには、他の PHP 変数と同様 + arrayobject などを格納できます。 + この例では、これまでの中で最大の文字列長を格納するために利用しています。 + もし $string が現在の最大値よりも長ければ、 + context に格納した最大長を新たな値で更新します。 - After all the rows have been processed, - SQLite calls the max_len_finalize function to determine - the aggregate result. - It is possible to perform some kind of calculation based on the data in $context. - In this basic example the result was calculated as the query progressed, - thus so the context value can be directly returned. + 全ての行が処理された後、 + SQLite は集約関数の結果を計算するため max_len_finalize + 関数を呼び出します。 + $context 内のデータに基づいて何らかの計算を行うことも可能です。 + この例では、結果はクエリの進行中に計算されているため、 + context の値をそのまま返すことができます。 - It is NOT recommended for you to store a copy of the values in the context - and then process them at the end, as you would cause SQLite to use a lot of - memory to process the query - just think of how much memory you would need - if a million rows were stored in memory, each containing a string 32 bytes - in length. + 結果の値を context に蓄積し、最後に一括で処理する方法は推奨 + 「しません」。これは、SQLite のメモリ消費量が大きくなるからです。 + 仮に 32 バイトの長さのデータが百万件あったとして、 + それを蓄積しておくのにどれだけのメモリが必要になるか + 考えてみましょう。 diff --git a/reference/pdo_sqlite/PDO/sqlite/createcollation.xml b/reference/pdo_sqlite/PDO/sqlite/createcollation.xml index 70208d81d7..5933b25e3f 100644 --- a/reference/pdo_sqlite/PDO/sqlite/createcollation.xml +++ b/reference/pdo_sqlite/PDO/sqlite/createcollation.xml @@ -1,12 +1,12 @@ - + Pdo\Sqlite::createCollation - Registers a user-defined function for use as a collating function in SQL statements + SQL文で文字列比較関数として使うユーザー定義関数を登録する @@ -18,8 +18,8 @@ callablecallback - This method is similar to Pdo\Sqlite::createFunction - except that it registers functions that are used to collate strings. + このメソッドは Pdo\Sqlite::createFunction + と似ていますが、文字列比較関数を登録する点が異なります。 @@ -30,7 +30,7 @@ name - Name of the SQL collating function to be created or redefined. + 作成または再定義する文字列比較 SQL 関数の名前 @@ -38,12 +38,12 @@ callback - Callback function that defines the behaviour of a collation. - It must accept two strings and return - -1, 0, or 1 - if the first string sorts before, sorts identically, or sorts after - the second string respectively. - An internal function that behaves like this is strcmp. + 文字列比較の動作を定義するコールバック関数です。 + この関数は2つのstringを受け取り、 + 1番目の文字列が2番目の文字列より前に並ぶ場合 -1、 + 同じ並び順の場合 0、 + 後に並ぶ場合 1 を返さなければなりません。 + これに似た振る舞いをする組み込み関数として、strcmp が挙げられます。 This function need to be defined as: @@ -68,7 +68,7 @@ &reftitle.examples; - <methodname>Pdo\Sqlite::createCollation</methodname> example + <methodname>Pdo\Sqlite::createCollation</methodname> の例 Pdo\Sqlite::createFunction - Registers a user-defined function for use in SQL statements + SQL 文で使用するユーザー定義関数を登録する @@ -20,14 +20,14 @@ intflags0 - This method allows PHP function to be registered with SQLite as a - user-defined function, so that it can be called within SQL queries. - The defined function can be used in any SQL query that allows function calls, - for example SELECT, UPDATE, or triggers. + PHP 関数を、ユーザー定義関数として SQLite に登録します。 + 登録した関数は、SQL 文の中で使用することが可能です。 + ユーザー定義関数は、関数をコールできるあらゆる SQL 文 + (SELECTUPDATE 、トリガなど) から呼び出せます。 - By using this method it is possible to override native SQL functions. + このメソッドを使用してネイティブ SQL 関数を上書きすることができます。 @@ -39,7 +39,7 @@ function_name - The name of the function used in SQL statements. + SQL 文で使用する関数の名前。 @@ -47,16 +47,17 @@ callback - Callback function to handle the defined SQL function. + 定義した SQL 関数を処理するコールバック関数。 - Callback functions should return a type understood by SQLite (i.e. - scalar type). + この関数が返す値は、SQLite が理解できる形式 (すなわち + スカラー型) + でなければなりません。 - This function need to be defined as: + コールバック関数の定義は次のとおりです: mixedcallback mixedvalue @@ -67,7 +68,7 @@ value - The first argument passed to the SQL function. + SQL関数に渡す最初の引数 @@ -75,7 +76,7 @@ values - Further arguments passed to the SQL function. + SQL関数に渡す2つ目以降の引数 @@ -87,9 +88,9 @@ num_args - The number of arguments that the SQL function takes. - If this parameter is -1, - then the SQL function may take any number of arguments. + SQL 関数がとる引数の数。 + このパラメータが -1 の場合、 + SQL 関数は任意の数の引数を取ることができます。 @@ -97,10 +98,10 @@ flags - A bitmask of flags. - Currently, only Pdo\Sqlite::DETERMINISTIC is supported, - which specifies that the function always returns the same result given - the same inputs within a single SQL statement. + ビット単位のフラグの組み合わせ。 + 現在は、PDO::SQLITE_DETERMINISTIC だけがサポートされています。 + これは、単一のSQLステートメント内では、 + 同じ入力に対して常に同じ結果を返すことを指定します。 @@ -117,16 +118,16 @@ &reftitle.examples; - <methodname>Pdo\Sqlite::createFunction</methodname> example + <methodname>Pdo\Sqlite::createFunction</methodname> の例 - In this example, we have a function that calculates the SHA256 sum of a - string, and then reverses it. When the SQL statement executes, it - returns the value of the filename transformed by our function. - The data returned in $rows contains the processed result. + この例では、文字列の SHA256 ハッシュを計算し + それを反転する関数を使っています。SQL 文を実行すると、 + この関数によって変換されたファイル名が + $rows に格納され返ります。 - The beauty of this technique is that there is no need to process the - result using a &foreach; loop after the query. + この手法の素晴らしい点は、クエリの後に + &foreach; ループを用いて結果を処理する必要がないことです。 PDO::sqliteCreateAggregate - SQL 文で使用する集約ユーザー定義関数 (UDF) を登録する + Pdo\Sqlite::createAggregate &Alias; @@ -14,246 +14,14 @@ &reftitle.description; public boolPDO::sqliteCreateAggregate - stringfunction_name - callablestep_func - callablefinalize_func - intnum_args + stringname + callablestep + callablefinalize + intnumArgs-1 - &warn.experimental.func; - - このメソッドは - と似ていますが、 - この関数で登録した関数は、クエリのすべての行の内容を集約する関数を登録します。 - - - この関数と の最大の違いは、 - 集約関数を作成するためには 2 つの関数が必要であるということです。 - - - - - &reftitle.parameters; - - - - function_name - - - SQL 文で使用する関数の名前。 - - - - - step_func - - - 結果セットの各行についてコールされるコールバック関数。 - この PHP 関数は、結果を蓄積して集約コンテキストに保存しなければなりません。 - - - この関数は次のように定義しなければなりません。 - - mixedstep - mixedcontext - intrownumber - mixedvalue - mixedvalues - - - - context - - - 最初の行では &null; - 二行目以降では、ステップ関数から以前返された値を持ちます。 - この値を、集約の状態を管理するのに使うべきです。 - - - - - rownumber - - - 現在の行番号 - - - - - value - - - 集約関数に渡されるはじめの引数 - - - - - values - - - 集約関数に渡されるふたつめ以降の引数 - - - - - この関数の戻り値を、次のステップあるいはファイナライズ関数の - context 引数として使います。 - - - - - finalize_func - - - すべての行が処理された後でコールされるコールバック関数。 - ここでは、集約コンテキストからデータを取得して結果を返します。 - コールバック関数の返す値は、SQLite が理解できる形式 (すなわち - スカラー型) - でなければなりません。 - - - この関数は次のように定義しなければなりません。 - - mixedfini - mixedcontext - introwcount - - - - context - - - ステップ関数を最後に呼んだ時の戻り値を保持します。 - - - - - rowcount - - - 集約関数が実行された行数を保持します。 - - - - - この関数の戻り値が、集約の戻り値となります。 - - - - - num_args - - - コールバック関数があらかじめ定義済みの引数を受け取る場合に、 - SQLite のパーサに渡すヒント。 - - - - - - - - - &reftitle.returnvalues; - - &return.success; - - - - - &reftitle.examples; - - - 集約関数 max_length の例 - -exec("CREATE TABLE strings(a)"); -$insert = $db->prepare('INSERT INTO strings VALUES (?)'); -foreach ($data as $str) { - $insert->execute(array($str)); -} -$insert = null; - -function max_len_step($context, $rownumber, $string) -{ - if (strlen($string) > $context) { - $context = strlen($string); - } - return $context; -} - -function max_len_finalize($context, $rownumber) -{ - return $context === null ? 0 : $context; -} - -$db->sqliteCreateAggregate('max_len', 'max_len_step', 'max_len_finalize'); - -var_dump($db->query('SELECT max_len(a) from strings')->fetchAll()); - -?> -]]> - - - - - この例では、 - テーブルのカラムの中で一番長い文字列の長さを計算する集約関数を作成します。 - 各行について max_len_step 関数がコールされ、 - $context パラメータが渡されます。 - このパラメータには、他の PHP 変数と同様に、配列やオブジェクトが設定されます。 - この例では、これまでに登場した値のうち長さが最大のものの長さを保持しています。 - $string が現在の最大値より長い場合に、 - その値で現在の最大値を更新します。 - - - すべての行に対する処理が終わると、SQLite は - max_len_finalize 関数をコールして集約結果を決定します。 - ここでは、$context の内容に基づいた、 - なんらかの計算を行うことができます。 - しかし、この例ではクエリを処理している過程で既に結果が決定しているので、 - ここでは単に context の値を返しているだけです。 - - - - 結果の値を context に溜め込んでおき、最後に一括して処理するという方法は推奨 - 「しません」。これは、SQLite のメモリ消費量が大きくなるからです。 - 仮に 32 バイトの長さのデータが百万件あったとして、 - それを溜め込むためにどれだけのメモリが必要になるか考えてみましょう。 - - - - - および - を使用して、 - SQLite のネイティブ SQL 関数を上書きすることができます。 - - - - - - - &reftitle.seealso; - - - - sqlite_create_function - sqlite_create_aggregate - - + + &info.method.alias; Pdo\Sqlite::createAggregate. + - - - および - を使用して、 - SQLite のネイティブ SQL 関数を上書きすることができます。 - - - - - - &reftitle.seealso; - - - - sqlite_create_function - sqlite_create_aggregate - - - - The Pdo\Sqlite class + Pdo\Sqlite クラス Pdo\Sqlite @@ -12,26 +12,25 @@
&reftitle.intro; - A PDO subclass representing a connection using - the SQLite PDO driver. + SQLite PDO ドライバによる接続を示す PDO サブクラスです。 - This driver supports a dedicated SQL query parser for the SQLite dialect. - It can handle the following: + このドライバは SQLite 方言向けに専用の SQL クエリパーサーをサポートしています。 + 次のものを処理可能です: - Single, double-quoted, and backtick literals, with doubling as escaping mechanism. + シングルクオート、ダブルクオート、バッククオートで囲まれたリテラルでのクオートの二重化によるエスケープ - Square brackets quoting for identifiers. + 識別子の角括弧によるクオート - Two-dashes and C-style comments (non-nested). + 2 つのハイフンとネストされていない C スタイルのコメント