-
Notifications
You must be signed in to change notification settings - Fork 17
docs: extend ENS Unigraph examples #2264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tk-o
wants to merge
8
commits into
main
Choose a base branch
from
docs/extend-ens-unigraph-examples
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
82781f3
Apply feedback from Slack and PR 2227
tk-o a309cb7
Setup ENS Unigraph exmaple files
tk-o d4e91df
Extend ENS Unigraph examples
tk-o 5589ee0
Merge remote-tracking branch 'origin/main' into docs/extend-ens-unigr…
tk-o 2b41753
Apply AI PR feedback
tk-o 8b2ce94
Make examples to use latest indexed columns in domains table
tk-o 131bc36
Apply AI PR feedback
tk-o 0a0b6f2
Apply AI PR feedback
tk-o File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -38,7 +38,7 @@ const defaultResultNote = | |
|
|
||
| <SqlResultTable rows={sql.result} /> | ||
|
|
||
| <StaticExampleNote class="px-5 pb-5">{sql.resultNote ?? defaultResultNote}</StaticExampleNote> | ||
| <StaticExampleNote class="px-5 pb-5" set:html={sql.resultNote ?? defaultResultNote} /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| </UnigraphExampleSQLTab> | ||
|
|
||
| <UnigraphExampleEnsDbSdkTab> | ||
|
|
@@ -54,8 +54,6 @@ const defaultResultNote = | |
|
|
||
| <SqlResultTable rows={ensDbSdk.result} /> | ||
|
|
||
| <StaticExampleNote class="px-5 pb-5"> | ||
| {ensDbSdk.resultNote ?? defaultResultNote} | ||
| </StaticExampleNote> | ||
| <StaticExampleNote class="px-5 pb-5" set:html={ensDbSdk.resultNote ?? defaultResultNote} /> | ||
|
|
||
| </UnigraphExampleEnsDbSdkTab> | ||
| </UnigraphExampleWrapper> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
.../ensnode.io/src/content/docs/docs/integrate/unigraph/examples/domain-events.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,29 @@ | ||||||
| --- | ||||||
| title: Domain Events | ||||||
| description: Fetch recent events for a Domain from the ENS Unigraph by its canonical name. | ||||||
| sidebar: | ||||||
| label: Domain Events | ||||||
| --- | ||||||
|
|
||||||
| import UnigraphStaticExample from "@components/molecules/unigraph-static-example/UnigraphStaticExample.astro"; | ||||||
| import EnsDbWriterSchemaIntro from "@components/molecules/EnsDbWriterSchemaIntro.astro"; | ||||||
| import EnsDbReaderIntro from "@components/molecules/EnsDbReaderIntro.astro"; | ||||||
| import { exampleDomainEvents } from "@data/unigraph-examples/domain-events"; | ||||||
|
|
||||||
| :::caution[`unigraph` plugin required] | ||||||
| Performing SQL queries on the ENS Unigraph requires that you have the `unigraph` plugin activated in your ENSNode instance. [Learn more](/docs/services/ensindexer/usage/configuration) | ||||||
| ::: | ||||||
|
|
||||||
| Fetch recent events for a Domain by its canonical name. This example joins the `events`, `domain_events`, and `domains` tables to retrieve domain events associated with the `vitalik.eth` name. See [Connect](/docs/integrate/unigraph/examples) for setup. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Documentation text mentions "vitalik.eth" but the actual example code uses "wrapnation.eth" |
||||||
|
|
||||||
| :::note[Canonical fields] | ||||||
| Canonical fields are populated on every Domain reachable from the canonical root, across both ENSv1 and ENSv2 — query them uniformly without branching by `type`. In SQL, these columns are `canonical_name`, `canonical_path`, `canonical_node`, and `canonical_depth`; in `ensdb-sdk`, the corresponding fields are `canonicalName`, `canonicalPath`, `canonicalNode`, and `canonicalDepth`. | ||||||
| ::: | ||||||
|
|
||||||
| <UnigraphStaticExample | ||||||
| sql={exampleDomainEvents.sql} | ||||||
| ensDbSdk={exampleDomainEvents.sdk} | ||||||
| > | ||||||
| <EnsDbWriterSchemaIntro ensDbWriterSchemaName="ensindexer_0" slot="sql-tab-note"/> | ||||||
| <EnsDbReaderIntro slot="ensdb-sdk-tab-note"/> | ||||||
| </UnigraphStaticExample> | ||||||
25 changes: 25 additions & 0 deletions
25
.../content/docs/docs/integrate/unigraph/examples/domains-fuzzy-search-by-name.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| title: Fuzzy Search for ENS Names | ||
| description: Perform a fuzzy search for ENS names. | ||
| sidebar: | ||
| label: Fuzzy Search | ||
| --- | ||
|
|
||
| import UnigraphStaticExample from "@components/molecules/unigraph-static-example/UnigraphStaticExample.astro"; | ||
| import EnsDbWriterSchemaIntro from "@components/molecules/EnsDbWriterSchemaIntro.astro"; | ||
| import EnsDbReaderIntro from "@components/molecules/EnsDbReaderIntro.astro"; | ||
| import { exampleDomainsFuzzySearchByName } from "@data/unigraph-examples/domains-fuzzy-search-by-name"; | ||
|
|
||
| :::caution[`unigraph` plugin required] | ||
| Performing SQL queries on the ENS Unigraph requires that you have the `unigraph` plugin activated in your ENSNode instance. [Learn more](/docs/services/ensindexer/usage/configuration) | ||
| ::: | ||
|
|
||
| Fetch Domains with names similar to a query string, ranked by similarity. This example uses PostgreSQL's `pg_trgm` extension, which provides the `%` operator for fuzzy matching and the `similarity()` function for ranking results. See [Connect](/docs/integrate/unigraph/examples) for setup. | ||
|
|
||
| <UnigraphStaticExample | ||
| sql={exampleDomainsFuzzySearchByName.sql} | ||
| ensDbSdk={exampleDomainsFuzzySearchByName.sdk} | ||
| > | ||
| <EnsDbWriterSchemaIntro ensDbWriterSchemaName="ensindexer_0" slot="sql-tab-note"/> | ||
| <EnsDbReaderIntro slot="ensdb-sdk-tab-note"/> | ||
| </UnigraphStaticExample> |
25 changes: 25 additions & 0 deletions
25
...io/src/content/docs/docs/integrate/unigraph/examples/expiring-registrations.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| title: Expiring ENS Registrations | ||
| description: Fetch ENS registrations that are about to expire. | ||
| sidebar: | ||
| label: Expiring Registrations | ||
| --- | ||
|
|
||
| import UnigraphStaticExample from "@components/molecules/unigraph-static-example/UnigraphStaticExample.astro"; | ||
| import EnsDbWriterSchemaIntro from "@components/molecules/EnsDbWriterSchemaIntro.astro"; | ||
| import EnsDbReaderIntro from "@components/molecules/EnsDbReaderIntro.astro"; | ||
| import { exampleExpiringRegistrations } from "@data/unigraph-examples/expiring-registrations"; | ||
|
|
||
| :::caution[`unigraph` plugin required] | ||
| Performing SQL queries on the ENS Unigraph requires that you have the `unigraph` plugin activated in your ENSNode instance. [Learn more](/docs/services/ensindexer/usage/configuration) | ||
| ::: | ||
|
|
||
| Fetch Domains with registrations expiring within a certain timeframe. This example uses a simple `WHERE` clause to filter for Domains with `expiry` between the current time and a specified future time (e.g., 3 days from now). See [Connect](/docs/integrate/unigraph/examples) for setup. | ||
|
|
||
| <UnigraphStaticExample | ||
| sql={exampleExpiringRegistrations.sql} | ||
| ensDbSdk={exampleExpiringRegistrations.sdk} | ||
| > | ||
| <EnsDbWriterSchemaIntro ensDbWriterSchemaName="ensindexer_0" slot="sql-tab-note"/> | ||
| <EnsDbReaderIntro slot="ensdb-sdk-tab-note"/> | ||
| </UnigraphStaticExample> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.