check / check (push) Successful in 1m41s
Every IP lookup result gains `geo`. One request to geojs carries all uncached addresses of a lookup, within 1 second. On a timeout, an error or an answer with no location, the lookup reads DB-IP City Lite, downloaded monthly into the state directory. Geojs answers stay in memory, at most 250,000, and in `cache.db` for 7 days. The home page footer credits DB-IP. Judgement call: a reserved address goes to neither source, and its `geo` is null. Judgement call: `updated` for a DB-IP answer is when the copy was downloaded. Deviation: the cache is SQLite, by sneak's words, not the JSON file the standing rule asks for. Model: opus-5-5
25 lines
724 B
SQL
25 lines
724 B
SQL
-- hostnames holds the PTR names of addresses. names has the names separated by
|
|
-- spaces, and is empty for an address with no PTR names. expires_at is in
|
|
-- seconds since 1970.
|
|
CREATE TABLE IF NOT EXISTS hostnames (
|
|
address TEXT PRIMARY KEY,
|
|
names TEXT NOT NULL,
|
|
expires_at INTEGER NOT NULL
|
|
);
|
|
|
|
-- geolocations holds the answers of geojs. A part geojs does not know is NULL.
|
|
-- fetched_at is in seconds since 1970.
|
|
CREATE TABLE IF NOT EXISTS geolocations (
|
|
address TEXT PRIMARY KEY,
|
|
country_code TEXT,
|
|
country TEXT,
|
|
continent_code TEXT,
|
|
region TEXT,
|
|
city TEXT,
|
|
latitude REAL,
|
|
longitude REAL,
|
|
accuracy_radius_km INTEGER,
|
|
time_zone TEXT,
|
|
fetched_at INTEGER NOT NULL
|
|
);
|