Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c652569
Add proxy texts
Meldiron Oct 15, 2023
1f1d191
Proxy auth state
Meldiron Oct 16, 2023
1959611
Finish db proxy adapter
Meldiron Oct 16, 2023
12fc78d
linter fix
Meldiron Oct 16, 2023
644ca9a
Address TODOs
Meldiron Oct 17, 2023
377a2d0
Chnage API
fogelito Dec 8, 2023
dd8a9a2
Queries
fogelito Dec 9, 2023
850941f
Queries find
fogelito Dec 10, 2023
778276c
Count Queries
fogelito Dec 10, 2023
099e572
Fix throw Exception
fogelito Dec 10, 2023
7d09b05
Updates after Data API rename
Meldiron Jan 29, 2024
ed59f84
Merge remote-tracking branch 'origin/main' into feat-proxy-adapter
Meldiron Jan 29, 2024
6f0fa09
Bug fixes after main merge
Meldiron Jan 29, 2024
543e4f6
Update to follow latest data API endpoints
Meldiron Feb 22, 2024
56d6d96
Fix test endpoint
Meldiron Feb 22, 2024
855bf61
Implement raw query execution
Meldiron Feb 23, 2024
8685ece
Merge remote-tracking branch 'origin/main' into feat-proxy-adapter
Meldiron Feb 23, 2024
6c1261d
Update lockfile
Meldiron Feb 23, 2024
2c2c61e
Linter fixes
Meldiron Feb 23, 2024
9d44651
Temporarly remove data API tests
Meldiron Feb 23, 2024
dacb169
WIP: Update to raw queries
Meldiron Feb 23, 2024
f33fcdd
WIP: Convert MariaDB to raw query methods
Meldiron Feb 24, 2024
eafb57f
Revert "WIP: Convert MariaDB to raw query methods"
Meldiron Feb 27, 2024
50c47d1
Revert "WIP: Update to raw queries"
Meldiron Feb 27, 2024
b9064d0
Revert "Temporarly remove data API tests"
Meldiron Feb 27, 2024
1a89de6
Revert "Linter fixes"
Meldiron Feb 27, 2024
a400858
Revert "Update lockfile"
Meldiron Feb 27, 2024
1b77c97
Revert "Implement raw query execution"
Meldiron Feb 27, 2024
27782a6
Fix timeout
Meldiron Feb 27, 2024
cda3515
Final touches to last revert
Meldiron Feb 27, 2024
2402400
Fix timeouts
Meldiron Feb 27, 2024
672a538
Fix timeouts?
Meldiron Feb 27, 2024
34f21f7
Fix timeouts, finally
Meldiron Feb 27, 2024
e593083
Fix tests
Meldiron Feb 27, 2024
f08fb16
Fix tests
Meldiron Feb 29, 2024
3adf7e4
Rename data api to proxy
Meldiron Feb 29, 2024
30d178a
Fix proxy test fail
Meldiron Feb 29, 2024
29f4fc4
Add debug msg
Meldiron Feb 29, 2024
e16da3e
Move logs in CI/CD
Meldiron Feb 29, 2024
1c95a50
Remove logs from CICD
Meldiron Mar 1, 2024
c3c874a
Attempt to get logs after failed error
Meldiron Mar 1, 2024
0c3b92c
More cicd logs
Meldiron Mar 1, 2024
5ddce3e
Increase sleep time
Meldiron Mar 1, 2024
5a6a4be
Revert CICD changes
Meldiron Mar 1, 2024
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
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
Postgres,
SQLite,
MongoDB,
MariaDBProxy
]

steps:
Expand All @@ -97,4 +98,5 @@ jobs:
sleep 10

- name: Run ${{matrix.service}} Tests
run: docker compose exec -T tests vendor/bin/phpunit /usr/src/code/tests/e2e/Adapter/${{matrix.adapter}}Test.php --debug
run: docker compose exec -T tests vendor/bin/phpunit /usr/src/code/tests/e2e/Adapter/${{matrix.adapter}}Test.php --debug || true

3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"php": ">=8.0",
"utopia-php/framework": "0.33.*",
"utopia-php/cache": "0.9.*",
"utopia-php/mongo": "0.3.*"
"utopia-php/mongo": "0.3.*",
"utopia-php/fetch": "0.1.*"
},
"require-dev": {
"fakerphp/faker": "^1.14",
Expand Down
53 changes: 46 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,23 @@ services:
networks:
- database

database-proxy:
image: appwrite/database-proxy:0.1.0
container_name: utopia-database-proxy
networks:
- database
environment:
- UTOPIA_DATA_API_SECRET=test-secret
- UTOPIA_DATA_API_SECRET_CONNECTION=mariadb://root:password@database-proxy-mariadb:3306/utopiaTests

database-proxy-mariadb:
image: mariadb:10.11
container_name: utopia-database-proxy-mariadb
networks:
- database
environment:
- MYSQL_ROOT_PASSWORD=password
- MARIADB_DATABASE=utopiaTests

networks:
database:
4 changes: 2 additions & 2 deletions src/Database/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,11 @@ abstract public function createCollection(string $name, array $attributes = [],
/**
* Delete Collection
*
* @param string $name
* @param string $id
*
* @return bool
*/
abstract public function deleteCollection(string $name): bool;
abstract public function deleteCollection(string $id): bool;

/**
* Create Attribute
Expand Down
39 changes: 39 additions & 0 deletions src/Database/Adapter/MariaDBProxy.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

namespace Utopia\Database\Adapter;

use Utopia\Database\Database;

class MariaDBProxy extends Proxy
{
/**
* Returns number of attributes used by default.
*
* @return int
*/
public static function getCountOfDefaultAttributes(): int
{
return \count(Database::INTERNAL_ATTRIBUTES);
}

/**
* Returns number of indexes used by default.
*
* @return int
*/
public static function getCountOfDefaultIndexes(): int
{
return \count(Database::INTERNAL_INDEXES);
}

/**
* Get maximum width, in bytes, allowed for a SQL row
* Return 0 when no restrictions apply
*
* @return int
*/
public static function getDocumentSizeLimit(): int
{
return 65535;
}
}
Loading