PHPackages                             arakaki-yuji/cosmosdb-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. arakaki-yuji/cosmosdb-client

ActiveLibrary[Database &amp; ORM](/categories/database)

arakaki-yuji/cosmosdb-client
============================

0.0.6(6y ago)01.7k1PHPCI failing

Since Jul 4Pushed 6y agoCompare

[ Source](https://github.com/Arakaki-Yuji/cosmosdb-client)[ Packagist](https://packagist.org/packages/arakaki-yuji/cosmosdb-client)[ RSS](/packages/arakaki-yuji-cosmosdb-client/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (2)Versions (7)Used By (0)

cosmosdb-client
===============

[](#cosmosdb-client)

tiny cosmosdb client library for PHP.

installation
============

[](#installation)

Include arakaki-yuji/cosmosdb-client in your project, by adding it to your composer.json file.

```
{
    "require": {
        "arakaki-yuji/cosmosdb-client": "^0.0.5"
    }
}
```

Usage
=====

[](#usage)

Init
----

[](#init)

```
$client = new \CosmosdbClient\CosmosdbClient($cosmosdbSecretKey, $cosmosdbAccountName);
```

Database
--------

[](#database)

```
// create database
$client->database->create('database_id');

// list database
$client->database->list();

// get database
$client->database->get('database_id');

// delete database
$client->database->delete('database_id');
```

Collection
----------

[](#collection)

```
// create collection
$indexingPolicy = ['indexingMode' => 'lazy'];
$partitionKey = ['paths' => ['/Name']];
$client->collection->create('database_id', 'collection_id', $indexingPolicy, $partitionKey);

// list collection
$client->collection->list('database_id');

// get collection
$client->collection->get('database_id', 'collection_id');

// replace/update collection
$client->collection->replace('database_id', 'collection_id', $indexingPolicy, $partitionKey);

// delete collection
$client->collection->delete('database_id', 'collection_id');
```

Document
--------

[](#document)

```
// create document
$doc = [
    'id' => 1,
    'name' => 'Yuji Arakaki',
    'email' => 'example@test.com'
];
$partitionKeyValue = $doc['name'];
$client->document->create('database_id', 'collection_id', $doc, $partitionKeyValue);

// list document
$client->document->list('database_id', 'collection_id');

// get document
$client->document->get('database_id', 'collection_id', $doc['id'], $partitionKeyValue);

// replace/update document
$client->document->replace('database_id', 'collection_id', $doc, $partitionKeyValue);

// query document
$query = "SELECT * FROM c WHERE c.name = @name";
$parameters = [['name' => '@name', 'value' => 'Yuji Arakaki']];
$client->document->query('database_id', 'collection_id', $query, $parameters);

// delete document
$client->document->delete('database_id', 'collection_id', $doc['id'], $partitionKeyValue);
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

6

Last Release

2516d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1689744?v=4)[Arakaki Yuji](/maintainers/Arakaki-Yuji)[@Arakaki-Yuji](https://github.com/Arakaki-Yuji)

---

Top Contributors

[![Arakaki-Yuji](https://avatars.githubusercontent.com/u/1689744?v=4)](https://github.com/Arakaki-Yuji "Arakaki-Yuji (10 commits)")[![NurseAngel](https://avatars.githubusercontent.com/u/3815718?v=4)](https://github.com/NurseAngel "NurseAngel (1 commits)")

---

Tags

cosmosdbphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/arakaki-yuji-cosmosdb-client/health.svg)

```
[![Health](https://phpackages.com/badges/arakaki-yuji-cosmosdb-client/health.svg)](https://phpackages.com/packages/arakaki-yuji-cosmosdb-client)
```

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.2k532.1M2.5k](/packages/aws-aws-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k33](/packages/neuron-core-neuron-ai)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[aliyun/aliyun-tablestore-sdk-php

Aliyun Tablestore SDK for PHP

30100.6k3](/packages/aliyun-aliyun-tablestore-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
