Skip to content

Conversation

@joehan
Copy link
Contributor

@joehan joehan commented Dec 13, 2024

Description

Fixes a number of issues causing the data connect emulator to be totally broken in 13.29.0

1 - No longer provide User and Database when starting pglite. If these are passed in and the corresponding roles/databases don't exist in dataDir/--import, the emulator will crash.

2 - The ClearData query would fail with a null value in query string of EXECUTE statement if there were no tables in the DB. This new SQL is safe in that case

3 - Actually pipe thru --debug all the way to the emulator - forgot this step in yesterdays PR 🤦

Fixes #8062 8062

Scenarios Tested

  • From https://github.com/firebaseextended/codelab-dataconnect-web, start up the emulator and confirm that it does not crash.
  • Next, shut down the emulator and set a dataDir. Start up again and confirm it doesn't crash.
  • Next, shut down and start up again with a populated data dir. Confirm that there is no crash.
  • curl -X POST localhost:4400/dataconnect/clearData/, confirm no crash.
  • Add a type to your schema, add some data using VSCE, confirm it writes successfully.
  • Shut down, restart, confirm data is still there.
  • curl -X POST localhost:4400/dataconnect/clearData/, confirm data is cleared
  • Modify schema, confirm it migrates correctly

@joehan joehan requested a review from yuchenshi December 13, 2024 20:36
AND relnamespace = 'public'::regnamespace
);
INTO _clear;
EXECUTE COALESCE(_clear, 'select now()');
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
EXECUTE COALESCE(_clear, 'select now()');
EXECUTE COALESCE(_clear, 'SELECT now()');

@joehan joehan merged commit 0265a79 into master Dec 13, 2024
42 of 46 checks passed
@joehan joehan deleted the jh-fdc-fixes branch December 13, 2024 20:44
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.

Data Connect Emulator PostgreSQL initialization fails

2 participants