Skip to content

Commit

Permalink
update: Added telemetry table, gets an insert for each user click int…
Browse files Browse the repository at this point in the history
…eraction on the CUD buttons.
  • Loading branch information
Chriztiaan committed Jun 4, 2024
1 parent 4080a7e commit 190bb72
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 4,383 deletions.
18 changes: 17 additions & 1 deletion demos/react-supabase-web-widget/database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ create table
constraint pebbles_pkey primary key (id)
) tablespace pg_default;


-- Setup RLS for table
alter table public.pebbles enable row level security;

Expand All @@ -18,3 +17,20 @@ create policy "owned pebbles" on "public"."pebbles" for ALL using (

-- Create publication for powersync
create publication powersync for table public.pebbles;

-- Create operations table, used for telemetry. This table doesn't need to be synced to the device.
create table
public.operations (
id uuid not null default gen_random_uuid (),
created_at timestamp with time zone not null default now(),
operation text not null,
user_id uuid null,
constraint operations_pkey primary key (id)
) tablespace pg_default;

-- Setup RLS for table
alter table public.operations enable row level security;

create policy "user operations" on "public"."operations" for ALL using (
(auth.uid() = user_id)
);
1 change: 0 additions & 1 deletion demos/react-supabase-web-widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"@webflow/webflow-cli": "^1.6.9",
"async-mutex": "^0.5.0",
"autoprefixer": "10.4.14",
"cors": "^2.8.5",
"js-logger": "^1.6.1",
"lodash": "^4.17.21",
"postcss": "8.4.27",
Expand Down
Loading

0 comments on commit 190bb72

Please sign in to comment.