internet_mapper/schema.surql
2024-08-23 05:22:49 -06:00

11 lines
628 B
Plaintext

DEFINE TABLE website SCHEMAFULL;
DEFINE FIELD accessed_at ON TABLE website TYPE datetime DEFAULT time::now();
DEFINE FIELD crawled ON TABLE website TYPE bool DEFAULT false;
DEFINE FIELD url ON TABLE website TYPE string;
DEFINE FIELD domain ON TABLE website VALUE parse::url::domain($this.url) ASSERT !type::is::none($value);
DEFINE FIELD path ON TABLE website VALUE parse::url::path($this.url) ASSERT !type::is::none($value);
DEFINE TABLE links_to SCHEMAFULL TYPE RELATION FROM website TO website;
DEFINE FIELD discovered_at ON TABLE links_to TYPE datetime DEFAULT time::now();