定制 savander/surrealdb-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

savander/surrealdb-client

Composer 安装命令:

composer require savander/surrealdb-client

包简介

The client for SurrealDB database.

README 文档

README

⚠️ Warning!

The package is in the very early stages of development!


The client allows you to connect to SurrealDB and perform queries.

Installation

You can install the package via composer:

composer require savander/surrealdb-client

Usage

// The connection options.
$connectionOptions = (new ConnectionOptions())
    ->setNamespace('test')
    ->setDatabase('test')
    ->setUsername(getenv('DB_USER'))
    ->setPassword(getenv('DB_PASS'));

// The persistent connection to the SurrealDB Websocket server.
$connection = new Connection($connectionOptions);

// The results of the query. It returns the Johnny :)
$createdJohnny = $connection
    ->raw("CREATE author SET name.first = 'Johnny'")
    ->results();

// The results of the selection query, it returns the previously created Johnny.
//  > Please note that, we used `prepare` method here. It's much safer to do this that way.
//  > In this case, we are sending attributes as a separate array of arguments.
//  > You could use that method in previous step as well.
$selectedJohnny = $connection
    ->prepare('SELECT * FROM $author', ['author' => $createdJohnny['id']])
    ->results();

Contributing

Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-09-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固