Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .aiassistant/rules/Running Unit Tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
apply: always
---

# Bofore run the unit tests:

The test WILL FAIL IF NOT FOLLOW THIS RULE.
You NEED TO EXECUTE ALL THESE STEPS BEFORE AND AFTER IMPLEMENT ANYTHING.

## Start the test infrastructure (MongoDB, MinIO for S3, DynamoDB Local)

docker compose up -d

## Set environment variables for connecting to the local services

export MONGODB_CONNECTION="mongodb://127.0.0.1/test"
export S3_CONNECTION="s3://aaa:12345678@us-east-1/mybucket?create=true&endpoint=http://127.0.0.1:4566"
export DYNAMODB_CONNECTION="dynamodb://accesskey:secretkey@us-east-1/tablename?endpoint=http://127.0.0.1:8000"

## Run the tests

vendor/bin/phpunit
4 changes: 3 additions & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.4"
- "8.3"
- "8.2"
- "8.1"
Expand Down Expand Up @@ -71,5 +72,6 @@ jobs:
with:
folder: php
project: ${{ github.event.repository.name }}
secrets: inherit
secrets:
DOC_TOKEN: ${{ secrets.DOC_TOKEN }}

28 changes: 28 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
tasks:
- name: Run Composer
command: |
composer install

image: byjg/gitpod-image:latest

jetbrains:
phpstorm:
vmoptions: '-Xmx4g'
plugins:
- com.github.copilot
- com.intellij.kubernetes
- com.intellij.mermaid
- ru.adelf.idea.dotenv
- org.toml.lang

vscode:
extensions:
- ikappas.composer
- hbenl.test-adapter-converter
- hbenl.vscode-test-explorer
- felixfbecker.php-debug
- neilbrayfield.php-docblocker
- bmewburn.vscode-intelephense-client
- getpsalm.psalm-vscode-plugin
- SonarSource.sonarlint-vscode
- recca0120.vscode-phpunit
35 changes: 35 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug current Script in Console",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9003,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
},
{
"name": "PHPUnit Debug",
"type": "php",
"request": "launch",
"program": "${workspaceFolder}/vendor/bin/phpunit",
"cwd": "${workspaceFolder}",
"port": 9003,
"runtimeArgs": [
"-dxdebug.start_with_request=yes"
],
"env": {
"XDEBUG_MODE": "debug,develop",
"XDEBUG_CONFIG": "client_port=${port}"
}
}
]
}
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,24 @@
[![GitHub license](https://img.shields.io/github/license/byjg/php-anydataset-nosql.svg)](https://opensource.byjg.com/opensource/licensing.html)
[![GitHub release](https://img.shields.io/github/release/byjg/php-anydataset-nosql.svg)](https://github.com/byjg/php-anydataset-nosql/releases/)

Anydataset NoSQL standardize the access to non-relational databases/repositories and treat them as Key/Value.
The implementation can work with:
Anydataset NoSQL standardizes the access to non-relational databases/repositories and provides a consistent interface for both NoSQL document databases and Key/Value stores.
The implementation supports:

- S3-Like Storage
- MongoDB
- Cloudflare KV
- DynamoDB
- MongoDB (document-based)
- AWS DynamoDB (key/value)
- S3-Like Storage (key/value)
- Cloudflare KV (key/value)

Anydataset is an agnostic data source abstraction layer in PHP. See more about Anydataset [here](https://opensource.byjg.com/php/anydataset).

## Features

- Access as Key/Value repositories different datasource
- Allow put and get data
- Simplified way to connect to the datasources
- Access both document-based and key/value repositories with consistent interfaces
- NoSQL document-based databases accessed through `NoSqlInterface`
- Key/Value stores accessed through `KeyValueInterface`
- Unified connection string format based on URIs
- Built-in caching capabilities with PSR-16 compatibility
- Type-safe DynamoDB attribute definitions using enums

## Connection Based on URI

Expand All @@ -38,10 +41,10 @@ See below the current implemented drivers:

## Topics

- [S3-Like Storage](docs/AwsS3KeyValue.md)
- [MongoDB](docs/MongoDB.md)
- [AWS DynamoDB](docs/AwsDynamoDbKeyValue.md) - Now with type-safe attribute definitions using `DynamoDbAttributeType` enum
- [S3-Like Storage](docs/AwsS3KeyValue.md)
- [Cloudflare KV](docs/CloudFlareKV.md)
- [AWS DynamoDB](docs/AwsDynamoDbKeyValue.md)
- [Cache Store](docs/cache.md)
- [Running Tests](docs/tests.md)

Expand Down
17 changes: 8 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,22 @@
"prefer-stable": true,
"minimum-stability": "dev",
"require": {
"php": ">=8.1 <8.4",
"php": ">=8.1 <8.5",
"ext-curl": "*",
"aws/aws-sdk-php": "3.*",
"byjg/cache-engine": "^5.0",
"byjg/anydataset": "^5.0",
"byjg/anydataset-array": "^5.0",
"byjg/serializer": "^5.0",
"byjg/webrequest": "^5.0",
"byjg/cache-engine": "^6.0",
"byjg/anydataset": "^6.0",
"byjg/serializer": "^6.0",
"byjg/webrequest": "^6.0",
"ext-json": "*"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"vimeo/psalm": "^5.9"
"phpunit/phpunit": "^10.5|^11.5",
"vimeo/psalm": "^5.9|^6.2"
},
"suggest": {
"ext-mongodb": "*",
"byjg/cache-engine": "^5.0"
"byjg/cache-engine": "^6.0"
},
"provide": {
"byjg/anydataset-implementation": "1.0"
Expand Down
Loading