Skip to content
Snippets Groups Projects
Commit 38d0f9ce authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

init hasura from v2 datapods

parent 3b400f34
No related branches found
No related tags found
No related merge requests found
[]
version: 3
SET check_function_bodies = false;
CREATE TABLE public.profiles (
address text NOT NULL,
avatar bytea,
description text,
geoloc point,
title text,
city text,
socials jsonb,
created_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP,
updated_at timestamp with time zone DEFAULT CURRENT_TIMESTAMP
);
CREATE FUNCTION public.bytea_to_base64(data_row public.profiles) RETURNS text
LANGUAGE plpgsql STABLE
AS $$
BEGIN
RETURN ENCODE(data_row.avatar, 'base64');
END;
$$;
ALTER TABLE ONLY public.profiles
ADD CONSTRAINT profiles_pkey PRIMARY KEY (address);
...@@ -37,7 +37,7 @@ pubsub.addEventListener('message', (message) => { ...@@ -37,7 +37,7 @@ pubsub.addEventListener('message', (message) => {
const isValid = isValidSignature(bytesPayload, dag.sig, dag.pubk) const isValid = isValidSignature(bytesPayload, dag.sig, dag.pubk)
if (isValid) { if (isValid) {
// here we would do the processing // here we would do the processing
addToIndex(cid, dag) // addToIndex(cid, dag)
} else { } else {
feed.value.push('[invalid sig] ' + msg) feed.value.push('[invalid sig] ' + msg)
} }
......
...@@ -21,6 +21,7 @@ export interface IndexRequest { ...@@ -21,6 +21,7 @@ export interface IndexRequest {
/// kind of the document /// kind of the document
// the CID points to something describing the kind of the document // the CID points to something describing the kind of the document
// this allows to filter documents based on kinds of interest // this allows to filter documents based on kinds of interest
// TODO allow number for more compact known kinds
kind: CID kind: CID
/// data coming with the index request /// data coming with the index request
// only nullable field, useful for deletion document for example // only nullable field, useful for deletion document for example
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment