Skip to content

mmarxe/cosmosdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cosmosdb

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");

Packages

No packages published