Skip to content

tests: confirm that (and how) associative array values are handled in updates #15

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

Merged
merged 2 commits into from
Sep 30, 2020
Merged

tests: confirm that (and how) associative array values are handled in updates #15

merged 2 commits into from
Sep 30, 2020

Conversation

internalsystemerror
Copy link
Contributor

@internalsystemerror internalsystemerror commented Sep 27, 2020

This PR adds 2 tests:

it_adds_and_updates_a_doc()
it_updates_a_subset_of_a_doc()

This confirms that Postgres merges associative arrays but not recursively, as was possibly assumed.

SET doc = (to_jsonb(doc) || :doc){$metadataStr}

See: event-engine/php-document-store#17 for more

(Minor note: I also had to add a test password to the postgres db to get the postgres docker container to start)

@codeliner codeliner merged commit 468edfa into event-engine:master Sep 30, 2020
@internalsystemerror internalsystemerror deleted the test-nested-assoc-value branch October 1, 2020 12:07
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.

2 participants