Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat array contains #335

Merged
merged 20 commits into from
Jan 19, 2024
Merged

Feat array contains #335

merged 20 commits into from
Jan 19, 2024

Conversation

abnegate
Copy link
Member

@abnegate abnegate commented Oct 9, 2023

  • Allow querying array contents using Query::contains

@abnegate abnegate requested a review from fogelito October 9, 2023 07:47
@@ -218,7 +218,7 @@ public function createAttribute(string $collection, string $id, string $type, in
$type = $this->getSQLType($type, $size, $signed);

if ($array) {
$type = 'LONGTEXT';
$type = 'JSON';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will have to migrate this on Appwrite

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK
Just saw on MariaDB when trying to create a JSON attribute, It creates this:
genres longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(genres))
While in Mysql it is really a JSON field

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm so we won't need a migration for MariaDB but will for MySQL.. this is a new problem 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can save it as Text + create a key / value Collection for search?

@abnegate abnegate requested a review from fanatic75 October 9, 2023 22:18
Copy link
Contributor

@fanatic75 fanatic75 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@abnegate abnegate merged commit 9846af4 into main Jan 19, 2024
2 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants