Remove db multimethod

This commit is contained in:
Jake Barnby 2025-08-19 00:36:33 +12:00
parent 4493131d86
commit 71a97a106a
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C
5 changed files with 4 additions and 76 deletions

View file

@ -62,20 +62,6 @@ class Create extends Action
since: '1.8.0',
replaceWith: 'tablesdb.createDatabase',
)
),
new Method(
namespace: 'tablesdb',
group: 'tablesdb',
name: 'createDatabase',
description: '/docs/references/tablesdb/create-database.md',
auth: [AuthType::KEY],
responses: [
new SDKResponse(
code: SwooleResponse::STATUS_CODE_CREATED,
model: UtopiaResponse::MODEL_DATABASE,
)
],
contentType: ContentType::JSON
)
])
->param('databaseId', '', new CustomId(), 'Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can\'t start with a special char. Max length is 36 chars.')
@ -103,8 +89,6 @@ class Create extends Action
} catch (DuplicateException) {
throw new Exception(Exception::DATABASE_ALREADY_EXISTS);
} catch (StructureException $e) {
// TODO: @Jake, how do we handle this document/row?
// there's no context awareness at this level on what the api is.
throw new Exception(Exception::DOCUMENT_INVALID_STRUCTURE, $e->getMessage());
}

View file

@ -51,23 +51,9 @@ class Delete extends Action
contentType: ContentType::NONE,
deprecated: new Deprecated(
since: '1.8.0',
replaceWith: 'tablesdb.deleteDatabase',
replaceWith: 'tablesdb.delete',
)
),
new Method(
namespace: 'tablesdb',
group: 'tablesdb',
name: 'deleteDatabase',
description: '/docs/references/tablesdb/delete-database.md',
auth: [AuthType::KEY],
responses: [
new SDKResponse(
code: SwooleResponse::STATUS_CODE_NOCONTENT,
model: UtopiaResponse::MODEL_NONE,
)
],
contentType: ContentType::NONE
),
])
->param('databaseId', '', new UID(), 'Database ID.')
->inject('response')

View file

@ -46,23 +46,9 @@ class Get extends Action
contentType: ContentType::JSON,
deprecated: new Deprecated(
since: '1.8.0',
replaceWith: 'tablesdb.getDatabase',
replaceWith: 'tablesdb.get',
)
),
new Method(
namespace: 'tablesdb',
group: 'tablesdb',
name: 'getDatabase',
description: '/docs/references/tablesdb/get-database.md',
auth: [AuthType::KEY],
responses: [
new SDKResponse(
code: SwooleResponse::STATUS_CODE_OK,
model: UtopiaResponse::MODEL_DATABASE,
)
],
contentType: ContentType::JSON
),
])
->param('databaseId', '', new UID(), 'Database ID.')
->inject('response')

View file

@ -52,23 +52,9 @@ class Update extends Action
contentType: ContentType::JSON,
deprecated: new Deprecated(
since: '1.8.0',
replaceWith: 'tablesdb.updateDatabase',
replaceWith: 'tablesdb.update',
)
),
new Method(
namespace: 'tablesdb',
group: 'tablesdb',
name: 'updateDatabase',
description: '/docs/references/tablesdb/update-database.md',
auth: [AuthType::KEY],
responses: [
new SDKResponse(
code: SwooleResponse::STATUS_CODE_OK,
model: UtopiaResponse::MODEL_DATABASE,
)
],
contentType: ContentType::JSON
),
])
->param('databaseId', '', new UID(), 'Database ID.')
->param('name', null, new Text(128), 'Database name. Max length: 128 chars.')

View file

@ -52,23 +52,9 @@ class XList extends Action
contentType: ContentType::JSON,
deprecated: new Deprecated(
since: '1.8.0',
replaceWith: 'tablesdb.listDatabases',
replaceWith: 'tablesdb.list',
)
),
new Method(
namespace: 'tablesdb',
group: 'tablesdb',
name: 'listDatabases',
description: '/docs/references/tablesdb/list-databases.md',
auth: [AuthType::KEY],
responses: [
new SDKResponse(
code: SwooleResponse::STATUS_CODE_OK,
model: UtopiaResponse::MODEL_DATABASE_LIST,
)
],
contentType: ContentType::JSON
),
])
->param('queries', [], new Databases(), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long. You may filter on the following attributes: ' . implode(', ', Databases::ALLOWED_ATTRIBUTES), true)
->param('search', '', new Text(256), 'Search term to filter your list results. Max length: 256 chars.', true)