cosmosdb/cosmosdb

Wrapper for Azure CosmosDB REST API

v1.1.0 2023-04-11 13:50 UTC

This package is auto-updated.

Last update: 2024-04-19 10:11:00 UTC


README

This is a wrapper around the rest api to make it simpler to utilize azure cosmosdb from your php services such as Wordpress, Symphony and Laravel.

For more information around the wrapper for Azure Cosmos DB. https://learn.microsoft.com/en-us/rest/api/cosmos-db/

Installation

Include cosmosdb/cosmosdb in your project, by adding it to your composer.json file.

{
  "require": {
    "cosmosdb/cosmosdb": "1.1.0"
  }
}

or by running

composer require cosmosdb/cosmosdb

at the root of your project.

Usage

Select Database

$database = new Database(
    'host',
    'primary_key'
);
$response = $database->get("DBNAME");

Delete Database

$database = new Database(
    'host',
    'primary_key'
);
$response = $database->delete("DBNAME");

List Databases

$database = new Database(
    'host',
    'primary_key'
);
$response = $database->list();

Create a new Database

$database = new Database(
    'host',
    'primary_key'
);
$response = $database->create("DBNAME");