Skip to content

Commit

Permalink
feat: farcaster staging models (#1320)
Browse files Browse the repository at this point in the history
* Add Farcaster sources
* Pull out profile data from the JSON
* Get non-deleted verifications
  • Loading branch information
ryscheng authored Apr 30, 2024
1 parent 3c4a366 commit 944a580
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions warehouse/dbt/models/farcaster_sources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sources:
- name: farcaster
database: opensource-observer
schema: farcaster
tables:
- name: farcaster_verifications
identifier: verifications
- name: farcaster_profiles
identifier: profiles

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{#
Get all verified addresses attached to an FID
#}

SELECT
v.fid AS fid,
v.address AS address
FROM {{ source("farcaster", "farcaster_verifications") }} AS v
WHERE v.deleted_at IS NULL
13 changes: 13 additions & 0 deletions warehouse/dbt/models/staging/farcaster/stg_farcaster__profiles.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{#
Get all farcaster profiles from the JSON
#}

SELECT
profiles.fid AS fid,
profiles.custody_address AS custody_address,
JSON_EXTRACT(profiles.data, "$.username") AS username,
JSON_EXTRACT(profiles.data, "$.display") AS display_name,
JSON_EXTRACT(profiles.data, "$.pfp") AS profile_picture_url,
JSON_EXTRACT(profiles.data, "$.bio") AS bio,
JSON_EXTRACT(profiles.data, "$.url") AS url
FROM {{ source("farcaster", "farcaster_profiles") }} AS profiles

0 comments on commit 944a580

Please sign in to comment.