feat: Enhance Electric SQL integration and update notification handling

- Added initialization script for Electric SQL user in Docker setup.
- Updated Electric SQL client to support new PGlite architecture and sync functionality.
- Improved notification fetching and syncing logic in useNotifications hook.
- Refactored ElectricProvider to handle initialization state and errors more gracefully.
- Removed deprecated electric.config.ts file and adjusted package dependencies accordingly.
This commit is contained in:
Anish Sarkar 2026-01-12 14:53:18 +05:30
parent 82c6dd0221
commit f441c7b0ce
10 changed files with 376 additions and 1046 deletions

View file

@ -19,5 +19,12 @@ GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO electric;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO electric;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON SEQUENCES TO electric;
-- Note: Electric SQL will create its own publications automatically
-- We don't need to create publications here
-- Create the publication that Electric SQL expects
-- Electric will add tables to this publication when shapes are subscribed
DO $$
BEGIN
IF NOT EXISTS (SELECT FROM pg_publication WHERE pubname = 'electric_publication_default') THEN
CREATE PUBLICATION electric_publication_default;
END IF;
END
$$;