Invidious is an alternative front-end to YouTube
Speed up table creation
Omar Roth28d5bedcc737
diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.crindex 3c75e7a7..bf96842f 100644--- a/src/invidious/helpers/helpers.cr+++ b/src/invidious/helpers/helpers.cr@@ -501,7 +501,9 @@ enddef analyze_table(db, logger, table_name, struct_type = nil)# Create table if it doesn't exist- if !db.query_one?("SELECT true FROM information_schema.tables WHERE table_name = $1", table_name, as: Bool)+ begin+ db.exec("SELECT * FROM #{table_name} LIMIT 0")+ rescue exlogger.write("CREATE TABLE #{table_name}\n")db.using_connection do |conn|