Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
ac67bdd
Add source reads from DB for Appwrite
abnegate Mar 12, 2025
50bf788
Fix attribute types
abnegate Mar 13, 2025
0545eda
Update attribute type checks
abnegate Mar 13, 2025
1fa9d55
Update resource counting
abnegate Mar 13, 2025
00da9d4
Add document export
abnegate Mar 13, 2025
cf4b0fc
Remove redundant logic
abnegate Mar 13, 2025
93887b1
Handle exceptions
abnegate Mar 13, 2025
3689c8f
Allow overriding source batch size per resource type
abnegate Mar 13, 2025
36b85c0
Merge remote-tracking branch 'origin/0.6.x' into feat-read-from-db
abnegate Mar 13, 2025
a6f6feb
Add data source
abnegate Mar 15, 2025
85ed7cd
Add source reader interface
abnegate Mar 15, 2025
09dac51
Add database reader impl
abnegate Mar 15, 2025
ec8da3f
Add API reader impl
abnegate Mar 15, 2025
a89b8c1
Init reader
abnegate Mar 15, 2025
4bd26f7
Split report to domain functions
abnegate Mar 15, 2025
f22d372
Read from reader
abnegate Mar 15, 2025
ef20d05
Update lock
abnegate Mar 15, 2025
eceaa6c
Default to API
abnegate Mar 15, 2025
3db6e7d
Fix ref
abnegate Mar 15, 2025
63e0025
Flatten relationships from DB
abnegate Mar 15, 2025
245ed2d
Fix extraneous key
abnegate Mar 15, 2025
c5b8fe1
Fix using external ID for document fetch
abnegate Mar 17, 2025
53006b9
Fix CLI ref
abnegate Mar 17, 2025
2803445
Fix query type
abnegate Mar 17, 2025
23c6288
Fix document return type
abnegate Mar 17, 2025
5246c0d
Remove unused methods
abnegate Mar 17, 2025
04c7aad
Add template query type to reader interface
abnegate Mar 17, 2025
abb3528
Implement API query methods
abnegate Mar 17, 2025
af2f321
Implement database query methods
abnegate Mar 17, 2025
2ad219a
Implement new query methods
abnegate Mar 17, 2025
7b2da8e
Select query updates
abnegate Mar 17, 2025
21b4388
Override database batch size per data source
abnegate Mar 17, 2025
9eeb3a5
Fix pagination
abnegate Mar 18, 2025
3828215
Format
abnegate Mar 18, 2025
a318b59
Naming
abnegate Mar 18, 2025
110cc87
Interface doc
abnegate Mar 18, 2025
4de7269
Format
abnegate Mar 18, 2025
f35772b
Fix collection pagination
abnegate Mar 18, 2025
fa93acc
Enum -> const
abnegate Mar 18, 2025
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
31 changes: 15 additions & 16 deletions bin/MigrationCLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ public function getSource(): Source
return new Appwrite(
$_ENV['SOURCE_APPWRITE_TEST_PROJECT'],
$_ENV['SOURCE_APPWRITE_TEST_ENDPOINT'],
$_ENV['SOURCE_APPWRITE_TEST_KEY']
$_ENV['SOURCE_APPWRITE_TEST_KEY'],
Appwrite::SOURCE_DATABASE,
$this->getDatabase(),
);
case 'supabase':
return new Supabase(
Expand Down Expand Up @@ -361,21 +363,18 @@ function (mixed $value, Document $attribute) {
}
);

$database = new Database(
new MariaDB(new PDO(
$_ENV['DESTINATION_APPWRITE_TEST_DSN'],
$_ENV['DESTINATION_APPWRITE_TEST_USER'],
$_ENV['DESTINATION_APPWRITE_TEST_PASSWORD'],
[
PDO::ATTR_TIMEOUT => 3,
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => true,
PDO::ATTR_STRINGIFY_FETCHES => true
],
)),
new Cache(new None())
);
$database = new Database(new MariaDB(new PDO(
$_ENV['DESTINATION_APPWRITE_TEST_DSN'],
$_ENV['DESTINATION_APPWRITE_TEST_USER'],
$_ENV['DESTINATION_APPWRITE_TEST_PASSWORD'],
[
PDO::ATTR_TIMEOUT => 3,
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
PDO::ATTR_EMULATE_PREPARES => true,
PDO::ATTR_STRINGIFY_FETCHES => true
],
)), new Cache(new None()));

$database
->setDatabase('appwrite')
Expand Down
114 changes: 58 additions & 56 deletions composer.lock

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

2 changes: 2 additions & 0 deletions src/Migration/Destinations/Appwrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ protected function createAttribute(Attribute $resource): bool
'databases',
$resource->getCollection()->getDatabase()->getId(),
);

if ($database->isEmpty()) {
throw new Exception(
resourceName: $resource->getName(),
Expand All @@ -451,6 +452,7 @@ protected function createAttribute(Attribute $resource): bool
'database_' . $database->getInternalId(),
$resource->getCollection()->getId(),
);

if ($collection->isEmpty()) {
throw new Exception(
resourceName: $resource->getName(),
Expand Down
Loading