« Schema::createCollection
Schema::existsInDatabase »

Schema::dropCollection

(No version information available, might only be in Git)

Schema::dropCollection — スキーマからコレクションを削除する

説明

public function mysql_xdevapi\Schema::dropCollection(string $collection_name): bool

警告

この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。

パラメータ

collection_name

戻り値

例

例1 mysql_xdevapi\Schema::dropCollection() の例

<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");

$session->sql("DROP DATABASE IF EXISTS food")->execute();
$session->sql("CREATE DATABASE food")->execute();
$session->sql("CREATE TABLE food.fruit(name text, rating text)")->execute();

$schema = $session->getSchema("food");

$schema->createCollection("trees");
$schema->dropCollection("trees");
$schema->createCollection("buildings");

print_r($schema->gettables());
print_r($schema->getcollections());

上の例の出力は、 たとえば以下のようになります。

Array
(
    [fruit] => mysql_xdevapi\Table Object
        (
            [name] => fruit
        )
)
Array
(
    [buildings] => mysql_xdevapi\Collection Object
        (
            [name] => buildings
        )
)
関連キーワード:
Schema   mysql   xdevapi   schema   dropCollection   session   food   スキーマ   コレクション   createCollection   execute   fruit   buildings   collection   text   trees   print   existsInDatabase   information   available   詳細   記述   getSession   mysqlx   user
関連する関数・ページ:
mysql-xdevapi-schema.construct   mysql-xdevapi-schema.createcollection   mysql-xdevapi-schema.existsindatabase   mysql-xdevapi-schema.getcollection   class.mysql-xdevapi-schema   mysql-xdevapi-schema.getsession