Comment on page
Ethereum Name Service (ENS) tables available to query via SQL
The columns and their schema available for each table can be viewed with the
describe <table>command. For example:
/* Show the columns available */
User can query this table by ENS domain name to retrieve the latest
eth_addressinformation. Supported names are:
- Top Level Domains (.eth)
This table can be used, for example, to retrieve the Ethereum address associated with a
*.ethdomain or subdomain:
SELECT * FROM ens.domains WHERE name='spiceai.eth'
SELECT * FROM ens.domains WHERE name='ccc.earth.eth'
Or to infer the domain name of an address (reverse look-up):
SELECT * FROM ens.domains WHERE eth_address='0x425ec049c2a4722edfd770ab7bc4f9ca8b7bd815'
Expiration dates in the
expirescolumn are given as Unix timestamps. They can be
nullfor entities such as subdomains, which do not necessarily have expiry dates. We currently do not track expiration dates of NameWrapper subdomains.
Query performance can be significantly improved by adding
WHEREclauses to your query on specific indexed columns.