From 72c09e544d07790309328866dcc8fe4ff531c138 Mon Sep 17 00:00:00 2001 From: ccppi Date: Mon, 22 Jul 2024 14:57:55 +0200 Subject: [PATCH] =?UTF-8?q?weis=20n=C3=B6mme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db.nim | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 db.nim diff --git a/db.nim b/db.nim new file mode 100644 index 0000000..c1bd83d --- /dev/null +++ b/db.nim @@ -0,0 +1,19 @@ +import db_connector/db_sqlite + +let db = open("data/db.sqlite3","","","") + +db.exec(sql""" CREATE TABLE IF NOT EXISTS flats ( + adId INTEGER, + title STRING, + price INTEGER, + propertyTypeText STRING, + essentialInformation STRING, + address STRING, + date STRING, + image STRING, + starred INTEGER, + lastChecked REAL)""") + +db.exec(sql"INSERT INTO flats (adID,title,price,propertyTypeText,essentialInformation,address) VALUES(?,?,?,?,?,?)","0921583","SomeTitle",1003,"blablabla","sonstige infos","möchtegernstrasse 1") + +proc [T]addEntry(var