From bc3e110caac59452b5bf4cce548eb321948e737a Mon Sep 17 00:00:00 2001
From: jonasled <jonas@jonasled.de>
Date: Sun, 23 Feb 2020 21:20:55 +0100
Subject: [PATCH] removed clonedb file

---
 clonedb.py | 32 --------------------------------
 1 file changed, 32 deletions(-)
 delete mode 100644 clonedb.py

diff --git a/clonedb.py b/clonedb.py
deleted file mode 100644
index d1c2946..0000000
--- a/clonedb.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env python3
-# This script will clone all entries from the database. I ised this to show what happens with extreme database sizes.
-#The output will be in excel-style CSV (";" instead of "," as column seperator.)
-
-from sqlite3 import connect, OperationalError
-from tqdm import tqdm
-
-create_table = """
-    CREATE TABLE WEB_URL(
-    ID INTEGER PRIMARY KEY AUTOINCREMENT,
-    LONG_URL TEXT NOT NULL, SHORT_URL TEXT NOT NULL
-    );
-    """
-with connect('db/urls.db') as conn:
-    cursor = conn.cursor()
-    try: #Try making the database structure, if succeeded, exit, because there can't be any data.
-        cursor.execute(create_table)
-        raise Exception('No database Found', "Can't find the database ==> No data to clone")
-    except OperationalError:
-        pass
-
-conn = connect('db/urls.db')
-cursor = conn.cursor()
-res = cursor.execute('SELECT LONG_URL, SHORT_URL FROM WEB_URL WHERE 1') #read all data from database
-with connect('db/urls.db') as conn2:
-    cursor2 = conn2.cursor()
-    for entries in tqdm(res.fetchall()):
-        cursor2.execute( #Insert the data in the SQL table
-            'INSERT INTO WEB_URL (LONG_URL, SHORT_URL) VALUES (?, ?)',
-            [entries[0], entries[1]]
-        )
-print("Database duplicated")
\ No newline at end of file
-- 
GitLab