Skip to content

Latest commit

 

History

History
217 lines (182 loc) · 7.15 KB

COMPATIBILITY.md

File metadata and controls

217 lines (182 loc) · 7.15 KB

Cosmium Compatibility with Cosmos DB

Introduction

Cosmium is designed to emulate the functionality of Cosmos DB, providing developers with a local development environment that closely mimics the behavior of Cosmos DB. While Cosmium aims to be compatible with Cosmos DB, there are certain differences and limitations to be aware of. This document provides an overview of Cosmium's compatibility with Cosmos DB and highlights areas where deviations may occur.

Supported Features

Cosmium strives to support the core features of Cosmos DB, including:

  • REST API
  • SQL-like query language
  • Document-based data model

Compatibility Matrix

Features

Feature Implemented
Subqueries Yes
Joins Yes
Computed properties No
Coalesce operators No
Bitwise operators No
GeoJSON location data No
Parameterized queries Yes
Stored procedures No
Triggers No
User-defined functions (UDFs) No

Clauses

Clause Implemented
SELECT Yes
FROM Yes
WHERE Yes
ORDER BY Yes
GROUP BY Yes
OFFSET LIMIT Yes

Keywords

Keyword Implemented
BETWEEN No
DISTINCT Yes
LIKE No
IN Yes
TOP Yes

Aggregate Functions

Function Implemented
AVG Yes
COUNT Yes
MAX Yes
MIN Yes
SUM Yes

Array Functions

Function Implemented
ARRAY_CONCAT Yes
ARRAY_CONTAINS Yes
ARRAY_CONTAINS_ANY Yes
ARRAY_CONTAINS_ALL Yes
ARRAY_LENGTH Yes
ARRAY_SLICE Yes
CHOOSE No
ObjectToArray No
SetIntersect Yes
SetUnion Yes

Conditional Functions

Function Implemented
IIF No

Date and time Functions

Function Implemented
DateTimeAdd No
DateTimeBin No
DateTimeDiff No
DateTimeFromParts No
DateTimePart No
DateTimeToTicks No
DateTimeToTimestamp No
GetCurrentDateTime No
GetCurrentDateTimeStatic No
GetCurrentTicks No
GetCurrentTicksStatic No
GetCurrentTimestamp No
GetCurrentTimestampStatic No
TicksToDateTime No
TimestampToDateTime No

Item Functions

Function Implemented
DocumentId No

Mathematical Functions

Function Implemented
ABS Yes
ACOS Yes
ASIN Yes
ATAN Yes
ATN2 Yes
CEILING Yes
COS Yes
COT Yes
DEGREES Yes
EXP Yes
FLOOR Yes
IntAdd Yes
IntBitAnd Yes
IntBitLeftShift Yes
IntBitNot Yes
IntBitOr Yes
IntBitRightShift Yes
IntBitXor Yes
IntDiv Yes
IntMod Yes
IntMul Yes
IntSub Yes
LOG Yes
LOG10 Yes
NumberBin Yes
PI Yes
POWER Yes
RADIANS Yes
RAND Yes
ROUND Yes
SIGN Yes
SIN Yes
SQRT Yes
SQUARE Yes
TAN Yes
TRUNC Yes

Spatial Functions

Function Implemented
ST_AREA No
ST_DISTANCE No
ST_WITHIN No
ST_INTERSECTS No
ST_ISVALID No
ST_ISVALIDDETAILED No

String Functions

Function Implemented
CONCAT Yes
CONTAINS Yes
ENDSWITH Yes
INDEX_OF Yes
LEFT Yes
LENGTH Yes
LOWER Yes
LTRIM Yes
REGEXMATCH No
REPLACE Yes
REPLICATE Yes
REVERSE Yes
RIGHT Yes
RTRIM Yes
STARTSWITH Yes
STRINGEQUALS Yes
StringToArray No
StringToBoolean No
StringToNull No
StringToNumber No
StringToObject No
SUBSTRING Yes
ToString Yes
TRIM Yes
UPPER Yes

Type checking Functions

Function Implemented
IS_ARRAY Yes
IS_BOOL Yes
IS_DEFINED Yes
IS_FINITE_NUMBER Yes
IS_INTEGER Yes
IS_NULL Yes
IS_NUMBER Yes
IS_OBJECT Yes
IS_PRIMITIVE Yes
IS_STRING Yes

Known Differences

While Cosmium aims to replicate the behavior of Cosmos DB as closely as possible, there are certain differences and limitations to be aware of:

  1. Performance: Cosmium may exhibit different performance characteristics compared to Cosmos DB, especially under heavy load or large datasets.
  2. Consistency Levels: The consistency model in Cosmium may differ slightly from Cosmos DB.
  3. Features: Some advanced features or functionalities of Cosmos DB may not be fully supported or available in Cosmium.

Future Development

Cosmium is actively developed and maintained, with ongoing efforts to improve compatibility with Cosmos DB and enhance its features and capabilities. Future updates may address known differences and limitations, as well as introduce new functionality to bring Cosmium closer to feature parity with Cosmos DB.