this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: the problems with the tap setup

+116 -11
+1
.gitignore
··· 3 3 tap.db 4 4 tap.db-shm 5 5 tap.db-wal 6 + tap.log 6 7 db/internal 7 8 www/src/routeTree.gen.ts 8 9 www/.tanstack
+1
api/package.json
··· 17 17 "build:lexicons": "rm -rf ./src/lexicons && lex build --lexicons ./lexicons --import-ext \".ts\" --out ./src/lexicons" 18 18 }, 19 19 "dependencies": { 20 + "@atproto/api": "^0.19.11", 20 21 "@atproto/identity": "^0.4.12", 21 22 "@atproto/lex": "^0.0.25", 22 23 "@atproto/lexicon": "^0.6.2",
+3
api/src/db/drizzle/0005_fix_raw_records.sql
··· 1 + ALTER TABLE "raw_records" DROP CONSTRAINT "raw_records_tap_id_unique";--> statement-breakpoint 2 + DROP INDEX "raw_records_did_collection_rkey_index";--> statement-breakpoint 3 + CREATE UNIQUE INDEX "raw_records_did_collection_rkey_rev_index" ON "raw_records" USING btree ("did","collection","rkey","rev");
+1
api/src/db/drizzle/meta/0005_snapshot.json
··· 1 + {"id":"0c74eb7b-314d-4167-ad96-4e3121c2c949","prevId":"3cf2ee14-564d-4bfe-8b7d-da8a86b8e6bf","version":"7","dialect":"postgresql","tables":{"public.bsky_profile":{"name":"bsky_profile","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":true,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"display_name":{"name":"display_name","type":"text","primaryKey":false,"notNull":false},"description":{"name":"description","type":"text","primaryKey":false,"notNull":false},"pronouns":{"name":"pronouns","type":"text","primaryKey":false,"notNull":false},"website":{"name":"website","type":"text","primaryKey":false,"notNull":false},"avatar":{"name":"avatar","type":"text","primaryKey":false,"notNull":false},"banner":{"name":"banner","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{},"uniqueConstraints":{},"policies":{},"checkConstraints":{"bsky_profile_cid_only_null_if_deleted":{"name":"bsky_profile_cid_only_null_if_deleted","value":"(\"bsky_profile\".\"cid\" is not null or \"bsky_profile\".\"deleted\" = true)"}},"isRLSEnabled":false},"public.raw_records":{"name":"raw_records","schema":"","columns":{"id":{"name":"id","type":"uuidv7","primaryKey":true,"notNull":true},"tap_id":{"name":"tap_id","type":"bigint","primaryKey":false,"notNull":true},"received_at":{"name":"received_at","type":"timestamp with time zone","primaryKey":false,"notNull":true,"default":"now()"},"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"collection":{"name":"collection","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"action":{"name":"action","type":"raw_action","typeSchema":"public","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"record":{"name":"record","type":"jsonb","primaryKey":false,"notNull":false}},"indexes":{"raw_records_did_collection_rkey_rev_index":{"name":"raw_records_did_collection_rkey_rev_index","columns":[{"expression":"did","isExpression":false,"asc":true,"nulls":"last"},{"expression":"collection","isExpression":false,"asc":true,"nulls":"last"},{"expression":"rkey","isExpression":false,"asc":true,"nulls":"last"},{"expression":"rev","isExpression":false,"asc":true,"nulls":"last"}],"isUnique":true,"concurrently":false,"method":"btree","with":{}},"raw_records_collection_index":{"name":"raw_records_collection_index","columns":[{"expression":"collection","isExpression":false,"asc":true,"nulls":"last"}],"isUnique":false,"concurrently":false,"method":"btree","with":{}}},"foreignKeys":{},"compositePrimaryKeys":{},"uniqueConstraints":{},"policies":{},"checkConstraints":{"raw_records_not_null_unless_delete":{"name":"raw_records_not_null_unless_delete","value":"(\"raw_records\".\"action\" = 'delete' or (\"raw_records\".\"cid\" is not null and \"raw_records\".\"record\" is not null))"}},"isRLSEnabled":false},"public.tangled_artifact":{"name":"tangled_artifact","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"name":{"name":"name","type":"text","primaryKey":false,"notNull":false},"repo":{"name":"repo","type":"text","primaryKey":false,"notNull":false},"repo_did":{"name":"repo_did","type":"text","primaryKey":false,"notNull":false},"tag":{"name":"tag","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"artifact_ref":{"name":"artifact_ref","type":"text","primaryKey":false,"notNull":false},"artifact_size":{"name":"artifact_size","type":"integer","primaryKey":false,"notNull":false},"artifact_mime_type":{"name":"artifact_mime_type","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_artifact_did_rkey_pk":{"name":"tangled_artifact_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_artifact_cid_only_null_if_deleted":{"name":"tangled_artifact_cid_only_null_if_deleted","value":"(\"tangled_artifact\".\"cid\" is not null or \"tangled_artifact\".\"deleted\" = true)"},"tangled_artifact_non_null_fields":{"name":"tangled_artifact_non_null_fields","value":"(\"tangled_artifact\".\"deleted\" = true or (\"tangled_artifact\".\"name\" is not null and \"tangled_artifact\".\"tag\" is not null and \"tangled_artifact\".\"created_at\" is not null and \"tangled_artifact\".\"artifact_ref\" is not null and \"tangled_artifact\".\"artifact_size\" is not null and \"tangled_artifact\".\"artifact_mime_type\" is not null))"}},"isRLSEnabled":false},"public.tangled_collaborator":{"name":"tangled_collaborator","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"repo":{"name":"repo","type":"text","primaryKey":false,"notNull":false},"repo_did":{"name":"repo_did","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_collaborator_did_rkey_pk":{"name":"tangled_collaborator_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_collaborator_cid_only_null_if_deleted":{"name":"tangled_collaborator_cid_only_null_if_deleted","value":"(\"tangled_collaborator\".\"cid\" is not null or \"tangled_collaborator\".\"deleted\" = true)"},"tangled_collaborator_non_null_fields":{"name":"tangled_collaborator_non_null_fields","value":"(\"tangled_collaborator\".\"deleted\" = true or (\"tangled_collaborator\".\"subject\" is not null and \"tangled_collaborator\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_follow":{"name":"tangled_follow","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_follow_did_rkey_pk":{"name":"tangled_follow_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_follow_cid_only_null_if_deleted":{"name":"tangled_follow_cid_only_null_if_deleted","value":"(\"tangled_follow\".\"cid\" is not null or \"tangled_follow\".\"deleted\" = true)"},"tangled_follow_non_null_fields":{"name":"tangled_follow_non_null_fields","value":"(\"tangled_follow\".\"deleted\" = true or (\"tangled_follow\".\"subject\" is not null and \"tangled_follow\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_issue":{"name":"tangled_issue","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"repo":{"name":"repo","type":"text","primaryKey":false,"notNull":false},"repo_did":{"name":"repo_did","type":"text","primaryKey":false,"notNull":false},"title":{"name":"title","type":"text","primaryKey":false,"notNull":false},"body":{"name":"body","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"mentions":{"name":"mentions","type":"text[]","primaryKey":false,"notNull":false},"references":{"name":"references","type":"text[]","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_issue_did_rkey_pk":{"name":"tangled_issue_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_issue_cid_only_null_if_deleted":{"name":"tangled_issue_cid_only_null_if_deleted","value":"(\"tangled_issue\".\"cid\" is not null or \"tangled_issue\".\"deleted\" = true)"},"tangled_issue_non_null_fields":{"name":"tangled_issue_non_null_fields","value":"(\"tangled_issue\".\"deleted\" = true or (\"tangled_issue\".\"title\" is not null and \"tangled_issue\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_issue_comment":{"name":"tangled_issue_comment","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"issue":{"name":"issue","type":"text","primaryKey":false,"notNull":false},"body":{"name":"body","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"reply_to":{"name":"reply_to","type":"text","primaryKey":false,"notNull":false},"mentions":{"name":"mentions","type":"text[]","primaryKey":false,"notNull":false},"references":{"name":"references","type":"text[]","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_issue_comment_did_rkey_pk":{"name":"tangled_issue_comment_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_issue_comment_cid_only_null_if_deleted":{"name":"tangled_issue_comment_cid_only_null_if_deleted","value":"(\"tangled_issue_comment\".\"cid\" is not null or \"tangled_issue_comment\".\"deleted\" = true)"},"tangled_issue_comment_non_null_fields":{"name":"tangled_issue_comment_non_null_fields","value":"(\"tangled_issue_comment\".\"deleted\" = true or (\"tangled_issue_comment\".\"issue\" is not null and \"tangled_issue_comment\".\"body\" is not null and \"tangled_issue_comment\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_issue_state":{"name":"tangled_issue_state","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"issue":{"name":"issue","type":"text","primaryKey":false,"notNull":false},"state":{"name":"state","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_issue_state_did_rkey_pk":{"name":"tangled_issue_state_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_issue_state_cid_only_null_if_deleted":{"name":"tangled_issue_state_cid_only_null_if_deleted","value":"(\"tangled_issue_state\".\"cid\" is not null or \"tangled_issue_state\".\"deleted\" = true)"},"tangled_issue_state_non_null_fields":{"name":"tangled_issue_state_non_null_fields","value":"(\"tangled_issue_state\".\"deleted\" = true or (\"tangled_issue_state\".\"issue\" is not null and \"tangled_issue_state\".\"state\" is not null))"}},"isRLSEnabled":false},"public.tangled_knot":{"name":"tangled_knot","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_knot_did_rkey_pk":{"name":"tangled_knot_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_knot_cid_only_null_if_deleted":{"name":"tangled_knot_cid_only_null_if_deleted","value":"(\"tangled_knot\".\"cid\" is not null or \"tangled_knot\".\"deleted\" = true)"},"tangled_knot_non_null_fields":{"name":"tangled_knot_non_null_fields","value":"(\"tangled_knot\".\"deleted\" = true or \"tangled_knot\".\"created_at\" is not null)"}},"isRLSEnabled":false},"public.tangled_knot_member":{"name":"tangled_knot_member","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"domain":{"name":"domain","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_knot_member_did_rkey_pk":{"name":"tangled_knot_member_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_knot_member_cid_only_null_if_deleted":{"name":"tangled_knot_member_cid_only_null_if_deleted","value":"(\"tangled_knot_member\".\"cid\" is not null or \"tangled_knot_member\".\"deleted\" = true)"},"tangled_knot_member_non_null_fields":{"name":"tangled_knot_member_non_null_fields","value":"(\"tangled_knot_member\".\"deleted\" = true or (\"tangled_knot_member\".\"subject\" is not null and \"tangled_knot_member\".\"domain\" is not null and \"tangled_knot_member\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_label_definition":{"name":"tangled_label_definition","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"name":{"name":"name","type":"text","primaryKey":false,"notNull":false},"value_type":{"name":"value_type","type":"text","primaryKey":false,"notNull":false},"value_format":{"name":"value_format","type":"text","primaryKey":false,"notNull":false},"value_enum":{"name":"value_enum","type":"text[]","primaryKey":false,"notNull":false},"scope":{"name":"scope","type":"text[]","primaryKey":false,"notNull":false},"color":{"name":"color","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"multiple":{"name":"multiple","type":"boolean","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_label_definition_did_rkey_pk":{"name":"tangled_label_definition_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_label_definition_cid_only_null_if_deleted":{"name":"tangled_label_definition_cid_only_null_if_deleted","value":"(\"tangled_label_definition\".\"cid\" is not null or \"tangled_label_definition\".\"deleted\" = true)"},"tangled_label_definition_non_null_fields":{"name":"tangled_label_definition_non_null_fields","value":"(\"tangled_label_definition\".\"deleted\" = true or (\"tangled_label_definition\".\"name\" is not null and \"tangled_label_definition\".\"value_type\" is not null and \"tangled_label_definition\".\"value_format\" is not null and \"tangled_label_definition\".\"scope\" is not null and \"tangled_label_definition\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_label_op":{"name":"tangled_label_op","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"performed_at":{"name":"performed_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"add":{"name":"add","type":"jsonb","primaryKey":false,"notNull":false},"delete":{"name":"delete","type":"jsonb","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_label_op_did_rkey_pk":{"name":"tangled_label_op_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_label_op_cid_only_null_if_deleted":{"name":"tangled_label_op_cid_only_null_if_deleted","value":"(\"tangled_label_op\".\"cid\" is not null or \"tangled_label_op\".\"deleted\" = true)"},"tangled_label_op_non_null_fields":{"name":"tangled_label_op_non_null_fields","value":"(\"tangled_label_op\".\"deleted\" = true or (\"tangled_label_op\".\"subject\" is not null and \"tangled_label_op\".\"add\" is not null and \"tangled_label_op\".\"delete\" is not null and \"tangled_label_op\".\"performed_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_pipeline":{"name":"tangled_pipeline","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"trigger_metadata_kind":{"name":"trigger_metadata_kind","type":"tangled_pipeline_trigger_metadata_kind","typeSchema":"public","primaryKey":false,"notNull":false},"trigger_metadata_repo_knot":{"name":"trigger_metadata_repo_knot","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_repo_did":{"name":"trigger_metadata_repo_did","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_repo_repo_did":{"name":"trigger_metadata_repo_repo_did","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_repo_repo":{"name":"trigger_metadata_repo_repo","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_repo_default_branch":{"name":"trigger_metadata_repo_default_branch","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_push_ref":{"name":"trigger_metadata_push_ref","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_push_new_sha":{"name":"trigger_metadata_push_new_sha","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_push_old_sha":{"name":"trigger_metadata_push_old_sha","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_pull_source_branch":{"name":"trigger_metadata_pull_source_branch","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_pull_target_branch":{"name":"trigger_metadata_pull_target_branch","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_pull_source_sha":{"name":"trigger_metadata_pull_source_sha","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_pull_action":{"name":"trigger_metadata_pull_action","type":"text","primaryKey":false,"notNull":false},"trigger_metadata_manual":{"name":"trigger_metadata_manual","type":"jsonb","primaryKey":false,"notNull":false},"workflows":{"name":"workflows","type":"jsonb","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_pipeline_did_rkey_pk":{"name":"tangled_pipeline_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_pipeline_cid_only_null_if_deleted":{"name":"tangled_pipeline_cid_only_null_if_deleted","value":"(\"tangled_pipeline\".\"cid\" is not null or \"tangled_pipeline\".\"deleted\" = true)"},"tangled_pipeline_non_null_fields":{"name":"tangled_pipeline_non_null_fields","value":"(\"tangled_pipeline\".\"deleted\" = true or (\"tangled_pipeline\".\"trigger_metadata_kind\" is not null and \"tangled_pipeline\".\"trigger_metadata_repo_knot\" is not null and \"tangled_pipeline\".\"trigger_metadata_repo_did\" is not null and \"tangled_pipeline\".\"trigger_metadata_repo_default_branch\" is not null and \"tangled_pipeline\".\"workflows\" is not null))"}},"isRLSEnabled":false},"public.tangled_pipeline_status":{"name":"tangled_pipeline_status","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"pipeline":{"name":"pipeline","type":"text","primaryKey":false,"notNull":false},"workflow":{"name":"workflow","type":"text","primaryKey":false,"notNull":false},"status":{"name":"status","type":"tangled_pipeline_status_status","typeSchema":"public","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"error":{"name":"error","type":"text","primaryKey":false,"notNull":false},"exit_code":{"name":"exit_code","type":"integer","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_pipeline_status_did_rkey_pk":{"name":"tangled_pipeline_status_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_pipeline_status_cid_only_null_if_deleted":{"name":"tangled_pipeline_status_cid_only_null_if_deleted","value":"(\"tangled_pipeline_status\".\"cid\" is not null or \"tangled_pipeline_status\".\"deleted\" = true)"},"tangled_pipeline_status_non_null_fields":{"name":"tangled_pipeline_status_non_null_fields","value":"(\"tangled_pipeline_status\".\"deleted\" = true or (\"tangled_pipeline_status\".\"pipeline\" is not null and \"tangled_pipeline_status\".\"workflow\" is not null and \"tangled_pipeline_status\".\"status\" is not null and \"tangled_pipeline_status\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_profile":{"name":"tangled_profile","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":true,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"avatar":{"name":"avatar","type":"text","primaryKey":false,"notNull":false},"description":{"name":"description","type":"text","primaryKey":false,"notNull":false},"links":{"name":"links","type":"text[]","primaryKey":false,"notNull":false},"stats":{"name":"stats","type":"text[]","primaryKey":false,"notNull":false},"bluesky":{"name":"bluesky","type":"boolean","primaryKey":false,"notNull":false},"location":{"name":"location","type":"text","primaryKey":false,"notNull":false},"pinned_repositories":{"name":"pinned_repositories","type":"text[]","primaryKey":false,"notNull":false},"pronouns":{"name":"pronouns","type":"text","primaryKey":false,"notNull":false},"preferred_handle":{"name":"preferred_handle","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_profile_cid_only_null_if_deleted":{"name":"tangled_profile_cid_only_null_if_deleted","value":"(\"tangled_profile\".\"cid\" is not null or \"tangled_profile\".\"deleted\" = true)"},"tangled_profile_non_null_fields":{"name":"tangled_profile_non_null_fields","value":"(\"tangled_profile\".\"deleted\" = true or \"tangled_profile\".\"bluesky\" is not null)"}},"isRLSEnabled":false},"public.tangled_public_key":{"name":"tangled_public_key","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"key":{"name":"key","type":"text","primaryKey":false,"notNull":false},"name":{"name":"name","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_public_key_did_rkey_pk":{"name":"tangled_public_key_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_public_key_cid_only_null_if_deleted":{"name":"tangled_public_key_cid_only_null_if_deleted","value":"(\"tangled_public_key\".\"cid\" is not null or \"tangled_public_key\".\"deleted\" = true)"},"tangled_public_key_non_null_fields":{"name":"tangled_public_key_non_null_fields","value":"(\"tangled_public_key\".\"deleted\" = true or (\"tangled_public_key\".\"key\" is not null and \"tangled_public_key\".\"name\" is not null and \"tangled_public_key\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_pull":{"name":"tangled_pull","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"title":{"name":"title","type":"text","primaryKey":false,"notNull":false},"body":{"name":"body","type":"text","primaryKey":false,"notNull":false},"rounds":{"name":"rounds","type":"jsonb","primaryKey":false,"notNull":false},"source_branch":{"name":"source_branch","type":"text","primaryKey":false,"notNull":false},"source_repo":{"name":"source_repo","type":"text","primaryKey":false,"notNull":false},"source_repo_did":{"name":"source_repo_did","type":"text","primaryKey":false,"notNull":false},"target_branch":{"name":"target_branch","type":"text","primaryKey":false,"notNull":false},"target_repo":{"name":"target_repo","type":"text","primaryKey":false,"notNull":false},"target_repo_did":{"name":"target_repo_did","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"mentions":{"name":"mentions","type":"text[]","primaryKey":false,"notNull":false},"references":{"name":"references","type":"text[]","primaryKey":false,"notNull":false},"dependent_on":{"name":"dependent_on","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_pull_did_rkey_pk":{"name":"tangled_pull_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_pull_cid_only_null_if_deleted":{"name":"tangled_pull_cid_only_null_if_deleted","value":"(\"tangled_pull\".\"cid\" is not null or \"tangled_pull\".\"deleted\" = true)"},"tangled_pull_non_null_fields":{"name":"tangled_pull_non_null_fields","value":"(\"tangled_pull\".\"deleted\" = true or (\"tangled_pull\".\"target_branch\" is not null and \"tangled_pull\".\"title\" is not null and \"tangled_pull\".\"created_at\" is not null and \"tangled_pull\".\"rounds\" is not null))"}},"isRLSEnabled":false},"public.tangled_pull_comment":{"name":"tangled_pull_comment","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"pull":{"name":"pull","type":"text","primaryKey":false,"notNull":false},"body":{"name":"body","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"mentions":{"name":"mentions","type":"text[]","primaryKey":false,"notNull":false},"references":{"name":"references","type":"text[]","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_pull_comment_did_rkey_pk":{"name":"tangled_pull_comment_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_pull_comment_cid_only_null_if_deleted":{"name":"tangled_pull_comment_cid_only_null_if_deleted","value":"(\"tangled_pull_comment\".\"cid\" is not null or \"tangled_pull_comment\".\"deleted\" = true)"},"tangled_pull_comment_non_null_fields":{"name":"tangled_pull_comment_non_null_fields","value":"(\"tangled_pull_comment\".\"deleted\" = true or (\"tangled_pull_comment\".\"pull\" is not null and \"tangled_pull_comment\".\"body\" is not null and \"tangled_pull_comment\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_pull_status":{"name":"tangled_pull_status","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"pull":{"name":"pull","type":"text","primaryKey":false,"notNull":false},"status":{"name":"status","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_pull_status_did_rkey_pk":{"name":"tangled_pull_status_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_pull_status_cid_only_null_if_deleted":{"name":"tangled_pull_status_cid_only_null_if_deleted","value":"(\"tangled_pull_status\".\"cid\" is not null or \"tangled_pull_status\".\"deleted\" = true)"},"tangled_pull_status_non_null_fields":{"name":"tangled_pull_status_non_null_fields","value":"(\"tangled_pull_status\".\"deleted\" = true or (\"tangled_pull_status\".\"pull\" is not null and \"tangled_pull_status\".\"status\" is not null))"}},"isRLSEnabled":false},"public.tangled_reaction":{"name":"tangled_reaction","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"reaction":{"name":"reaction","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_reaction_did_rkey_pk":{"name":"tangled_reaction_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_reaction_cid_only_null_if_deleted":{"name":"tangled_reaction_cid_only_null_if_deleted","value":"(\"tangled_reaction\".\"cid\" is not null or \"tangled_reaction\".\"deleted\" = true)"},"tangled_reaction_non_null_fields":{"name":"tangled_reaction_non_null_fields","value":"(\"tangled_reaction\".\"deleted\" = true or (\"tangled_reaction\".\"subject\" is not null and \"tangled_reaction\".\"reaction\" is not null and \"tangled_reaction\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_ref_update":{"name":"tangled_ref_update","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"ref":{"name":"ref","type":"text","primaryKey":false,"notNull":false},"committer_did":{"name":"committer_did","type":"text","primaryKey":false,"notNull":false},"owner_did":{"name":"owner_did","type":"text","primaryKey":false,"notNull":false},"repo_did":{"name":"repo_did","type":"text","primaryKey":false,"notNull":false},"repo_name":{"name":"repo_name","type":"text","primaryKey":false,"notNull":false},"old_sha":{"name":"old_sha","type":"text","primaryKey":false,"notNull":false},"new_sha":{"name":"new_sha","type":"text","primaryKey":false,"notNull":false},"meta_is_default_ref":{"name":"meta_is_default_ref","type":"boolean","primaryKey":false,"notNull":false},"meta_lang_breakdown":{"name":"meta_lang_breakdown","type":"jsonb","primaryKey":false,"notNull":false},"meta_commit_count":{"name":"meta_commit_count","type":"jsonb","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_ref_update_did_rkey_pk":{"name":"tangled_ref_update_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_ref_update_cid_only_null_if_deleted":{"name":"tangled_ref_update_cid_only_null_if_deleted","value":"(\"tangled_ref_update\".\"cid\" is not null or \"tangled_ref_update\".\"deleted\" = true)"},"tangled_ref_update_non_null_fields":{"name":"tangled_ref_update_non_null_fields","value":"(\"tangled_ref_update\".\"deleted\" = true or (\"tangled_ref_update\".\"ref\" is not null and \"tangled_ref_update\".\"committer_did\" is not null and \"tangled_ref_update\".\"repo_name\" is not null and \"tangled_ref_update\".\"old_sha\" is not null and \"tangled_ref_update\".\"new_sha\" is not null and \"tangled_ref_update\".\"meta_is_default_ref\" is not null and \"tangled_ref_update\".\"meta_commit_count\" is not null))"}},"isRLSEnabled":false},"public.tangled_repo":{"name":"tangled_repo","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"name":{"name":"name","type":"text","primaryKey":false,"notNull":false},"knot":{"name":"knot","type":"text","primaryKey":false,"notNull":false},"spindle":{"name":"spindle","type":"text","primaryKey":false,"notNull":false},"description":{"name":"description","type":"text","primaryKey":false,"notNull":false},"website":{"name":"website","type":"text","primaryKey":false,"notNull":false},"topics":{"name":"topics","type":"text[]","primaryKey":false,"notNull":false},"source":{"name":"source","type":"text","primaryKey":false,"notNull":false},"labels":{"name":"labels","type":"text[]","primaryKey":false,"notNull":false},"repo_did":{"name":"repo_did","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_repo_did_rkey_pk":{"name":"tangled_repo_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_repo_cid_only_null_if_deleted":{"name":"tangled_repo_cid_only_null_if_deleted","value":"(\"tangled_repo\".\"cid\" is not null or \"tangled_repo\".\"deleted\" = true)"},"tangled_repo_non_null_fields":{"name":"tangled_repo_non_null_fields","value":"(\"tangled_repo\".\"deleted\" = true or (\"tangled_repo\".\"name\" is not null and \"tangled_repo\".\"knot\" is not null and \"tangled_repo\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_spindle":{"name":"tangled_spindle","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_spindle_did_rkey_pk":{"name":"tangled_spindle_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_spindle_cid_only_null_if_deleted":{"name":"tangled_spindle_cid_only_null_if_deleted","value":"(\"tangled_spindle\".\"cid\" is not null or \"tangled_spindle\".\"deleted\" = true)"},"tangled_spindle_non_null_fields":{"name":"tangled_spindle_non_null_fields","value":"(\"tangled_spindle\".\"deleted\" = true or \"tangled_spindle\".\"created_at\" is not null)"}},"isRLSEnabled":false},"public.tangled_spindle_member":{"name":"tangled_spindle_member","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"instance":{"name":"instance","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_spindle_member_did_rkey_pk":{"name":"tangled_spindle_member_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_spindle_member_cid_only_null_if_deleted":{"name":"tangled_spindle_member_cid_only_null_if_deleted","value":"(\"tangled_spindle_member\".\"cid\" is not null or \"tangled_spindle_member\".\"deleted\" = true)"},"tangled_spindle_member_non_null_fields":{"name":"tangled_spindle_member_non_null_fields","value":"(\"tangled_spindle_member\".\"deleted\" = true or (\"tangled_spindle_member\".\"subject\" is not null and \"tangled_spindle_member\".\"instance\" is not null and \"tangled_spindle_member\".\"created_at\" is not null))"}},"isRLSEnabled":false},"public.tangled_star":{"name":"tangled_star","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"subject":{"name":"subject","type":"text","primaryKey":false,"notNull":false},"subject_did":{"name":"subject_did","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_star_did_rkey_pk":{"name":"tangled_star_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_star_cid_only_null_if_deleted":{"name":"tangled_star_cid_only_null_if_deleted","value":"(\"tangled_star\".\"cid\" is not null or \"tangled_star\".\"deleted\" = true)"},"tangled_star_non_null_fields":{"name":"tangled_star_non_null_fields","value":"(\"tangled_star\".\"deleted\" = true or \"tangled_star\".\"created_at\" is not null)"}},"isRLSEnabled":false},"public.tangled_string":{"name":"tangled_string","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"filename":{"name":"filename","type":"text","primaryKey":false,"notNull":false},"description":{"name":"description","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false},"contents":{"name":"contents","type":"text","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_string_did_rkey_pk":{"name":"tangled_string_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_string_cid_only_null_if_deleted":{"name":"tangled_string_cid_only_null_if_deleted","value":"(\"tangled_string\".\"cid\" is not null or \"tangled_string\".\"deleted\" = true)"},"tangled_string_non_null_fields":{"name":"tangled_string_non_null_fields","value":"(\"tangled_string\".\"deleted\" = true or (\"tangled_string\".\"filename\" is not null and \"tangled_string\".\"description\" is not null and \"tangled_string\".\"created_at\" is not null and \"tangled_string\".\"contents\" is not null))"}},"isRLSEnabled":false},"public.tangled_vouch":{"name":"tangled_vouch","schema":"","columns":{"did":{"name":"did","type":"text","primaryKey":false,"notNull":true},"rev":{"name":"rev","type":"text","primaryKey":false,"notNull":true},"rkey":{"name":"rkey","type":"text","primaryKey":false,"notNull":true},"cid":{"name":"cid","type":"text","primaryKey":false,"notNull":false},"deleted":{"name":"deleted","type":"boolean","primaryKey":false,"notNull":true},"kind":{"name":"kind","type":"tangled_vouch_kind","typeSchema":"public","primaryKey":false,"notNull":false},"reason":{"name":"reason","type":"text","primaryKey":false,"notNull":false},"created_at":{"name":"created_at","type":"timestamp with time zone","primaryKey":false,"notNull":false}},"indexes":{},"foreignKeys":{},"compositePrimaryKeys":{"tangled_vouch_did_rkey_pk":{"name":"tangled_vouch_did_rkey_pk","columns":["did","rkey"]}},"uniqueConstraints":{},"policies":{},"checkConstraints":{"tangled_vouch_cid_only_null_if_deleted":{"name":"tangled_vouch_cid_only_null_if_deleted","value":"(\"tangled_vouch\".\"cid\" is not null or \"tangled_vouch\".\"deleted\" = true)"},"tangled_vouch_non_null_fields":{"name":"tangled_vouch_non_null_fields","value":"(\"tangled_vouch\".\"deleted\" = true or (\"tangled_vouch\".\"kind\" is not null and \"tangled_vouch\".\"created_at\" is not null))"}},"isRLSEnabled":false}},"enums":{"public.raw_action":{"name":"raw_action","schema":"public","values":["create","update","delete"]},"public.tangled_pipeline_status_status":{"name":"tangled_pipeline_status_status","schema":"public","values":["pending","running","failed","timeout","cancelled","success"]},"public.tangled_pipeline_trigger_metadata_kind":{"name":"tangled_pipeline_trigger_metadata_kind","schema":"public","values":["push","pull_request","manual"]},"public.tangled_vouch_kind":{"name":"tangled_vouch_kind","schema":"public","values":["vouch","denounce"]}},"schemas":{},"sequences":{},"roles":{},"policies":{},"views":{},"_meta":{"columns":{},"schemas":{},"tables":{}}}
+7
api/src/db/drizzle/meta/_journal.json
··· 36 36 "when": 1777842176815, 37 37 "tag": "0004_bsky_profile", 38 38 "breakpoints": true 39 + }, 40 + { 41 + "idx": 5, 42 + "version": "7", 43 + "when": 1777847015982, 44 + "tag": "0005_fix_raw_records", 45 + "breakpoints": true 39 46 } 40 47 ] 41 48 }
+15 -3
api/src/db/tables/raw_records.ts
··· 1 - import { bigint, check, index, jsonb, pgEnum, pgTable, text, timestamp } from "drizzle-orm/pg-core"; 1 + import { 2 + bigint, 3 + check, 4 + index, 5 + jsonb, 6 + pgEnum, 7 + pgTable, 8 + text, 9 + timestamp, 10 + uniqueIndex, 11 + } from "drizzle-orm/pg-core"; 2 12 import { uuidv7WithDefault } from "../helpers.ts"; 3 13 import { and, isNotNull, or, sql } from "drizzle-orm"; 4 14 ··· 8 18 "raw_records", 9 19 { 10 20 id: uuidv7WithDefault().primaryKey(), 11 - tap_id: bigint({ mode: "bigint" }).notNull().unique(), 21 + tap_id: bigint({ mode: "bigint" }).notNull(), 12 22 received_at: timestamp({ withTimezone: true }).notNull().defaultNow(), 23 + 13 24 did: text().notNull(), 14 25 rev: text().notNull(), 15 26 collection: text().notNull(), 16 27 rkey: text().notNull(), 28 + 17 29 action: actionEnum().notNull(), 18 30 cid: text(), // nullable on deletes 19 31 record: jsonb(), // nullable on deletes 20 32 }, 21 33 (table) => [ 34 + uniqueIndex().on(table.did, table.collection, table.rkey, table.rev), 22 35 check( 23 36 "raw_records_not_null_unless_delete", 24 37 or(sql`${table.action} = 'delete'`, and(isNotNull(table.cid), isNotNull(table.record)))!, 25 38 ), 26 39 index().on(table.collection), 27 - index().on(table.did, table.collection, table.rkey), 28 40 ], 29 41 );
+49 -7
api/src/ingest/tap.ts
··· 1 1 import { Tap, type RecordEvent, type TapHandler } from "@atproto/tap"; 2 - import { jsonToLex, type JsonValue, lexToJson } from "@atproto/lex"; 2 + import { type JsonValue, lexToJson } from "@atproto/lex"; 3 + import { Agent, CredentialSession } from "@atproto/api"; 3 4 import { db } from "../db/index.ts"; 4 5 import { rawRecords } from "../db/tables/raw_records.ts"; 5 6 import { TAP_URL } from "../lib/constants.ts"; ··· 118 119 const insertedRows = await db 119 120 .insert(rawRecords) 120 121 .values(mappedBatch) 121 - .onConflictDoNothing({ target: rawRecords.tap_id }) 122 + .onConflictDoNothing({ 123 + target: [rawRecords.did, rawRecords.collection, rawRecords.rkey, rawRecords.rev], 124 + }) 122 125 .returning(); 123 - const insertedTapIds = new Set(insertedRows.map((row) => row.tap_id)); 124 - console.log(`Inserted ${insertedTapIds.size} rows.`); 125 - 126 - const insertedRecords = mappedBatch.filter(({ tap_id }) => insertedTapIds.has(tap_id)); 126 + console.log(`Inserted ${insertedRows.length} rows.`); 127 127 128 128 // kinda sus, but trust bro 129 - syncLevelTwoTables(insertedRecords as CollectionHandlerArg[]); 129 + syncLevelTwoTables(mappedBatch as CollectionHandlerArg[]); 130 130 131 131 await Promise.all(batch.map(([_, ack]) => ack())); 132 132 } catch (err) { ··· 183 183 console.log("Started Tap Importer..."); 184 184 185 185 export { channel }; 186 + 187 + // Add non-profile repos to collection list 188 + async function seedTap() { 189 + try { 190 + const session = new CredentialSession(new URL("https://relay1.us-west.bsky.network")); 191 + const agent = new Agent(session); 192 + const collections = Object.keys(COLLECTION_HANDLERS).filter((c) => c.startsWith("sh.tangled")); 193 + 194 + let repos: string[] = []; 195 + 196 + for (const collection of collections) { 197 + console.log("Getting repos from", collection, "to seed"); 198 + 199 + let cursor: string | undefined = undefined; 200 + 201 + while (true) { 202 + const repoPage = await agent.com.atproto.sync.listReposByCollection({ 203 + collection, 204 + limit: 1000, 205 + cursor, 206 + }); 207 + const repoDids = repoPage.data.repos.map((r) => r.did); 208 + cursor = repoPage.data.cursor; 209 + repos.push(...repoDids); 210 + if (repoDids.length === 0 || !cursor) break; 211 + } 212 + } 213 + 214 + // dedup 215 + repos = [...new Set(repos)]; 216 + 217 + // push to tap, since it's so lazy 218 + for (let i = 0; i < repos.length; i += 500) { 219 + await tap.addRepos(repos.slice(i, i + 500)); 220 + } 221 + console.log("Seeded", repos.length, "into the tap"); 222 + } catch (err) { 223 + console.error("Oops tap seeding failed", err); 224 + } 225 + } 226 + seedTap(); 227 + setInterval(seedTap, 1000 * 60 * 10); 186 228 187 229 // (async () => { 188 230 // const fullIngest = await db.select().from(rawRecords);
+36
pnpm-lock.yaml
··· 17 17 18 18 api: 19 19 dependencies: 20 + '@atproto/api': 21 + specifier: ^0.19.11 22 + version: 0.19.11 20 23 '@atproto/identity': 21 24 specifier: ^0.4.12 22 25 version: 0.4.12 ··· 131 134 '@atproto-labs/simple-store@0.3.0': 132 135 resolution: {integrity: sha512-nOb6ONKBRJHRlukW1sVawUkBqReLlLx6hT35VS3imaNPwiXDxLnTK7lxw3Lrl9k5yugSBDQAkZAq3MPTEFSUBQ==, tarball: https://registry.npmjs.org/@atproto-labs/simple-store/-/simple-store-0.3.0.tgz} 133 136 137 + '@atproto/api@0.19.11': 138 + resolution: {integrity: sha512-7V4Sg6hcv/UxoXobjfvy/Ox2ioKQtZ3DzbsiFndYCcBfsZ5GO8rNEroHPq3hT0CFBJK1NAD6JfOtTBN2z267Xg==, tarball: https://registry.npmjs.org/@atproto/api/-/api-0.19.11.tgz} 139 + 134 140 '@atproto/common-web@0.4.21': 135 141 resolution: {integrity: sha512-Odq+wdk3YNasGCjjlpl3bCIPvqYHige5DLfMkIffNv/2PI/iIj5ZvAvMvJlJ59OhReKSxtpI0invx5UQPc3+fw==, tarball: https://registry.npmjs.org/@atproto/common-web/-/common-web-0.4.21.tgz} 136 142 ··· 197 203 '@atproto/ws-client@0.0.4': 198 204 resolution: {integrity: sha512-dox1XIymuC7/ZRhUqKezIGgooZS45C6vHCfu0PnWjfvsLCK2kAlnvX4IBkA/WpcoijDhQ9ejChnFbo/sLmgvAg==, tarball: https://registry.npmjs.org/@atproto/ws-client/-/ws-client-0.0.4.tgz} 199 205 engines: {node: '>=18.7.0'} 206 + 207 + '@atproto/xrpc@0.7.7': 208 + resolution: {integrity: sha512-K1ZyO/BU8JNtXX5dmPp7b5UrkLMMqpsIa/Lrj5D3Su+j1Xwq1m6QJ2XJ1AgjEjkI1v4Muzm7klianLE6XGxtmA==, tarball: https://registry.npmjs.org/@atproto/xrpc/-/xrpc-0.7.7.tgz} 200 209 201 210 '@babel/code-frame@7.27.1': 202 211 resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==, tarball: https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz} ··· 1338 1347 resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==, tarball: https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz} 1339 1348 engines: {node: '>=8.0.0'} 1340 1349 1350 + await-lock@2.2.2: 1351 + resolution: {integrity: sha512-aDczADvlvTGajTDjcjpJMqRkOF6Qdz3YbPZm/PyW6tKPkx2hlYBzxMhEywM/tU72HrVZjgl5VCdRuMlA7pZ8Gw==, tarball: https://registry.npmjs.org/await-lock/-/await-lock-2.2.2.tgz} 1352 + 1341 1353 babel-dead-code-elimination@1.0.12: 1342 1354 resolution: {integrity: sha512-GERT7L2TiYcYDtYk1IpD+ASAYXjKbLTDPhBtYj7X1NuRMDTMtAx9kyBenub1Ev41lo91OHCKdmP+egTDmfQ7Ig==, tarball: https://registry.npmjs.org/babel-dead-code-elimination/-/babel-dead-code-elimination-1.0.12.tgz} 1343 1355 ··· 2069 2081 resolution: {integrity: sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==, tarball: https://registry.npmjs.org/tinypool/-/tinypool-2.1.0.tgz} 2070 2082 engines: {node: ^20.0.0 || >=22.0.0} 2071 2083 2084 + tlds@1.261.0: 2085 + resolution: {integrity: sha512-QXqwfEl9ddlGBaRFXIvNKK6OhipSiLXuRuLJX5DErz0o0Q0rYxulWLdFryTkV5PkdZct5iMInwYEGe/eR++1AA==, tarball: https://registry.npmjs.org/tlds/-/tlds-1.261.0.tgz} 2086 + hasBin: true 2087 + 2072 2088 to-regex-range@5.0.1: 2073 2089 resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==, tarball: https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz} 2074 2090 engines: {node: '>=8.0'} ··· 2255 2271 2256 2272 '@atproto-labs/simple-store@0.3.0': {} 2257 2273 2274 + '@atproto/api@0.19.11': 2275 + dependencies: 2276 + '@atproto/common-web': 0.4.21 2277 + '@atproto/lexicon': 0.6.2 2278 + '@atproto/syntax': 0.5.4 2279 + '@atproto/xrpc': 0.7.7 2280 + await-lock: 2.2.2 2281 + multiformats: 9.9.0 2282 + tlds: 1.261.0 2283 + zod: 3.25.76 2284 + 2258 2285 '@atproto/common-web@0.4.21': 2259 2286 dependencies: 2260 2287 '@atproto/lex-data': 0.0.15 ··· 2406 2433 transitivePeerDependencies: 2407 2434 - bufferutil 2408 2435 - utf-8-validate 2436 + 2437 + '@atproto/xrpc@0.7.7': 2438 + dependencies: 2439 + '@atproto/lexicon': 0.6.2 2440 + zod: 3.25.76 2409 2441 2410 2442 '@babel/code-frame@7.27.1': 2411 2443 dependencies: ··· 3278 3310 3279 3311 atomic-sleep@1.0.0: {} 3280 3312 3313 + await-lock@2.2.2: {} 3314 + 3281 3315 babel-dead-code-elimination@1.0.12: 3282 3316 dependencies: 3283 3317 '@babel/core': 7.29.0 ··· 3938 3972 picomatch: 4.0.4 3939 3973 3940 3974 tinypool@2.1.0: {} 3975 + 3976 + tlds@1.261.0: {} 3941 3977 3942 3978 to-regex-range@5.0.1: 3943 3979 dependencies:
+3 -1
tap/dev.sh
··· 5 5 export TAP_IDENT_CACHE_SIZE="20000" 6 6 export TAP_RELAY_URL="https://relay1.us-west.bsky.network" 7 7 export TAP_SIGNAL_COLLECTION="sh.tangled.actor.profile" 8 + export TAP_RESYNC_PARALLELISM="20" 8 9 9 - tap run 10 + touch ./tap.log 11 + tap run >> ./tap.log