phpcassa 架构

发布于 2025-01-02 11:33:14 字数 448 浏览 2 评论 0原文

create column family PwdUrl with 
    default_validation_class=UTF8Type and key_validation_class=UTF8Type and 
    comparator =UTF8Type and 
    column_metadata = [ {
        column_name:createdAt, 
        validation_class:UTF8Type, 
        index_type: KEYS
    },{
        column_name:expireAt, 
        validation_class:UTF8Type, 
        index_type: KEYS}
    ] 

这是我需要设置的架构。可以使用 phpcassa 来做到这一点吗?如果没有,还有什么其他选择?

create column family PwdUrl with 
    default_validation_class=UTF8Type and key_validation_class=UTF8Type and 
    comparator =UTF8Type and 
    column_metadata = [ {
        column_name:createdAt, 
        validation_class:UTF8Type, 
        index_type: KEYS
    },{
        column_name:expireAt, 
        validation_class:UTF8Type, 
        index_type: KEYS}
    ] 

This is the schema I need to set up. Is it possible to do this using phpcassa? If not, what other options are there?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无所的.畏惧 2025-01-09 11:33:14

是的,您只需使用 phpcassa 即可做到这一点。您将使用 SystemManager 类。这是一个例子:

<?php
require_once('phpcassa/sysmanager.php');

$sys = SystemManager("localhost:9160");
$my_keyspace = "Keyspace1";
$cfattrs = array("column_type" => "Standard",
                 "comparator_type" => "UTF8Type",
                 "default_validation_class" => "UTF8Type",
                 "key_validation_class" => "UTF8Type");
$sys->create_column_family($my_keyspace, "PwdUrl", $cfattrs);
$sys->create_index($my_keyspace, "PwdUrl", "createdAt", "UTF8Type");
$sys->create_index($my_keyspace, "PwdUrl", "expireAt", "UTF8Type");
$sys->close();
?>

Yes, you can do this with just phpcassa. You'll use the SystemManager class. Here's an example:

<?php
require_once('phpcassa/sysmanager.php');

$sys = SystemManager("localhost:9160");
$my_keyspace = "Keyspace1";
$cfattrs = array("column_type" => "Standard",
                 "comparator_type" => "UTF8Type",
                 "default_validation_class" => "UTF8Type",
                 "key_validation_class" => "UTF8Type");
$sys->create_column_family($my_keyspace, "PwdUrl", $cfattrs);
$sys->create_index($my_keyspace, "PwdUrl", "createdAt", "UTF8Type");
$sys->create_index($my_keyspace, "PwdUrl", "expireAt", "UTF8Type");
$sys->close();
?>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文