diff --git a/models/doc_descriptions/general/__overview__.md b/models/doc_descriptions/general/__overview__.md index 090d73b..0553b16 100644 --- a/models/doc_descriptions/general/__overview__.md +++ b/models/doc_descriptions/general/__overview__.md @@ -90,6 +90,8 @@ Note: These tables ceased updating on Feburary 4th, 2024. - [dim_fids](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__dim_fids) - [dim_fnames](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__dim_fnames) - [dim_profile_with_addresses](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__dim_profile_with_addresses) +- [fact_blocks](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_blocks) +- [fact_channel_follows](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_channel_follows) - [fact_casts](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_casts) - [fact_links](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_links) - [fact_reactions](https://flipsidecrypto.github.io/external-models/#!/model/model.external_models.farcaster__fact_reactions) diff --git a/models/farcaster/gold/farcaster__fact_blocks.sql b/models/farcaster/gold/farcaster__fact_blocks.sql new file mode 100644 index 0000000..f068ef0 --- /dev/null +++ b/models/farcaster/gold/farcaster__fact_blocks.sql @@ -0,0 +1,22 @@ +{{ config( + materialized = 'view', + persist_docs ={ "relation": true, + "columns": true }, + tags = ['farcaster'], + meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'FARCASTER' } } } +) }} + +SELECT + blocker_fid, + blocked_fid, + id, + created_at, + deleted_at +FROM + {{ source( + 'external_bronze', + 'farcaster_blocks' + ) }} + qualify(ROW_NUMBER() over (PARTITION BY id +ORDER BY + created_at DESC)) = 1 diff --git a/models/farcaster/gold/farcaster__fact_blocks.yml b/models/farcaster/gold/farcaster__fact_blocks.yml new file mode 100644 index 0000000..0c67947 --- /dev/null +++ b/models/farcaster/gold/farcaster__fact_blocks.yml @@ -0,0 +1,18 @@ +version: 2 +models: + - name: farcaster__fact_blocks + description: Represents users that have blocked or been blocked. For more info see [Neynar](https://docs.neynar.com/docs/how-to-query-neynar-sql-playground-for-farcaster-data) or [schema](https://github.com/farcasterxyz/hub-monorepo/tree/51c57245df8ec1c68d616dd3ab8ae5b80edf68fd/apps/replicator) + + columns: + - name: BLOCKER_FID + description: The FID of the user that blocked the other user. + - name: BLOCKED_FID + description: The FID of the user that has been blocked. + - name: ID + description: Generic identifier specific to this DB (a.k.a. surrogate key) + - name: CREATED_AT + description: When the row was first created in this DB (not the same as the message timestamp!) + tests: + - not_null + - name: DELETED_AT + description: When the cast was considered deleted/revoked/pruned by the hub (e.g. in response to a CastRemove message, etc.) \ No newline at end of file diff --git a/models/farcaster/gold/farcaster__fact_channel_follows.sql b/models/farcaster/gold/farcaster__fact_channel_follows.sql new file mode 100644 index 0000000..233c2b6 --- /dev/null +++ b/models/farcaster/gold/farcaster__fact_channel_follows.sql @@ -0,0 +1,24 @@ +{{ config( + materialized = 'view', + persist_docs ={ "relation": true, + "columns": true }, + tags = ['farcaster'], + meta ={ 'database_tags':{ 'table':{ 'PROTOCOL': 'FARCASTER' } } } +) }} + +SELECT + TIMESTAMP, + fid, + channel_id, + id, + created_at, + updated_at, + deleted_at +FROM + {{ source( + 'external_bronze', + 'farcaster_channel_follows' + ) }} + qualify(ROW_NUMBER() over (PARTITION BY id +ORDER BY + updated_at DESC)) = 1 diff --git a/models/farcaster/gold/farcaster__fact_channel_follows.yml b/models/farcaster/gold/farcaster__fact_channel_follows.yml new file mode 100644 index 0000000..a05f9e7 --- /dev/null +++ b/models/farcaster/gold/farcaster__fact_channel_follows.yml @@ -0,0 +1,22 @@ +version: 2 +models: + - name: farcaster__fact_channel_follows + description: Represents follows for a Farcaster channel. For more info see [Neynar](https://docs.neynar.com/docs/how-to-query-neynar-sql-playground-for-farcaster-data) or [schema](https://github.com/farcasterxyz/hub-monorepo/tree/51c57245df8ec1c68d616dd3ab8ae5b80edf68fd/apps/replicator) + + columns: + - name: CHANNEL_ID + description: Unique identifier for the channel. + - name: TIMESTAMP + description: Message timestamp in UTC. + - name: FID + description: FID of the user that signed the message. + - name: ID + description: Generic identifier specific to this DB (a.k.a. surrogate key) + - name: CREATED_AT + description: When the row was first created in this DB (not the same as the message timestamp!) + - name: UPDATED_AT + description: When the row was last updated. + tests: + - not_null + - name: DELETED_AT + description: When the cast was considered deleted/revoked/pruned by the hub (e.g. in response to a CastRemove message, etc.) \ No newline at end of file diff --git a/models/sources.yml b/models/sources.yml index 6f5c55d..52f05b1 100644 --- a/models/sources.yml +++ b/models/sources.yml @@ -75,6 +75,7 @@ sources: database: external schema: bronze tables: + - name: farcaster_blocks - name: farcaster_casts - name: farcaster_fids - name: farcaster_fnames @@ -84,5 +85,6 @@ sources: - name: farcaster_reactions - name: farcaster_user_data - name: farcaster_verifications + - name: farcaster_channel_follows - name: farcaster_profile_with_addresses - name: farcaster_warpcast_power_users \ No newline at end of file