2024-03-11 18:47:44 +00:00
# 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
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Feature | Implemented |
2024-06-18 22:44:46 +01:00
| ----------------------------- | ----------- |
2024-03-11 18:47:44 +00:00
| Subqueries | No |
| Joins | No |
| 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
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Clause | Implemented |
2024-06-18 22:44:46 +01:00
| ------------ | ----------- |
2024-03-11 18:47:44 +00:00
| SELECT | Yes |
| FROM | Yes |
| WHERE | Yes |
| ORDER BY | Yes |
| GROUP BY | Yes |
2024-03-11 20:02:10 +00:00
| OFFSET LIMIT | Yes |
2024-03-11 18:47:44 +00:00
### Keywords
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Keyword | Implemented |
2024-06-18 22:44:46 +01:00
| -------- | ----------- |
2024-03-11 18:47:44 +00:00
| BETWEEN | No |
| DISTINCT | Yes |
| LIKE | No |
| IN | Yes |
| TOP | Yes |
### Aggregate Functions
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Function | Implemented |
2024-06-18 22:44:46 +01:00
| -------- | ----------- |
2024-03-11 18:47:44 +00:00
| AVG | Yes |
| COUNT | Yes |
| MAX | Yes |
| MIN | Yes |
| SUM | Yes |
### Array Functions
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Function | Implemented |
2024-06-18 22:44:46 +01:00
| -------------- | ----------- |
2024-03-11 18:47:44 +00:00
| ARRAY_CONCAT | Yes |
| ARRAY_CONTAINS | No |
| ARRAY_LENGTH | Yes |
| ARRAY_SLICE | Yes |
| CHOOSE | No |
| ObjectToArray | No |
| SetIntersect | Yes |
| SetUnion | Yes |
### Conditional Functions
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Function | Implemented |
2024-06-18 22:44:46 +01:00
| -------- | ----------- |
2024-03-11 18:47:44 +00:00
| IIF | No |
### Date and time Functions
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Function | Implemented |
2024-06-18 22:44:46 +01:00
| ------------------------- | ----------- |
2024-03-11 18:47:44 +00:00
| 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
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Function | Implemented |
2024-06-18 22:44:46 +01:00
| ---------- | ----------- |
2024-03-11 18:47:44 +00:00
| DocumentId | No |
### Mathematical Functions
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Function | Implemented |
2024-06-18 22:44:46 +01:00
| ---------------- | ----------- |
| 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 |
2024-03-11 18:47:44 +00:00
### Spatial Functions
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Function | Implemented |
2024-06-18 22:44:46 +01:00
| ------------------ | ----------- |
2024-03-11 18:47:44 +00:00
| ST_AREA | No |
| ST_DISTANCE | No |
| ST_WITHIN | No |
| ST_INTERSECTS | No |
| ST_ISVALID | No |
| ST_ISVALIDDETAILED | No |
### String Functions
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Function | Implemented |
2024-06-18 22:44:46 +01:00
| --------------- | ----------- |
2024-03-11 18:47:44 +00:00
| 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
2024-06-18 22:44:46 +01:00
2024-03-11 18:47:44 +00:00
| Function | Implemented |
2024-06-18 22:44:46 +01:00
| ---------------- | ----------- |
2024-03-11 18:47:44 +00:00
| 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.