constnewMapsAmount=(awaitsqlite.get(`SELECT count(Map) FROM maps ${date?`WHERE Timestamp > datetime('${date}')`:''} ORDER BY Timestamp`))['count(Map)']
log(`Found ${newMapsAmount} new maps!`)
letaddedMaps=0
awaitsqlite.each(
`SELECT Map, Server, Points, Stars, Mapper, Timestamp FROM maps ${date?`WHERE Timestamp > datetime('${date}')`:''} ORDER BY Timestamp`,
constnewPlayerAmount=(awaitsqlite.get(`select count(Name) FROM (SELECT Name, Timestamp FROM (SELECT Name, Timestamp FROM (SELECT * FROM race ORDER BY Timestamp ASC, Name ASC) GROUP BY Name) ${date?`WHERE Timestamp > datetime('${date}')`:''} ORDER BY Timestamp ASC)`))['count(Name)']
if(newPlayerAmount===0)returnlog("No new players found...")
awaitsqlite.exec("CREATE TABLE temp(Name varchar(128) NOT NULL, Timestamp timestamp NOT NULL)")
awaitsqlite.exec(`INSERT INTO TEMP (Name, Timestamp) SELECT Name, Timestamp FROM (SELECT Name, Timestamp FROM (SELECT Name, Timestamp FROM (SELECT * FROM race ORDER BY Timestamp ASC, Name ASC) GROUP BY Name) ${date?`WHERE Timestamp > datetime('${date}')`:''} ORDER BY Timestamp ASC)`)
log("Imported new players into 'temp'!")
letaddedPlayers=0
letoffset=-1
while(offset<newPlayerAmount){
awaitsqlite.each(
`SELECT Name, Timestamp FROM temp LIMIT 10000 OFFSET ${offset+1}`,